Skip to content

How to initialize well_known_relay_keys::TIMESTAMP_NOW for block production? #3305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Chralt98 opened this issue May 28, 2025 · 0 comments

Comments

@Chralt98
Copy link

Chralt98 commented May 28, 2025

Hey moonbeam team,

I came across the following relay-chain timestamp implementation:

match state_proof.read_entry(well_known_relay_keys::TIMESTAMP_NOW, None) {

As soon as I start to create a block using chopsticks or try-runtime MBM, I get the following error:

Corrupted relay storage: value TIMESTAMP_NOW is absent! from here

try-runtime MBM output:

[2025-05-28T14:35:54Z INFO  try_runtime_core::common::empty_block::production] Producing new empty block at height 1719017
[2025-05-28T14:35:54Z ERROR common_runtime::relay_timestamp] Corrupted relay storage: value TIMESTAMP_NOW is absent!
[2025-05-28T14:35:54Z ERROR runtime] panicked at /home/development/zeitgeist/runtime/common/src/relay_timestamp.rs:69:21:
    Corrupted relay storage: value TIMESTAMP_NOW is absent!

thread 'main' panicked at cli/main.rs:326:10:
called `Result::unwrap()` on an `Err` value: Input("failed to execute 'BlockBuilder_apply_extrinsic': Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed\nWASM backtrace:\nerror while executing at wasm backtrace:\n    0: 0x70b8b3 - battery_station_runtime.wasm!rust_begin_unwind\n    1: 0x69e63e - battery_station_runtime.wasm!core::panicking::panic_fmt::he905bcb57f481db7\n    2: 0x21ff0f - battery_station_runtime.wasm!<common_runtime::relay_timestamp::ConsensusHookWrapperForRelayTimestamp<Runtime,Inner> as cumulus_pallet_parachain_system::consensus_hook::ConsensusHook>::on_state_proof::haef12df3424bf2e0\n    3: 0x29fff1 - battery_station_runtime.wasm!frame_support::storage::transactional::with_transaction::h8c748e291d178d06\n    4: 0x170a67 - battery_station_runtime.wasm!environmental::local_key::LocalKey<T>::with::h7875993768071d54\n    5: 0x161f2 - battery_station_runtime.wasm!<battery_station_runtime::RuntimeCall as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::h241249706fa1bba2\n    6: 0x1441a - battery_station_runtime.wasm!<battery_station_runtime::RuntimeCall as sp_runtime::traits::Dispatchable>::dispatch::hd4012758ce9461e9\n    7: 0xdd474 - battery_station_runtime.wasm!<sp_runtime::generic::checked_extrinsic::CheckedExtrinsic<AccountId,Call,Extra> as sp_runtime::traits::Applyable>::apply::h7a284197e664090d\n    8: 0x6407d3 - battery_station_runtime.wasm!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::apply_extrinsic::hd4d2f9bb8a005d99\n    9: 0x497591 - battery_station_runtime.wasm!BlockBuilder_apply_extrinsic")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

chopsticks output:

[16:30:30.393] DEBUG: dev_newBlock
    app: "chopsticks"
    hash: "0x996122910d664fc919a2cf6229175bb8b630c1267b4dd1675b9b6b0da39efa34"
[16:30:30.500] INFO (block-builder): Zeitgeist building #8,185,596
    app: "chopsticks"
    number: 8185596
    extrinsics: []
    umpCount: 0
runtime                      ERROR: panicked at /home/development/zeitgeist/runtime/common/src/relay_timestamp.rs:69:21:
Corrupted relay storage: value TIMESTAMP_NOW is absent!
[16:30:43.382] WARN (block-builder): Failed to apply inherents {} Error: wasm `unreachable` instruction executed
    app: "chopsticks"
/home/development/zeitgeist/integration-tests/node_modules/.pnpm/@acala-network+chopsticks-core@0.9.13/node_modules/@acala-network/chopsticks-core/dist/cjs/blockchain/block-builder.js:174
            throw new Error('Failed to apply inherents');
                  ^

Error: Failed to apply inherents
    at initNewBlock (/home/development/zeitgeist/integration-tests/node_modules/.pnpm/@acala-network+chopsticks-core@0.9.13/node_modules/@acala-network/chopsticks-core/dist/cjs/blockchain/block-builder.js:174:19)
    at async buildBlock (/home/development/zeitgeist/integration-tests/node_modules/.pnpm/@acala-network+chopsticks-core@0.9.13/node_modules/@acala-network/chopsticks-core/dist/cjs/blockchain/block-builder.js:281:44)
    at async TxPool.buildBlock (/home/development/zeitgeist/integration-tests/node_modules/.pnpm/@acala-network+chopsticks-core@0.9.13/node_modules/@acala-network/chopsticks-core/dist/cjs/blockchain/txpool.js:340:43)
    at async TxPool.buildBlockIfNeeded (/home/development/zeitgeist/integration-tests/node_modules/.pnpm/@acala-network+chopsticks-core@0.9.13/node_modules/@acala-network/chopsticks-core/dist/cjs/blockchain/txpool.js:324:9)

So, how to set the additional relay-chain key?

Thanks a lot for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant