-
Notifications
You must be signed in to change notification settings - Fork 2.6k
try-runtime::fast-forward
#12896
try-runtime::fast-forward
#12896
Conversation
Once revived, I should remember to delete #12537 :) |
853100c
to
63ea95b
Compare
Won't the runtime panic if we don't set the timestamp correctly? |
Pallet fn on_timestamp_set(moment: T::Moment) {
let slot_duration = Self::slot_duration();
assert!(!slot_duration.is_zero(), "Aura slot duration cannot be zero.");
let timestamp_slot = moment / slot_duration;
let timestamp_slot = Slot::from(timestamp_slot.saturated_into::<u64>());
assert!(
CurrentSlot::<T>::get() == timestamp_slot,
"Timestamp slot must match `CurrentSlot`"
);
} which will fail if the timestamp is inconsistent with slot duration. Therefore, in |
I dont quite understand the problem. Why can you not multiple the block number with the block time? Like 6s normally? |
Effectively I'm doing this here, right?: let timestamp_idp = match maybe_prev_info {
Some((inherent_data, _)) => sp_timestamp::InherentDataProvider::new(
inherent_data.timestamp_inherent_data().unwrap().unwrap() +
BLOCKTIME_MILLIS,
),
None => sp_timestamp::InherentDataProvider::from_system_time(),
}; And this must be done (calculated) on the client side (i.e. outside Another thing is that I have |
@@ -184,11 +189,32 @@ pub fn run() -> sc_cli::Result<()> { | |||
let task_manager = | |||
sc_service::TaskManager::new(config.tokio_handle.clone(), registry) | |||
.map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?; | |||
|
|||
let info_provider = |_, maybe_prev_info: Option<(InherentData, Digest)>| async { |
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.
Slightly unfortunate that chains implementing try-runtime have to add this snippet. Also, this kinda breaks #12975, any alternatives?
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.
I definitely agree that this complicates things, but I'm afraid that as long as we want to remain chain-agnostic, similar approach must be taken.
Firstly, please notice that all other subcommands of try-runtime
were oblivious to the chain they were working with (as long it was exposing the proper runtime API calls). However, when it comes to block production (like in fast-forward
), we are facing the process that is often unique to every chain (here: inherents and digests). I suppose that majority of the chains in the ecosystem will have exactly the same configuration here (timestamp + aura), but this won't be true everywhere.
It can be also anticipated, that sooner or later we might enrich try-runtime
with new functionalities that will have some chain-dependent components. This is why in [12975](#12975 I proposed splitting try-runtime
tool into a part that contains pure (chain-agnostic) logic and a part where customization takes place. In this sense, I don't see using user snippet as breaking.
It seems like this is a misunderstanding. Everything in the try-runtime-cli crate is also "client side code", and has full access to system time in order to build the inherent and all. Only things within state_machine_call are actually runtime calls.
Yes, the misunderstanding comes from my poor wording - by 'client side code' I was referring to the CLI part, i.e. the code that handles user's input to the try-runtime
tool.
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.
Okay, two thoughts for now:
- it might help both of us find an alternative solution if you actually create a companion PR for this PR to Aleph-node, Polkadot, or some other client that actually requires a different setup. This will prove your point that we NEED this customization, but might shed some light into how else it could be done.
- If not useful, then I am happy to merge this and we shall find a better solution, even if it exists, in try-runtime-cli: path to being an independent CLI #12975. We should just document this label properly so that other parachain teams can easily follow-along and update their client integration.
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.
To find a client with different setup, I had to just complete this PR for node-cli
(i.e. substrate node) - there we have Babe instead of Aura, uncles and storage proof inherents. Apart from this, you can check:
- Polkadot with its
polkadot_node_core_parachains_inherent
(https://github.com/paritytech/polkadot/blob/master/node/service/src/lib.rs#L1155), or - Subspace with its
sp_consensus_subspace::inherents
(https://github.com/subspace/subspace/blob/main/crates/subspace-service/src/lib.rs#L282)
I don't want to push my approach, so if you see any alternative, I'm eager to implement it. Otherwise, if we stick to this way of customization (at least for now), I will create companion PR for Polkadot.
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.
I did not really check the code in here, but most of the stuff you are doing here is already provided for manual-seal:
substrate/client/consensus/manual-seal/src/consensus/aura.rs
Lines 75 to 90 in 4e38342
fn create_digest( | |
&self, | |
_parent: &B::Header, | |
inherents: &InherentData, | |
) -> Result<Digest, Error> { | |
let timestamp = | |
inherents.timestamp_inherent_data()?.expect("Timestamp is always present; qed"); | |
// we always calculate the new slot number based on the current time-stamp and the slot | |
// duration. | |
let digest_item = <DigestItem as CompatibleDigestItem<AuthoritySignature>>::aura_pre_digest( | |
Slot::from_timestamp(timestamp, self.slot_duration), | |
); | |
Ok(Digest { logs: vec![digest_item] }) | |
} |
In general, manual-seal already provides functionality to "fast-forward" as well.
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.
while semantically create_digest
is perfectly applicable in this PR, it requires a type that supports AuxStore + ProvideRuntimeApi<B> + UsageProvider<B>
for Aura or AuxStore + HeaderBackend<B> + HeaderMetadata<B, Error = sp_blockchain::Error> + UsageProvider<B> + ProvideRuntimeApi<B>
for Babe, which goes far out of scope what we use in either try-runtime
itself or even commands
modules
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.
I mean the logic should be shared. I also need to rewrite sp-api that you can use it here instead of calling functions by their name.
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.
Okay, apologies for misunderstanding. Do you think that I should make some steps towards this logic sharing in this PR? If so, then what would be the good place to put common things in?
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.
Maybe for now you just copy the relevant code to try-build
? And make it reusable for people? So that they don't always need to implement the logic?
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.
I couldn't find any try-build
, so I assumed that you meant try-runtime
... I moved both trait and two most common (I guess) impementations to a new module within try-runtime
. It cost a few sp-*
dependencies, but indeed, ease of usage is way higher. Please let me know if this is what you suggested.
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.
Most of the code looks very good, just worried about https://github.com/paritytech/substrate/pull/12896/files#r1063305503.
It seems like this is a misunderstanding. Everything in the try-runtime-cli crate is also "client side code", and has full access to system time in order to build the inherent and all. Only things within |
…/forward # Conflicts: # Cargo.lock # utils/frame/try-runtime/cli/Cargo.toml
Error: "Check reviews" status is not passing for paritytech/cumulus#2100 |
bot merge |
* try-runtime::fast-forward * Revert un`pub`ing command's fields * Handle storage change failure * Adjust Substrate node * Feature-gated imports * doc link * Feature-gated imports in node-template * Move trait, blanket implementation and auxiliary functions to a new module * Distinguish between plain babe+timestamp and substrate enhanced info * Remove uncles inherents * Missing argument * Add doc comment about `blocktime_millis` * Add licenses
* try-runtime::fast-forward * Revert un`pub`ing command's fields * Handle storage change failure * Adjust Substrate node * Feature-gated imports * doc link * Feature-gated imports in node-template * Move trait, blanket implementation and auxiliary functions to a new module * Distinguish between plain babe+timestamp and substrate enhanced info * Remove uncles inherents * Missing argument * Add doc comment about `blocktime_millis` * Add licenses
* try-runtime::fast-forward * Revert un`pub`ing command's fields * Handle storage change failure * Adjust Substrate node * Feature-gated imports * doc link * Feature-gated imports in node-template * Move trait, blanket implementation and auxiliary functions to a new module * Distinguish between plain babe+timestamp and substrate enhanced info * Remove uncles inherents * Missing argument * Add doc comment about `blocktime_millis` * Add licenses
* try-runtime::fast-forward * Revert un`pub`ing command's fields * Handle storage change failure * Adjust Substrate node * Feature-gated imports * doc link * Feature-gated imports in node-template * Move trait, blanket implementation and auxiliary functions to a new module * Distinguish between plain babe+timestamp and substrate enhanced info * Remove uncles inherents * Missing argument * Add doc comment about `blocktime_millis` * Add licenses
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-39/2277/1 |
Breaking changes from upstream: - Rename pallet-random-collective-flip to Insecure... paritytech/substrate#13301 - sc_service::BuildNetworkParams::warp_sync field has changed, paritytech/substrate#12761 - SortedListProvider::try_state() now only available for the try-runtime feature, see paritytech/substrate#13296 - When calling cmd.run() for try-runtime we also need something called BlockBuildingInfoProvider, see paritytech/substrate#12896 - Updaged function arguments b/c of mismatched types: --> node/rpc/src/task.rs:64:26 | 64 | api.offchain_nonce_key(&at, &account_id).map_err(|e| { | ------------------ ^^^ expected associated type, found `&BlockId<_>` | | | arguments to this method are incorrect | = note: expected associated type `<B as BlockT>::Hash` found reference `&BlockId<_>` --> sha3pow/src/lib.rs:84:33 | 84 | self.runtime_api().difficulty(&parent_id).map_err(|err| { | ---------- ^^^^^^^^^^ expected struct `H256`, found `&BlockId<B>` | | | arguments to this method are incorrect | = note: expected struct `H256` found reference `&BlockId<B>`
Breaking changes from upstream: - Rename pallet-random-collective-flip to Insecure... paritytech/substrate#13301 - sc_service::BuildNetworkParams::warp_sync field has changed, paritytech/substrate#12761 - SortedListProvider::try_state() now only available for the try-runtime feature, see paritytech/substrate#13296 - When calling cmd.run() for try-runtime we also need something called BlockBuildingInfoProvider, see paritytech/substrate#12896 - Updaged function arguments b/c of mismatched types: --> node/rpc/src/task.rs:64:26 | 64 | api.offchain_nonce_key(&at, &account_id).map_err(|e| { | ------------------ ^^^ expected associated type, found `&BlockId<_>` | | | arguments to this method are incorrect | = note: expected associated type `<B as BlockT>::Hash` found reference `&BlockId<_>` --> sha3pow/src/lib.rs:84:33 | 84 | self.runtime_api().difficulty(&parent_id).map_err(|err| { | ---------- ^^^^^^^^^^ expected struct `H256`, found `&BlockId<B>` | | | arguments to this method are incorrect | = note: expected struct `H256` found reference `&BlockId<B>`
Breaking changes from upstream: - Rename pallet-random-collective-flip to Insecure... paritytech/substrate#13301 - sc_service::BuildNetworkParams::warp_sync field has changed, paritytech/substrate#12761 - SortedListProvider::try_state() now only available for the try-runtime feature, see paritytech/substrate#13296 - When calling cmd.run() for try-runtime we also need something called BlockBuildingInfoProvider, see paritytech/substrate#12896 - Updaged function arguments b/c of mismatched types: --> node/rpc/src/task.rs:64:26 | 64 | api.offchain_nonce_key(&at, &account_id).map_err(|e| { | ------------------ ^^^ expected associated type, found `&BlockId<_>` | | | arguments to this method are incorrect | = note: expected associated type `<B as BlockT>::Hash` found reference `&BlockId<_>` --> sha3pow/src/lib.rs:84:33 | 84 | self.runtime_api().difficulty(&parent_id).map_err(|err| { | ---------- ^^^^^^^^^^ expected struct `H256`, found `&BlockId<B>` | | | arguments to this method are incorrect | = note: expected struct `H256` found reference `&BlockId<B>`
Breaking changes from upstream: - Rename pallet-random-collective-flip to Insecure... paritytech/substrate#13301 - sc_service::BuildNetworkParams::warp_sync field has changed, paritytech/substrate#12761 - SortedListProvider::try_state() now only available for the try-runtime feature, see paritytech/substrate#13296 - When calling cmd.run() for try-runtime we also need something called BlockBuildingInfoProvider, see paritytech/substrate#12896 - Updaged function arguments b/c of mismatched types: --> node/rpc/src/task.rs:64:26 | 64 | api.offchain_nonce_key(&at, &account_id).map_err(|e| { | ------------------ ^^^ expected associated type, found `&BlockId<_>` | | | arguments to this method are incorrect | = note: expected associated type `<B as BlockT>::Hash` found reference `&BlockId<_>` --> sha3pow/src/lib.rs:84:33 | 84 | self.runtime_api().difficulty(&parent_id).map_err(|err| { | ---------- ^^^^^^^^^^ expected struct `H256`, found `&BlockId<B>` | | | arguments to this method are incorrect | = note: expected struct `H256` found reference `&BlockId<B>`
Breaking changes from upstream: - Rename pallet-random-collective-flip to Insecure... paritytech/substrate#13301 - sc_service::BuildNetworkParams::warp_sync field has changed, paritytech/substrate#12761 - SortedListProvider::try_state() now only available for the try-runtime feature, see paritytech/substrate#13296 - When calling cmd.run() for try-runtime we also need something called BlockBuildingInfoProvider, see paritytech/substrate#12896 - Updaged function arguments b/c of mismatched types: --> node/rpc/src/task.rs:64:26 | 64 | api.offchain_nonce_key(&at, &account_id).map_err(|e| { | ------------------ ^^^ expected associated type, found `&BlockId<_>` | | | arguments to this method are incorrect | = note: expected associated type `<B as BlockT>::Hash` found reference `&BlockId<_>` --> sha3pow/src/lib.rs:84:33 | 84 | self.runtime_api().difficulty(&parent_id).map_err(|err| { | ---------- ^^^^^^^^^^ expected struct `H256`, found `&BlockId<B>` | | | arguments to this method are incorrect | = note: expected struct `H256` found reference `&BlockId<B>`
Breaking changes from upstream: - Rename pallet-random-collective-flip to Insecure... paritytech/substrate#13301 - sc_service::BuildNetworkParams::warp_sync field has changed, paritytech/substrate#12761 - SortedListProvider::try_state() now only available for the try-runtime feature, see paritytech/substrate#13296 - When calling cmd.run() for try-runtime we also need something called BlockBuildingInfoProvider, see paritytech/substrate#12896 - Updaged function arguments b/c of mismatched types: --> node/rpc/src/task.rs:64:26 | 64 | api.offchain_nonce_key(&at, &account_id).map_err(|e| { | ------------------ ^^^ expected associated type, found `&BlockId<_>` | | | arguments to this method are incorrect | = note: expected associated type `<B as BlockT>::Hash` found reference `&BlockId<_>` --> sha3pow/src/lib.rs:84:33 | 84 | self.runtime_api().difficulty(&parent_id).map_err(|err| { | ---------- ^^^^^^^^^^ expected struct `H256`, found `&BlockId<B>` | | | arguments to this method are incorrect | = note: expected struct `H256` found reference `&BlockId<B>`
* try-runtime::fast-forward * Revert un`pub`ing command's fields * Handle storage change failure * Adjust Substrate node * Feature-gated imports * doc link * Feature-gated imports in node-template * Move trait, blanket implementation and auxiliary functions to a new module * Distinguish between plain babe+timestamp and substrate enhanced info * Remove uncles inherents * Missing argument * Add doc comment about `blocktime_millis` * Add licenses
Breaking changes from upstream: - Rename pallet-random-collective-flip to Insecure... paritytech/substrate#13301 - sc_service::BuildNetworkParams::warp_sync field has changed, paritytech/substrate#12761 - SortedListProvider::try_state() now only available for the try-runtime feature, see paritytech/substrate#13296 - When calling cmd.run() for try-runtime we also need something called BlockBuildingInfoProvider, see paritytech/substrate#12896 - Updaged function arguments b/c of mismatched types: --> node/rpc/src/task.rs:64:26 | 64 | api.offchain_nonce_key(&at, &account_id).map_err(|e| { | ------------------ ^^^ expected associated type, found `&BlockId<_>` | | | arguments to this method are incorrect | = note: expected associated type `<B as BlockT>::Hash` found reference `&BlockId<_>` --> sha3pow/src/lib.rs:84:33 | 84 | self.runtime_api().difficulty(&parent_id).map_err(|err| { | ---------- ^^^^^^^^^^ expected struct `H256`, found `&BlockId<B>` | | | arguments to this method are incorrect | = note: expected struct `H256` found reference `&BlockId<B>`
Breaking changes from upstream: - Rename pallet-random-collective-flip to Insecure... paritytech/substrate#13301 - sc_service::BuildNetworkParams::warp_sync field has changed, paritytech/substrate#12761 - SortedListProvider::try_state() now only available for the try-runtime feature, see paritytech/substrate#13296 - When calling cmd.run() for try-runtime we also need something called BlockBuildingInfoProvider, see paritytech/substrate#12896 - Updaged function arguments b/c of mismatched types: --> node/rpc/src/task.rs:64:26 | 64 | api.offchain_nonce_key(&at, &account_id).map_err(|e| { | ------------------ ^^^ expected associated type, found `&BlockId<_>` | | | arguments to this method are incorrect | = note: expected associated type `<B as BlockT>::Hash` found reference `&BlockId<_>` --> sha3pow/src/lib.rs:84:33 | 84 | self.runtime_api().difficulty(&parent_id).map_err(|err| { | ---------- ^^^^^^^^^^ expected struct `H256`, found `&BlockId<B>` | | | arguments to this method are incorrect | = note: expected struct `H256` found reference `&BlockId<B>`
Breaking changes from upstream: - Rename pallet-random-collective-flip to Insecure... paritytech/substrate#13301 - sc_service::BuildNetworkParams::warp_sync field has changed, paritytech/substrate#12761 - SortedListProvider::try_state() now only available for the try-runtime feature, see paritytech/substrate#13296 - When calling cmd.run() for try-runtime we also need something called BlockBuildingInfoProvider, see paritytech/substrate#12896 - Updaged function arguments b/c of mismatched types: --> node/rpc/src/task.rs:64:26 | 64 | api.offchain_nonce_key(&at, &account_id).map_err(|e| { | ------------------ ^^^ expected associated type, found `&BlockId<_>` | | | arguments to this method are incorrect | = note: expected associated type `<B as BlockT>::Hash` found reference `&BlockId<_>` --> sha3pow/src/lib.rs:84:33 | 84 | self.runtime_api().difficulty(&parent_id).map_err(|err| { | ---------- ^^^^^^^^^^ expected struct `H256`, found `&BlockId<B>` | | | arguments to this method are incorrect | = note: expected struct `H256` found reference `&BlockId<B>`
Breaking changes from upstream: - Rename pallet-random-collective-flip to Insecure... paritytech/substrate#13301 - sc_service::BuildNetworkParams::warp_sync field has changed, paritytech/substrate#12761 - SortedListProvider::try_state() now only available for the try-runtime feature, see paritytech/substrate#13296 - When calling cmd.run() for try-runtime we also need something called BlockBuildingInfoProvider, see paritytech/substrate#12896 - Updaged function arguments b/c of mismatched types: --> node/rpc/src/task.rs:64:26 | 64 | api.offchain_nonce_key(&at, &account_id).map_err(|e| { | ------------------ ^^^ expected associated type, found `&BlockId<_>` | | | arguments to this method are incorrect | = note: expected associated type `<B as BlockT>::Hash` found reference `&BlockId<_>` --> sha3pow/src/lib.rs:84:33 | 84 | self.runtime_api().difficulty(&parent_id).map_err(|err| { | ---------- ^^^^^^^^^^ expected struct `H256`, found `&BlockId<B>` | | | arguments to this method are incorrect | = note: expected struct `H256` found reference `&BlockId<B>`
Breaking changes from upstream: - Rename pallet-random-collective-flip to Insecure... paritytech/substrate#13301 - sc_service::BuildNetworkParams::warp_sync field has changed, paritytech/substrate#12761 - SortedListProvider::try_state() now only available for the try-runtime feature, see paritytech/substrate#13296 - When calling cmd.run() for try-runtime we also need something called BlockBuildingInfoProvider, see paritytech/substrate#12896 - Updaged function arguments b/c of mismatched types: --> node/rpc/src/task.rs:64:26 | 64 | api.offchain_nonce_key(&at, &account_id).map_err(|e| { | ------------------ ^^^ expected associated type, found `&BlockId<_>` | | | arguments to this method are incorrect | = note: expected associated type `<B as BlockT>::Hash` found reference `&BlockId<_>` --> sha3pow/src/lib.rs:84:33 | 84 | self.runtime_api().difficulty(&parent_id).map_err(|err| { | ---------- ^^^^^^^^^^ expected struct `H256`, found `&BlockId<B>` | | | arguments to this method are incorrect | = note: expected struct `H256` found reference `&BlockId<B>`
Breaking changes from upstream: - Rename pallet-random-collective-flip to Insecure... paritytech/substrate#13301 - sc_service::BuildNetworkParams::warp_sync field has changed, paritytech/substrate#12761 - SortedListProvider::try_state() now only available for the try-runtime feature, see paritytech/substrate#13296 - When calling cmd.run() for try-runtime we also need something called BlockBuildingInfoProvider, see paritytech/substrate#12896 - Updaged function arguments b/c of mismatched types: --> node/rpc/src/task.rs:64:26 | 64 | api.offchain_nonce_key(&at, &account_id).map_err(|e| { | ------------------ ^^^ expected associated type, found `&BlockId<_>` | | | arguments to this method are incorrect | = note: expected associated type `<B as BlockT>::Hash` found reference `&BlockId<_>` --> sha3pow/src/lib.rs:84:33 | 84 | self.runtime_api().difficulty(&parent_id).map_err(|err| { | ---------- ^^^^^^^^^^ expected struct `H256`, found `&BlockId<B>` | | | arguments to this method are incorrect | = note: expected struct `H256` found reference `&BlockId<B>`
Breaking changes from upstream: - Rename pallet-random-collective-flip to Insecure... paritytech/substrate#13301 - sc_service::BuildNetworkParams::warp_sync field has changed, paritytech/substrate#12761 - SortedListProvider::try_state() now only available for the try-runtime feature, see paritytech/substrate#13296 - When calling cmd.run() for try-runtime we also need something called BlockBuildingInfoProvider, see paritytech/substrate#12896 - Updaged function arguments b/c of mismatched types: --> node/rpc/src/task.rs:64:26 | 64 | api.offchain_nonce_key(&at, &account_id).map_err(|e| { | ------------------ ^^^ expected associated type, found `&BlockId<_>` | | | arguments to this method are incorrect | = note: expected associated type `<B as BlockT>::Hash` found reference `&BlockId<_>` --> sha3pow/src/lib.rs:84:33 | 84 | self.runtime_api().difficulty(&parent_id).map_err(|err| { | ---------- ^^^^^^^^^^ expected struct `H256`, found `&BlockId<B>` | | | arguments to this method are incorrect | = note: expected struct `H256` found reference `&BlockId<B>`
Breaking changes from upstream: - Rename pallet-random-collective-flip to Insecure... paritytech/substrate#13301 - sc_service::BuildNetworkParams::warp_sync field has changed, paritytech/substrate#12761 - SortedListProvider::try_state() now only available for the try-runtime feature, see paritytech/substrate#13296 - When calling cmd.run() for try-runtime we also need something called BlockBuildingInfoProvider, see paritytech/substrate#12896 - Updaged function arguments b/c of mismatched types: --> node/rpc/src/task.rs:64:26 | 64 | api.offchain_nonce_key(&at, &account_id).map_err(|e| { | ------------------ ^^^ expected associated type, found `&BlockId<_>` | | | arguments to this method are incorrect | = note: expected associated type `<B as BlockT>::Hash` found reference `&BlockId<_>` --> sha3pow/src/lib.rs:84:33 | 84 | self.runtime_api().difficulty(&parent_id).map_err(|err| { | ---------- ^^^^^^^^^^ expected struct `H256`, found `&BlockId<B>` | | | arguments to this method are incorrect | = note: expected struct `H256` found reference `&BlockId<B>`
* try-runtime::fast-forward * Revert un`pub`ing command's fields * Handle storage change failure * Adjust Substrate node * Feature-gated imports * doc link * Feature-gated imports in node-template * Move trait, blanket implementation and auxiliary functions to a new module * Distinguish between plain babe+timestamp and substrate enhanced info * Remove uncles inherents * Missing argument * Add doc comment about `blocktime_millis` * Add licenses
We introduce a new subcommand for
try-runtime
tool:fast-forward
.Functionality description
RemoteExternalities
from either a live chain or a local snapshot (try-runtime
folklore)n
blocks or untilCtrl+C
) we produce an empty block and execute it atop of the local stateBy empty block we mean a block with only pre-runtime digest (like slot for
aura
) and inherent extrinsics (liketimestamp::set
). Notice, that we don't respect the standard blocktime / slot-duration, but instead we are proceeding immediately with subsequent block.Also, observe that effectively we are simulating (testing) two processes separately:
"Core_initialize_block"
,"BlockBuilder_inherent_extrinsics"
,"BlockBuilder_apply_extrinsic"
,"BlockBuilder_finalize_block"
)"TryRuntime_execute_block"
)Usage
As pre-runtime digest and inherents are chain-specific and are crucial for block correctness, every chain must provide its own way of producing these. Please consult
node-template
for the example implementation.Example output
cc: @kianenigma
polkadot companion: paritytech/polkadot#6567
cumulus companion: paritytech/cumulus#2100
Polkadot address: 15fdtPm7jNN9VZk5LokKcmBVfmYZkCXdjPpaPVL2w7WgCgRY