AcalaNetwork / chopsticks

Create parallel reality of your Substrate network.
Apache License 2.0
133 stars 80 forks source link

Missing `paraInherent` data from block #621

Closed NachoPal closed 8 months ago

NachoPal commented 8 months ago

I am trying to run a network providing chain_spec genesis files with the local (kusama-local, asset-hub-kusama-local) implementation.

The config files look something like this:

mock-signature-host: true
block: ${env.KUSAMA_BLOCK_NUMBER}
db: ./db.sqlite
port: 8000
runtime-log-level: 5
genesis: ./config/chopsticks/kusama/chain-spec-v1.0.0.json
mock-signature-host: true
block: ${env.STATEMINE_BLOCK_NUMBER}
db: ./db.sqlite
port: 8001
runtime-log-level: 5
genesis: ./config/chopsticks/asset-hub-kusama/chain-spec-v1.0.0.json

And running the command:

chopsticks xcm -r config/chopsticks/kusama/config.yml -p config/chopsticks/asset-hub-kusama/config.yml

However I am getting the following error:

.../@acala-network/chopsticks-core/dist/cjs/blockchain/inherent/para-enter.js:24
            throw new Error('Missing paraInherent data from block');
                  ^

Error: Missing paraInherent data from block
    at ParaInherentEnter.createInherents (.../@acala-network/chopsticks-core/dist/cjs/blockchain/inherent/para-enter.js:24:19)
    at async Promise.all (index 1)
    at async InherentProviders.createInherents (/Users/nacho/Desktop/PARITY/Repos/parachains-integration-tests/node_modules/@acala-network/chopsticks-core/dist/cjs/blockchain/inherent/index.js:91:23)
    at async TxPool.buildBlock (/Users/nacho/Desktop/PARITY/Repos/parachains-integration-tests/node_modules/@acala-network/chopsticks-core/dist/cjs/blockchain/txpool.js:312:23)
    at async TxPool.buildBlockIfNeeded (/Users/nacho/Desktop/PARITY/Repos/parachains-integration-tests/node_modules/@acala-network/chopsticks-core/dist/cjs/blockchain/txpool.js:295:9)
NachoPal commented 8 months ago

https://github.com/AcalaNetwork/chopsticks/issues/616#issuecomment-1875431775

NachoPal commented 8 months ago

Tried to fix it but getting different error now:

runtime                      ERROR: panicked at /Users/nacho/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pallet-aura-22.0.0/src/lib.rs:411:9:
Timestamp slot must match `CurrentSlot`
[18:33:06.395] INFO (block-builder/15625): Try building block #1
    app: "chopsticks"
    number: 1
    extrinsicsCount: 0
    umpCount: 0
[18:33:06.548] WARN (block-builder/15625): Failed to apply inherents {} Error: wasm `unreachable` instruction executed
    app: "chopsticks"
file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/packages/core/src/blockchain/block-builder.ts:135
            throw new Error('Failed to apply inherents');
                  ^

Error: Failed to apply inherents
    at initNewBlock (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/packages/core/src/blockchain/block-builder.ts:135:19)
    at async buildBlock (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/packages/core/src/blockchain/block-builder.ts:240:33)
    at async #buildBlock (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/packages/core/src/blockchain/txpool.ts:188:47)
    at async #buildBlockIfNeeded (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/packages/core/src/blockchain/txpool.ts:170:13)
ermalkaleci commented 8 months ago

@NachoPal can you upload genesis file so I don't have to go through building process?

NachoPal commented 8 months ago

chain-spec-v1.0.0.json chain-spec-v1.0.0.json

NachoPal commented 8 months ago

@ermalkaleci I tried the fix but I am getting this error:

TypeError: Cannot read properties of undefined (reading 'downwardMessageQueues')
    at connectDownward (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/packages/core/src/xcm/downward.ts:8:64)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async connectVertical (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/packages/core/src/xcm/index.ts:10:5)
    at async Object.handler (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/packages/chopsticks/src/cli.ts:43:13)

It seems the RelayChain's wasm is replaced by the Parachain's one somewhere, that is why it doesn't find the dmp pallet. I can not find where it happens and I almost sure I am not using genesis files with the same (parachain) runtime.

For genesis I tried what I had in my local and also: Kusama config

genesis: https://raw.githubusercontent.com/AcalaNetwork/chopsticks/d7b476eb44f14e8e88e39b2f263d9ccffe330c4f/packages/e2e/blobs/kusama.json

and Asset Hub Kusama config

genesis: https://raw.githubusercontent.com/AcalaNetwork/chopsticks/d7b476eb44f14e8e88e39b2f263d9ccffe330c4f/packages/e2e/blobs/asset-hub-kusama.json

Did it work for you?

I am running:

yarn start xcm -r <path_to_kusama_config> -p <path_to_asset_hub_kusama_config>
ermalkaleci commented 8 months ago

@NachoPal Hmmm, remove db. Because they're both genesis with same block hash it will mess caching. Something to be addressed.

ermalkaleci commented 8 months ago

just tried pjs and it seems I can't transfer unless I built the first block empty, need to investigate. Also keep in minding that starting from genesis you won't have any parachain setup, so you'll need to modify storage

NachoPal commented 8 months ago

you won't have any parachain setup

What setup you are referring to?

ermalkaleci commented 8 months ago

you will have only genesis state, no asset registered, etc

NachoPal commented 8 months ago

you will have only genesis state, no asset registered, etc

Yeah, that's totally fine

NachoPal commented 8 months ago

Hmmm, remove db. Because they're both genesis with same block hash it will mess caching. Something to be addressed.

This did not work, still getting the same error

ermalkaleci commented 8 months ago

I did try and it works. what's the error?

NachoPal commented 8 months ago

I did try and it works. what's the error?

The error is the same:

TypeError: Cannot read properties of undefined (reading 'downwardMessageQueues')
    at connectDownward (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/packages/core/src/xcm/downward.ts:8:64)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async connectVertical (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/packages/core/src/xcm/index.ts:10:5)
    at async Object.handler (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/packages/chopsticks/src/cli.ts:43:13)

Steps:

  1. I remove db.sqlite, db.sqlite-shm, db.sqlite-wal
  2. yarn start xcm -r <path_to_kusama_config> -p <path_to_asset_hub_kusama_config>

Config files:

I am up to date with master

ermalkaleci commented 8 months ago

either remove db completely or use different location for each one. currently your using db.sqlite for both and both genesis will have same block hash

NachoPal commented 8 months ago

I thought removing the DB was enough. After using different locations for each DB, it worked, thanks.

I will appreciate if you can release a new npm package version with the recent fixes.

ermalkaleci commented 8 months ago

I will appreciate if you can release a new npm package version with the recent fixes

It's already been published as beta https://www.npmjs.com/package/@acala-network/chopsticks/v/0.9.6-3