Skip to content
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

Execution aborted due to trap: wasm trap: wasm unreachable instruction executed #7341

Closed
volodymyrd opened this issue Jan 26, 2025 · 10 comments · Fixed by #7451
Closed

Execution aborted due to trap: wasm trap: wasm unreachable instruction executed #7341

volodymyrd opened this issue Jan 26, 2025 · 10 comments · Fixed by #7451
Labels
I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@volodymyrd
Copy link

I try to set up a template, but when I start the omni node with the command polkadot-omni-node --chain ./chain_spec.json --dev, the node starts, but I see this error:

Inherent extrinsic returned unexpected error: Error at calling runtime api: Execution failed: Execution aborted due to trap: wasm trap: wasm unreachable instruction executed
WASM backtrace:
error while executing at wasm backtrace:
0: 0x30767a - parachain_template_runtime.wasm!rust_begin_unwind
1: 0xc17a - parachain_template_runtime.wasm!core::panicking::panic_fmt::hc77aef7e4c7c0bd4
2: 0x255fab - parachain_template_runtime.wasm!frame_support::storage::transactional::with_transaction::hc0d3b0de73ade971
3: 0x2c6898 - parachain_template_runtime.wasm!environmental::local_key::LocalKey::with::h6c003c05e7cd116f
4: 0xd24f2 - parachain_template_runtime.wasm!<parachain_template_runtime::RuntimeCall as frame_support::traits::dispatch::UnfilteredDispatchable>::dispatch_bypass_filter::h94a427eb3bf5cc3d
5: 0xcf566 - parachain_template_runtime.wasm!<parachain_template_runtime::RuntimeCall as sp_runtime::traits::Dispatchable>::dispatch::h8e87a075039c0e7b
6: 0xf74d6 - parachain_template_runtime.wasm!<sp_runtime::generic::checked_extrinsic::CheckedExtrinsic<AccountId,Call,Extra> as sp_runtime::traits::Applyable>::apply::hf803b97a1c0b84e3
7: 0x25f1d8 - parachain_template_runtime.wasm!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::apply_extrinsic::h2ccce8eaf468136c
8: 0x26f7d4 - parachain_template_runtime.wasm!BlockBuilder_apply_extrinsic. Dropping.
2025-01-26 20:12:42 [Parachain] panicked at /Users/vova/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cumulus-pallet-parachain-system-0.17.1/src/lib.rs:263:6:
set_validation_data inherent needs to be present in every block!
2025-01-26 20:12:42 [Parachain] Consensus with no RPC sender encountered an error: Error at calling runtime api: Execution failed: Execution aborted due to trap: wasm trap: wasm unreachable instruction executed

Can you help me understand what's wrong with my setup.

@github-actions github-actions bot added the I10-unconfirmed Issue might be valid, but it's not yet known. label Jan 26, 2025
@bkchr
Copy link
Member

bkchr commented Jan 27, 2025

@volodymyrd looks like you mixed up the paraid? Did you used somewhere a different paraid than 1000?

@volodymyrd
Copy link
Author

@bkchr No, I just follow the doc and generate the chain spec like this:
chain-spec-builder create -t development
--relay-chain paseo
--para-id 1000
--runtime ./target/release/wbuild/parachain-template-runtime/parachain_template_runtime.compact.compressed.wasm
named-preset development

Should I try a different paraid than 1000?

@bkchr
Copy link
Member

bkchr commented Feb 1, 2025

No that looks correct. Can you please share more logs of your node.

@Kobra-Jamali
Copy link

Hi,
I have the same issue. Could you please assist me in this matter?

root@PGR9:~/parachain-template# polkadot-omni-node --chain ./chain_spec.json --dev
2025-02-02 00:05:14 polkadot-omni-node
2025-02-02 00:05:14 ✌️ version 0.1.0-23833ccee9c
2025-02-02 00:05:14 ❤️ by Parity Technologies admin@parity.io, 2017-2025
2025-02-02 00:05:14 📋 Chain specification: Custom
2025-02-02 00:05:14 🏷 Node name: quack-committee-6482
2025-02-02 00:05:14 👤 Role: AUTHORITY
2025-02-02 00:05:14 💾 Database: RocksDb at /tmp/substratem4lcrU/chains/custom/db/full
2025-02-02 00:05:15 assembling new collators for new session 0 at #0
2025-02-02 00:05:15 assembling new collators for new session 1 at #0
2025-02-02 00:05:19 [Parachain] assembling new collators for new session 0 at #0
2025-02-02 00:05:19 [Parachain] assembling new collators for new session 1 at #0
2025-02-02 00:05:21 [Parachain] 🔨 Initializing Genesis block/state (state: 0x8146…0b3d, header-hash: 0x54de…454d)
2025-02-02 00:05:21 [Parachain] creating SingleState txpool Limit { count: 8192, total_bytes: 20971520 }/Limit { count: 819, total_bytes: 2097152 }.
2025-02-02 00:05:21 [Parachain] Using default protocol ID "sup" because none is configured in the chain specs
2025-02-02 00:05:21 [Parachain] 🏷 Local node identity is: 12D3KooWSe2ohqbtvikeHq2qMBbVVmeMtgvJNFXvCxMhuPirfNyK
2025-02-02 00:05:21 [Parachain] Running libp2p network backend
2025-02-02 00:05:21 [Parachain] local_peer_id=12D3KooWSe2ohqbtvikeHq2qMBbVVmeMtgvJNFXvCxMhuPirfNyK
2025-02-02 00:05:21 [Parachain] 💻 Operating system: linux
2025-02-02 00:05:21 [Parachain] 💻 CPU architecture: x86_64
2025-02-02 00:05:21 [Parachain] 💻 Target environment: gnu
2025-02-02 00:05:21 [Parachain] 💻 CPU: 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
2025-02-02 00:05:21 [Parachain] 💻 CPU cores: 4
2025-02-02 00:05:21 [Parachain] 💻 Memory: 12798MB
2025-02-02 00:05:21 [Parachain] 💻 Kernel: 6.8.0-52-generic
2025-02-02 00:05:21 [Parachain] 💻 Linux distribution: Ubuntu 24.04.1 LTS
2025-02-02 00:05:21 [Parachain] 💻 Virtual machine: yes
2025-02-02 00:05:21 [Parachain] 📦 Highest known block at #0
2025-02-02 00:05:21 [Parachain] 〽️ Prometheus exporter started at 127.0.0.1:9615
2025-02-02 00:05:21 [Parachain] Running JSON-RPC server: addr=127.0.0.1:9944,[::1]:9944
2025-02-02 00:05:22 [Parachain] Failed to trigger bootstrap: No known peers.
2025-02-02 00:05:24 [Parachain] 🙌 Starting consensus session on top of parent 0x54de8be9450f8bca535cda75f57c32a74784b415587209214ee91ca605e2454d (#0)
2025-02-02 00:05:24 [Parachain] panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cumulus-pallet-parachain-system-0.17.1/src/lib.rs:1226:21:
included head not present in relay storage proof
2025-02-02 00:05:24 [Parachain] 1 storage transactions are left open by the runtime. Those will be rolled back.
2025-02-02 00:05:24 [Parachain] 1 storage transactions are left open by the runtime. Those will be rolled back.
2025-02-02 00:05:24 [Parachain] ❗️ Inherent extrinsic returned unexpected error: Error at calling runtime api: Execution failed: Execution aborted due to trap: wasm trap: wasm unreachable instruction executed
WASM backtrace:
error while executing at wasm backtrace:
0: 0x30775b - parachain_template_runtime.wasm!rust_begin_unwind

@th7nder
Copy link

th7nder commented Feb 3, 2025

@th7nder
Copy link

th7nder commented Feb 4, 2025

I took the chain spec from from polkadot-stable2412-1 and built locally omninode from polkadot-stable2412 and it works:

th7nder@stormheim ~/w/e/polkadot-sdk ((polkadot-stable2412-rc6))> ./target/release/polkadot-omni-node --chain ../dev_chain_spec.json --dev
2025-02-04 01:00:21 polkadot-omni-node
2025-02-04 01:00:21 ✌️  version 0.1.0-967989c5d94
2025-02-04 01:00:21 ❤️  by Parity Technologies <admin@parity.io>, 2017-2025
2025-02-04 01:00:21 📋 Chain specification: Custom
2025-02-04 01:00:21 🏷  Node name: parsimonious-coast-3267
2025-02-04 01:00:21 👤 Role: AUTHORITY
2025-02-04 01:00:21 💾 Database: RocksDb at /tmp/substrateBxywVN/chains/custom/db/full
2025-02-04 01:00:22 [Parachain] assembling new collators for new session 0 at #0
2025-02-04 01:00:22 [Parachain] assembling new collators for new session 1 at #0
2025-02-04 01:00:22 [Parachain] 🔨 Initializing Genesis block/state (state: 0x36e0…96f4, header-hash: 0x46c5…ec24)
2025-02-04 01:00:22 [Parachain]  creating SingleState txpool Limit { count: 8192, total_bytes: 20971520 }/Limit { count: 819, total_bytes: 2097152 }.
2025-02-04 01:00:22 [Parachain] Using default protocol ID "sup" because none is configured in the chain specs
2025-02-04 01:00:22 [Parachain] 🏷  Local node identity is: 12D3KooWCPJkSVVMLEWTNfybkdoktDC3sG4pt9XH8iTHavvRUtnM
2025-02-04 01:00:22 [Parachain] Running libp2p network backend
2025-02-04 01:00:22 [Parachain] 💻 Operating system: linux
2025-02-04 01:00:22 [Parachain] 💻 CPU architecture: x86_64
2025-02-04 01:00:22 [Parachain] 💻 Target environment: gnu
2025-02-04 01:00:22 [Parachain] 💻 CPU: AMD Ryzen 9 3900X 12-Core Processor
2025-02-04 01:00:22 [Parachain] 💻 CPU cores: 12
2025-02-04 01:00:22 [Parachain] 💻 Memory: 30081MB
2025-02-04 01:00:22 [Parachain] 💻 Kernel: 5.15.167.4-microsoft-standard-WSL2
2025-02-04 01:00:22 [Parachain] 💻 Linux distribution: Ubuntu 24.04.1 LTS
2025-02-04 01:00:22 [Parachain] 💻 Virtual machine: yes
2025-02-04 01:00:22 [Parachain] 📦 Highest known block at #0
2025-02-04 01:00:22 [Parachain] 〽️ Prometheus exporter started at 127.0.0.1:9615
2025-02-04 01:00:22 [Parachain] Running JSON-RPC server: addr=127.0.0.1:9944,[::1]:9944
2025-02-04 01:00:25 [Parachain] 🙌 Starting consensus session on top of parent 0x46c5196eaa2e695385275ced36870e664695468ba9f4167237c6ad105ffbec24 (#0)
2025-02-04 01:00:25 [Parachain] 🎁 Prepared block for proposing at 1 (0 ms) [hash: 0x76d92d5bb2c77265f5688fc20bb51cfff4b33fab911fa916fcf22427078c254d; parent_hash: 0x46c5…ec24; extrinsics_count: 2
2025-02-04 01:00:25 [Parachain] Consensus with no RPC sender success: CreatedBlock { hash: 0x76d92d5bb2c77265f5688fc20bb51cfff4b33fab911fa916fcf22427078c254d, aux: ImportedAux { header_only: false, clear_justification_requests: false, needs_justification: false, bad_justification: false, is_new_best: true }, proof_size: 0 }
2025-02-04 01:00:25 [Parachain] 🏆 Imported #1 (0x46c5…ec24 → 0x76d9…254d)
2025-02-04 01:00:27 [Parachain] 💤 Idle (0 peers), best: #1 (0x76d9…254d), finalized #1 (0x76d9…254d), ⬇ 0 ⬆ 0
2025-02-04 01:00:28 [Parachain] 🙌 Starting consensus session on top of parent 0x76d92d5bb2c77265f5688fc20bb51cfff4b33fab911fa916fcf22427078c254d (#1)
2025-02-04 01:00:28 [Parachain] 🎁 Prepared block for proposing at 2 (1 ms) [hash: 0x2a684924e19a421a0212f0bfad5869ebe8911008391367d415fa6d153fa59e3a; parent_hash: 0x76d9…254d; extrinsics_count: 2
2025-02-04 01:00:28 [Parachain] Consensus with no RPC sender success: CreatedBlock { hash: 0x2a684924e19a421a0212f0bfad5869ebe8911008391367d415fa6d153fa59e3a, aux: ImportedAux { header_only: false, clear_justification_requests: false, needs_justification: false, bad_justification: false, is_new_best: true }, proof_size: 0 }
2025-02-04 01:00:28 [Parachain] 🏆 Imported #2 (0x76d9…254d → 0x2a68…9e3a)
2025-02-04 01:00:31 [Parachain] 🙌 Starting consensus session on top of parent 0x2a684924e19a421a0212f0bfad5869ebe8911008391367d415fa6d153fa59e3a (#2)
2025-02-04 01:00:31 [Parachain] 🎁 Prepared block for proposing at 3 (0 ms) [hash: 0xc54264757a571084336ff6104eeee9ddea09687c24724cf3c410d01420d7016c; parent_hash: 0x2a68…9e3a; extrinsics_count: 2
2025-02-04 01:00:31 [Parachain] Consensus with no RPC sender success: CreatedBlock { hash: 0xc54264757a571084336ff6104eeee9ddea09687c24724cf3c410d01420d7016c, aux: ImportedAux { header_only: false, clear_justification_requests: false, needs_justification: false, bad_justification: false, is_new_best: true }, proof_size: 0 }

Then I ran the omni node build for polkadot-2412-1 and it doesn't.

th7nder@stormheim ~/w/e/polkadot-sdk ((polkadot-stable2412-1))> ./target/release/polkadot-omni-node --chain ../dev_chain_spec.json --dev
2025-02-04 01:09:26 polkadot-omni-node
2025-02-04 01:09:26 ✌️  version 0.4.0-ab5882bbc67
2025-02-04 01:09:26 ❤️  by Parity Technologies <admin@parity.io>, 2017-2025
2025-02-04 01:09:26 📋 Chain specification: Custom
2025-02-04 01:09:26 🏷  Node name: glossy-angle-0783
2025-02-04 01:09:26 👤 Role: AUTHORITY
2025-02-04 01:09:26 💾 Database: RocksDb at /tmp/substrate13dzVc/chains/custom/db/full
2025-02-04 01:09:27 [Parachain] assembling new collators for new session 0 at #0
2025-02-04 01:09:27 [Parachain] assembling new collators for new session 1 at #0
2025-02-04 01:09:27 [Parachain] 🔨 Initializing Genesis block/state (state: 0x36e0…96f4, header-hash: 0x46c5…ec24)
2025-02-04 01:09:27 [Parachain]  creating SingleState txpool Limit { count: 8192, total_bytes: 20971520 }/Limit { count: 819, total_bytes: 2097152 }.
2025-02-04 01:09:27 [Parachain] Using default protocol ID "sup" because none is configured in the chain specs
2025-02-04 01:09:27 [Parachain] 🏷  Local node identity is: 12D3KooWLG5MBtLKedLsNAieoybhWsLMyhtsLNQokadbF6duiC8C
2025-02-04 01:09:27 [Parachain] Running libp2p network backend
2025-02-04 01:09:27 [Parachain] 💻 Operating system: linux
2025-02-04 01:09:27 [Parachain] 💻 CPU architecture: x86_64
2025-02-04 01:09:27 [Parachain] 💻 Target environment: gnu
2025-02-04 01:09:27 [Parachain] 💻 CPU: AMD Ryzen 9 3900X 12-Core Processor
2025-02-04 01:09:27 [Parachain] 💻 CPU cores: 12
2025-02-04 01:09:27 [Parachain] 💻 Memory: 30081MB
2025-02-04 01:09:27 [Parachain] 💻 Kernel: 5.15.167.4-microsoft-standard-WSL2
2025-02-04 01:09:27 [Parachain] 💻 Linux distribution: Ubuntu 24.04.1 LTS
2025-02-04 01:09:27 [Parachain] 💻 Virtual machine: yes
2025-02-04 01:09:27 [Parachain] 📦 Highest known block at #0
2025-02-04 01:09:27 [Parachain] Running JSON-RPC server: addr=127.0.0.1:9944,[::1]:9944
2025-02-04 01:09:27 [Parachain] 〽️ Prometheus exporter started at 127.0.0.1:9615
2025-02-04 01:09:33 [Parachain] 🙌 Starting consensus session on top of parent 0x46c5196eaa2e695385275ced36870e664695468ba9f4167237c6ad105ffbec24 (#0)
2025-02-04 01:09:33 [Parachain] 🎁 Prepared block for proposing at 1 (0 ms) [hash: 0x375846c50a7ea5001dbc97fc529335c32215a99b046ebc0beba3a4cdfd151707; parent_hash: 0x46c5…ec24; extrinsics_count: 2
2025-02-04 01:09:33 [Parachain] Consensus with no RPC sender success: CreatedBlock { hash: 0x375846c50a7ea5001dbc97fc529335c32215a99b046ebc0beba3a4cdfd151707, aux: ImportedAux { header_only: false, clear_justification_requests: false, needs_justification: false, bad_justification: false, is_new_best: true }, proof_size: 0 }
2025-02-04 01:09:33 [Parachain] 🏆 Imported #1 (0x46c5…ec24 → 0x3758…1707)
2025-02-04 01:09:35 [Parachain] 💤 Idle (0 peers), best: #1 (0x3758…1707), finalized #1 (0x3758…1707), ⬇ 0 ⬆ 0
2025-02-04 01:09:36 [Parachain] 🙌 Starting consensus session on top of parent 0x375846c50a7ea5001dbc97fc529335c32215a99b046ebc0beba3a4cdfd151707 (#1)
2025-02-04 01:09:36 [Parachain] panicked at /build/cumulus/pallets/aura-ext/src/consensus_hook.rs:81:13:
authored blocks limit is reached for the slot
2025-02-04 01:09:36 [Parachain] 1 storage transactions are left open by the runtime. Those will be rolled back.
2025-02-04 01:09:36 [Parachain] 1 storage transactions are left open by the runtime. Those will be rolled back.
2025-02-04 01:09:36 [Parachain] ❗️ Inherent extrinsic returned unexpected error: Error at calling runtime api: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
WASM backtrace:

It panics here:

2025-02-04 01:09:36 [Parachain] panicked at /build/cumulus/pallets/aura-ext/src/consensus_hook.rs:81:13:
authored blocks limit is reached for the slot
2025-02-04 01:09:36 [Parachain] 1 storage transa

To confirm it, I did a half-baked: git revert d5539aa63edc8068eff9c4cbb78214c3a5ab66b2 and it started to work.
Resolved conflicts kinda based on vibes.

@bkchr I saw that you left a comment on this PR (which is between two releases) and it happens to be the place where it fails.
https://github.com/paritytech/polkadot-sdk/pull/6825/files#r1909077389
@skunert you might be interested too.

I don't have enough capacity to understand why the revert helps and why omni-node keeps being mean to us without it.
P.S Maybe testing the omni-node in this way after releasing would be beneficial as well, but not sure whether feasible.

@skunert
Copy link
Contributor

skunert commented Feb 4, 2025

Thanks for the investigation and report!

I reproduced this issue and provide a fix in #7451.

After that has landed in master, omni-node 2412-1 will be compatible again with the dev chainspec from master.
After the fix has been backported, next release 2412-2 will be forward and backward compatible again.

@skunert
Copy link
Contributor

skunert commented Feb 5, 2025

@th7nder #7451 is in the merge queue. Once merged, can you confirm that it fixes your issue please?

github-merge-queue bot pushed a commit that referenced this issue Feb 5, 2025
This PR will make omni-node dev-mode once again compatible with older
runtimes.

The changes introduced in
#6825 changed constraints
that are enforced in the runtime. For normal chains this should work
fine, since we have real parameters there, like relay chain slots and
parachain slots.

For these manual seal parameters we need to respect the constraints,
while faking all the parameters. This PR should fix manual seal in
omni-node to work with runtime build before and after
#6825 (I tested that).

In the future, we should look into improving the parameterization here,
possibly by introducing proper aura pre-digests so that the parachain
slot moves forward. This will require quite a bit of refactoring on the
manual seal node side however. Issue:
#7453

Also, the dev chain spec in parachain template is updated. This makes it
work with stable2412-1 and master omni-node. Once the changes here are
backported and in a release, all combinations will work again.

fixes #7341

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@th7nder
Copy link

th7nder commented Feb 5, 2025

Can confirm, it works.

@volodymyrd
Copy link
Author

it works for me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants