Moonsong-Labs / moonwall

Testing Framework for Substrate networks
https://moonsong-labs.github.io/moonwall/
GNU General Public License v3.0
10 stars 4 forks source link

`RpcError: 1: Block 0x... not found` after `context.createBlock` #343

Closed Chralt98 closed 8 months ago

Chralt98 commented 9 months ago

Consider this chopsticks test.

The error I get is:

 FAIL  tests/rt-upgrade-chopsticks/test-chopsticks-runtime-upgrade.ts > 🗃️  #CAN Chopsticks Zeitgeist or Battery Station Post-Upgrade Tests > 📁  #CANT3 Can send ZTG to HydraDX
RpcError: 1: Block 0xa5f48f268543ece7f09f80bc65f4493c4fab5fbe2ebd179cdabfb412dbe997ad not found
 ❯ checkError node_modules/.pnpm/@polkadot+rpc-provider@10.11.1/node_modules/@polkadot/rpc-provider/coder/index.js:19:15
 ❯ RpcCoder.decodeResponse node_modules/.pnpm/@polkadot+rpc-provider@10.11.1/node_modules/@polkadot/rpc-provider/coder/index.js:35:9
 ❯ WsProvider.__internal__onSocketMessageResult node_modules/.pnpm/@polkadot+rpc-provider@10.11.1/node_modules/@polkadot/rpc-provider/ws/index.js:407:51
 ❯ WebSocket.__internal__onSocketMessage node_modules/.pnpm/@polkadot+rpc-provider@10.11.1/node_modules/@polkadot/rpc-provider/ws/index.js:396:20
 ❯ callListener node_modules/.pnpm/ws@8.14.2/node_modules/ws/lib/event-target.js:290:14
 ❯ WebSocket.onMessage node_modules/.pnpm/ws@8.14.2/node_modules/ws/lib/event-target.js:209:9
 ❯ WebSocket.emit node:events:514:28
 ❯ Receiver.receiverOnMessage node_modules/.pnpm/ws@8.14.2/node_modules/ws/lib/websocket.js:1192:20
 ❯ Receiver.emit node:events:514:28
 ❯ Receiver.dataMessage node_modules/.pnpm/ws@8.14.2/node_modules/ws/lib/receiver.js:560:14

I assume it's because of the following line:

await context.createBlock({ providerName: "HydraDXPara", count: 1, logger: log });

The intention behind this line is to increase the block number of the HydraDX fork to process the received XCM message and actually see the implications of the XCM transfer from Zeitgeist to HydraDX inside the tokens pallet.

How to fix the RpcError and test if the xcm transfer was correctly executed?

Chralt98 commented 9 months ago

Just a side note: Keep in mind that this separate test suite with the exact same integration test worked before (proof here), but after integrating the test to execute after the runtime upgrade, it doesn't anymore.

Chralt98 commented 9 months ago

It seems like only the endpoint with the lowest port number can be used to create blocks without errors.

From here the HydraDX parachain was able to throw no error after executing await context.createBlock({ providerName: "HydraDXPara", count: 1, logger: log });, but I think it would be the same to just call await context.createBlock({ count: 1 });, because it automatically picks the lowest port endpoint (parachain hydradx in this case).

timbrinded commented 8 months ago

Thanks, this is really helpful. I have not yet got around to fully implementing support for Multiple chopsticks instances running at once (i've half done it).

Could you give me an overview of the high level scenarios you are trying to test with this? I can then add the bits required to make it work

timbrinded commented 8 months ago

Implemented