paritytech / paritytech/try-runtime-cli

Expose RPC endpoint

オープン
#9 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement good first issue
主要言語
Rust
スター
25
フォーク
29
PR マージ指標
30日以内にマージされた PR はありません

説明

Original issue https://github.com/paritytech/substrate/issues/13563

When we do follow-chain, it would be useful to have the basic RPCs implemented and exposed on a specific port, so that you can connect PJS Apps to your fake chain.

An alternative for this is to actually integrate this in the node. https://github.com/paritytech/substrate/pull/12537 envisioned that you would be able to run a node that is normally syncing, but instead of calling Core_execute_block, it would call into TryRuntime_execute_block. This would give us a fully working client.


Relevant comment: https://github.com/paritytech/substrate/issues/13563#issuecomment-1498622775

the scenario that he is interested in is:

You run execute-block or fast-forward, and once the block have all executed, you want to inspect the state.

one way to approach this is to make try-runtime cli programmable, so you can define more tests to be written, but this is a holy PITA in Rust.

an easier way, which Alan from Moonbeam is also asking is, to make the try-runtime cli capable of implementing a few important RPCs like state_getStorage and so on, and then we query it with Polkadot JS api/apps.

in principle, I think this is not hard, but I have no idea how hard it is.

So, imagine the try-runtime CLI being able to return a value to a subset of the RPC requests, namely all of the ones that can be answered by having a state.

because end of the day, try-runtime-cli is just a wrapper for remote-externalities, which is a "test state".

the problem though is that the underlying remote-ext can have a partial state etc. So there are a lot of edge cases that we may not be able to handle, and developers might confuse themselves.

For example, you would run:

try-runtime fast-forward 1000 --rpc and this will run 1000 empty blocks for you, and the process is still running, hosting an RPC server.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

execute-block と fast-forward に対する try-runtime CLI のフローを読み、続いて remote-externalities がテスト状態をどのように提供するかを調査します。state_getStorage を含む、状態に基づくサポート対象の RPC サブセットを定義し、try-runtime fast-forward 1000 --rpc が実行後も RPC サーバーを稼働させ続け、Polkadot JS から結果の状態を検査できることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
api, blockchain, cli
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。