-
Notifications
You must be signed in to change notification settings - Fork 2.6k
follow-chain
testing mode for try-runtime (and revamp CLI configs).
#9788
Conversation
Can't you subscribe/poll |
sure, but what would you do about it other than stopping? that's practically equal to what I do now, which is |
yeah right, dumb question I guess it's not much to do without updating..... |
follow-chain
testing mode for try-runtime (and other minor fixes). follow-chain
testing mode for try-runtime (and other fixes).
follow-chain
testing mode for try-runtime (and other fixes). follow-chain
testing mode for try-runtime (and revamp CLI configs).
frame/executive/src/lib.rs
Outdated
// don't call `final_checks`, but do finalize the block. This is critical to clear transient | ||
// storage items, such as weight. | ||
let _header = <frame_system::Pallet<System>>::finalize(); | ||
|
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.
Would wonder if there is some migration that would pass all the tests written, but then actually cause a problem on final checks, but we dont see that now
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.
unlikely, but yeah that's just a pill that we have to swallow here. Final checks does:
- header digest check (don't know what it does -- not is it relevant IMO)
- state root check
- extrinsic root check
This actually makes me think: maybe I can re-introduce item 1 and 3, since they should work. Only the state root is guaranteed to fail, since :CODE:
has changed.
use remote_externalities::{rpc_api, Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig}; | ||
//! # Try-runtime | ||
//! | ||
//! Substrate's ultimate testing framework for the power users. |
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.
kian pats himself on the back
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.
shamelessly advertising 😅
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.
Looks reasonable at a high level. Can scrub deeper if needed
bot merge |
Waiting for commit status. |
* companion for paritytech/substrate#9788 * fmt * Some fixes * final fixes * fix a few small things * update Substrate Co-authored-by: parity-processbot <>
…#9788) * deadlock, need to ask someone to help now * Finally it seems to be working.. at least for a few blocks * self-review * major mega revamp * some small fixes * another mega refactor * add license * Apply suggestions from code review * hack around signature verification * Some fixes * Update utils/frame/try-runtime/cli/src/lib.rs Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com> * Update utils/frame/try-runtime/cli/src/lib.rs Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com> * Update utils/frame/try-runtime/cli/src/lib.rs Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com> * final tweaks, hopefully. * a little self-review * Add the ext root check Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com>
* companion for paritytech/substrate#9788 * fmt * Some fixes * final fixes * fix a few small things * update Substrate Co-authored-by: parity-processbot <>
# Membership Request Hi, I am Kian Paimani, known as @kianenigma. I have been working on Polkadot/Kusama through Parity since February 2019 and I can categorize my main contributions to Polkadot's ecosystem as follows: 1. Maintaining and developing the staking sub-system. 2. General FRAME development, especially testing and quality assurance. 3. Polkadot-native side-projects. 4. Education > My first contribution to Polkadot is also indeed related to staking: paritytech/substrate#1915 ### Staking system I joke as the Polkadot staking to be both my blessing and my curse over the years. I started working on it since the first days that I joined this ecosystem and the work [is ongoing ever since](https://github.com/orgs/paritytech/projects/33/views/9). In the past, I focused on making sure that the staking system is secure and to some extent scalable. More recently, I coordinated the (imminent) launch of Nomination Pools. Nowadays I also put an extra effort on making sure that this sub-system of Polkadot is *sustainable*, through code refactor and educating other core developers. Lastly, I have been the main author of the [Polkadot staking newsletter](https://gist.github.com/kianenigma/aa835946455b9a3f167821b9d05ba376), which is my main attempt at making the entire complexity and development of this part of the protocol transparent to the end-users. I expect myself to contribute *directly* to the staking system for at least another ~12, if not more, and afterwards having the role of an advisor. Some notable contributions: - paritytech/substrate#4517 - paritytech/substrate#7910 - paritytech/substrate#6242 - paritytech/substrate#9415 - paritytech/polkadot#3141 - paritytech/substrate#11212 - paritytech/substrate#12129 ### FRAME Historically, I have contributed a variety of domains in FRAME, namely: - Early version of the weight system paritytech/substrate#3816 paritytech/substrate#3157 - Early version of the transaction fee system - Primitive arithmetic types paritytech/substrate#3456 - Council election pallet paritytech/substrate#3364 Many of which were, admittedly, a PoC at most, if not considered "poor". I am happy that nowadays many of the above have been refactored and are being maintained by new domain experts. These days, I put most of my FRAME focus on testing and quality assurance. Through my work in the staking system, I have had to deal with the high sensitivity and liveness requirement of protocol development first hand (I believe I had to do among the [very first storage migrations](paritytech/substrate#3948) in Kusama) and consequently I felt the need to make better testing facilities, all of which have been formulated in https://forum.polkadot.network/t/testing-complex-frame-pallets-discussion-tools/356. Some relevant PRs: - paritytech/substrate#8038 - paritytech/substrate#9788 - paritytech/substrate#10174 Regardless of wearing the staking hat, I plan to remain a direct contributor to FRAME, namely because I consider it to be an important requirements of successfully delivering more features to Polkadot's ecosystem. ### Polkadot-Native Side Projects I have started multiple small, mostly non-RUST projects in the polkadot ecosystem that I am very happy about, and I plan to continue doing so. I have not yet found the time to make a "polished product" out of any of these, but I hope that I can help foster our community such that someday a team will do so. I consider my role, for the time being, to *put ideas out there* through these side projects. - https://github.com/substrate-portfolio/polkadot-portfolio/ - https://github.com/kianenigma/polkadot-basic-notification/ - https://github.com/paritytech/polkadot-scripts/ - https://github.com/paritytech/substrate-debug-kit/ ### Education Lastly, aside from having had a number of educational talks over the years (all of which [are listed](https://hello.kianenigma.nl/talks/) in my personal website), I am a big enthusiast of the newly formed Polkadot Blockchain Academy. I have [been an instructor](https://singular.app/collectibles/statemine/16/2) in the first cohort, and continue to contribute for as long and as much as I can, whilst still attending to the former 3 duties. --- With all of that being said and done, I consider myself at the beginning of the path to Dan 4, but happy to start at a lower one as well.
# Membership Request Hi, I am Kian Paimani, known as @kianenigma. I have been working on Polkadot/Kusama through Parity since February 2019 and I can categorize my main contributions to Polkadot's ecosystem as follows: 1. Maintaining and developing the staking sub-system. 2. General FRAME development, especially testing and quality assurance. 3. Polkadot-native side-projects. 4. Education > My first contribution to Polkadot is also indeed related to staking: paritytech/substrate#1915 ### Staking system I joke as the Polkadot staking to be both my blessing and my curse over the years. I started working on it since the first days that I joined this ecosystem and the work [is ongoing ever since](https://github.com/orgs/paritytech/projects/33/views/9). In the past, I focused on making sure that the staking system is secure and to some extent scalable. More recently, I coordinated the (imminent) launch of Nomination Pools. Nowadays I also put an extra effort on making sure that this sub-system of Polkadot is *sustainable*, through code refactor and educating other core developers. Lastly, I have been the main author of the [Polkadot staking newsletter](https://gist.github.com/kianenigma/aa835946455b9a3f167821b9d05ba376), which is my main attempt at making the entire complexity and development of this part of the protocol transparent to the end-users. I expect myself to contribute *directly* to the staking system for at least another ~12, if not more, and afterwards having the role of an advisor. Some notable contributions: - paritytech/substrate#4517 - paritytech/substrate#7910 - paritytech/substrate#6242 - paritytech/substrate#9415 - paritytech/polkadot#3141 - paritytech/substrate#11212 - paritytech/substrate#12129 ### FRAME Historically, I have contributed a variety of domains in FRAME, namely: - Early version of the weight system paritytech/substrate#3816 paritytech/substrate#3157 - Early version of the transaction fee system - Primitive arithmetic types paritytech/substrate#3456 - Council election pallet paritytech/substrate#3364 Many of which were, admittedly, a PoC at most, if not considered "poor". I am happy that nowadays many of the above have been refactored and are being maintained by new domain experts. These days, I put most of my FRAME focus on testing and quality assurance. Through my work in the staking system, I have had to deal with the high sensitivity and liveness requirement of protocol development first hand (I believe I had to do among the [very first storage migrations](paritytech/substrate#3948) in Kusama) and consequently I felt the need to make better testing facilities, all of which have been formulated in https://forum.polkadot.network/t/testing-complex-frame-pallets-discussion-tools/356. Some relevant PRs: - paritytech/substrate#8038 - paritytech/substrate#9788 - paritytech/substrate#10174 Regardless of wearing the staking hat, I plan to remain a direct contributor to FRAME, namely because I consider it to be an important requirements of successfully delivering more features to Polkadot's ecosystem. ### Polkadot-Native Side Projects I have started multiple small, mostly non-RUST projects in the polkadot ecosystem that I am very happy about, and I plan to continue doing so. I have not yet found the time to make a "polished product" out of any of these, but I hope that I can help foster our community such that someday a team will do so. I consider my role, for the time being, to *put ideas out there* through these side projects. - https://github.com/substrate-portfolio/polkadot-portfolio/ - https://github.com/kianenigma/polkadot-basic-notification/ - https://github.com/paritytech/polkadot-scripts/ - https://github.com/paritytech/substrate-debug-kit/ ### Education Lastly, aside from having had a number of educational talks over the years (all of which [are listed](https://hello.kianenigma.nl/talks/) in my personal website), I am a big enthusiast of the newly formed Polkadot Blockchain Academy. I have [been an instructor](https://singular.app/collectibles/statemine/16/2) in the first cohort, and continue to contribute for as long and as much as I can, whilst still attending to the former 3 duties. --- With all of that being said and done, I consider myself at the beginning of the path to Dan 4, but happy to start at a lower one as well. Co-authored-by: Bastian Köcher <git@kchr.de>
* companion for paritytech/substrate#9788 * fmt * Some fixes * final fixes * fix a few small things * update Substrate Co-authored-by: parity-processbot <>
* companion for paritytech/substrate#9788 * fmt * Some fixes * final fixes * fix a few small things * update Substrate Co-authored-by: parity-processbot <>
closes #9027
closes #9570
somewhat related #2082
And does a major cleanup and revamp of the try-runtime cli to hopefully make it more easy to use.
polkadot companion: paritytech/polkadot#3858
And, finally, it adds a new
follow-chain
command to try-runtime. This will copy a live chain's state, dump it into aTestExternalities
as usual, and keep applying the extrinsics of a live chain as new block come in using the current runtime. This means running this withwss://rpc.polkadot.io
in substrate is nonsense since it will try and decode + execute polkadot blocks insubstrate-node
.@sacha-l some arguments change in this PR. Can you make an issue in the devhub to update the docs? it should be fairly simply to update, if any.
Using this is still tricky, there are a few considerations:
try-runtime
entirely, to make this part a bit easier.An alternative flow to avoid the previous caveats is that you would backport your feature branch to the branch of the latest release, ensuring that almost certainly the above two variables have not changed (unless if your feature branch is literally changing the block format etc.)
live::at
to be omitted, and replaced with the latest finalized block.mock signature verification. UPDATE: can mock the signature verification, but then this messes with the signed extension executions. The situation was that I would get aExhaustResource
error this time, if the spec-versions did not match. I might revisit this in the future. For future references, this is the commit that removes mocking signature verification:7d60da9
(#9788)unwraps
.A different, more cumbersome, but more realistic way of doing this is:
Use
fork-of-substrate
and create a new chain. Use a custom runtime in there that is your feature branch + sudo or some other pallet that allows us to execute arbitrary transactions. Then run this chain in the same was asfork-of-substrate
, and run binary next to it that scans a live chain, and forwards the new transactions to the "backdoor" (e.g. sudo) of the forked chain.This is obviously too much work. Maybe the only worthwhile way of doing this is if we establish RPC connections in the
fn offchain_worker
, and make it all seamless. So, you'd have a feature branch. You add this newmagic-testing-pallet
to it, and run it, and it would mirror a real chain for you.The current scheme also allows for rather easy scripting and testing, other than being simpler.