-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
be4c5bc
to
fb6d8c8
Compare
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
fb6d8c8
to
cca0c81
Compare
Signed-off-by: Alexandru Vasile <[email protected]>
The logic looks good to me. Can't comment on the code organization. |
I think it's better to call the crate For now it's probably alright to have the |
Co-authored-by: Niklas Adolfsson <[email protected]>
Co-authored-by: Niklas Adolfsson <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me.
Signed-off-by: Alexandru Vasile <[email protected]>
We have also decided to remove the |
/// | ||
/// # Unstable | ||
/// | ||
/// This method is unstable and subject to change in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these all unstable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although they will be part of the final RPC, these methods are expected to go through a testing phase before standardizing and replacing the old API. During this time (1-2months TBD), we can still add breaking changes. At least, that's how I interpret the unstable
from the spec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is my understanding of Pierre's suggestion with this spec; we get them in marked as unstable and then have the opporunity to stabilise them when we're happy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except all the wrong license years.
Signed-off-by: Alexandru Vasile <[email protected]>
/// | ||
/// This method is unstable and subject to change in the future. | ||
#[method(name = "chainSpec_unstable_genesisHash")] | ||
fn chain_spec_unstable_genesis_hash(&self) -> RpcResult<String>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny thing; I think of chainspec
as one word personally; chainspec_unstable_genesis_hash
for instance.
Not bothered either way though :)
* rpc/chain_spec: Add traits for `chainSpec` API Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_spec: Implement `chainSpec` RPC methods Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_spec: Add tests Signed-off-by: Alexandru Vasile <[email protected]> * bin/node: Enable `chainSpec` API Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_spec: Assume `genesis_hash` as non-empty Signed-off-by: Alexandru Vasile <[email protected]> * Update client/rpc-spec/Cargo.toml Co-authored-by: Niklas Adolfsson <[email protected]> * Update client/rpc-spec/src/lib.rs Co-authored-by: Niklas Adolfsson <[email protected]> * client/rpc_spec: Rename crate to `rpc_spec_v2` Signed-off-by: Alexandru Vasile <[email protected]> * rpc-servers: Remove the `version` field from `rpc_methods` Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_spec: Fix copyright years Signed-off-by: Alexandru Vasile <[email protected]> Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]>
Mimics the change done here: paritytech/substrate#12261 Let's merge this PR only if paritytech/substrate#12261 is approved and merged.
* master: [Fix] parameter_types! dead code errors (#12340) [Feature] Sequential migration execution for try-runtime (#12319) bench: Use `_` instead of `::` in auto-generated file names (#12332) Fast Unstake Pallet (#12129) Rename anonymous to pure proxy (#12283) Migrate remaining old decl_* macros to the new pallet attribute macros (#12271) pallet-utility: Disallow none origin (#12321) Make automatic storage deposits resistant against changing deposit prices (#12083) Format templates and fix `--steps` default value (#12286) Bump `wasmtime` to 1.0.0 (#12317) Introduce 'intermediate_insert' method to hide implementation details (#12215) Bound staking storage items (#12230) Use `array-bytes` for All Array/Bytes/Hex Operations (#12190) BREAKING: Rename Origin (#12258) Use temporary db for benchmarking (#12254) rpc: Implement `chainSpec` RPC API (#12261) Import target block body during warp sync (#12300) Proper naming wrt expectations (#12311) [ci] Revert cancel-pipeline job (#12309)
* rpc/chain_spec: Add traits for `chainSpec` API Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_spec: Implement `chainSpec` RPC methods Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_spec: Add tests Signed-off-by: Alexandru Vasile <[email protected]> * bin/node: Enable `chainSpec` API Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_spec: Assume `genesis_hash` as non-empty Signed-off-by: Alexandru Vasile <[email protected]> * Update client/rpc-spec/Cargo.toml Co-authored-by: Niklas Adolfsson <[email protected]> * Update client/rpc-spec/src/lib.rs Co-authored-by: Niklas Adolfsson <[email protected]> * client/rpc_spec: Rename crate to `rpc_spec_v2` Signed-off-by: Alexandru Vasile <[email protected]> * rpc-servers: Remove the `version` field from `rpc_methods` Signed-off-by: Alexandru Vasile <[email protected]> * rpc/chain_spec: Fix copyright years Signed-off-by: Alexandru Vasile <[email protected]> Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]>
This PR lays the ground for the implementation of the RPC spec
and adds the
chainSpec
methods.The RPC methods are placed in the
rpc-spec
crate subject tochange in the future.
The
chainSpec
methods include:chainSpec_unstable_chainName
- Get the chain name, as present in the chain specification.chainSpec_unstable_genesisHash
- Get the chain's genesis hash.chainSpec_unstable_properties
- Get the properties of the chain, as present in the chain specification.Testing Done
First part of #12071 .