AcalaNetwork / chopsticks

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

nimbus author inherent mock #648

Closed ermalkaleci closed 8 months ago

ermalkaleci commented 8 months ago

@girazoki Does your system require authoritiesNoting.setLatestAuthoritiesData to be called on every block? This change will allow your chain to build blocks but I don't know if all functionalities will work. Can you help with testing?

girazoki commented 8 months ago

Yes I can definitely! Yes we need that to be set in all the blocks for now.

BTW I spoke to parity about being able to proof all keys that you want inside set-validation-data. This way we can just take in chopsticks whatever comes from validation-data in the previous block and modify only the keys corresponding to XCM,etc (so similar to what you are doing right now)

We need a bit of time for this, but hopefully we can propose the PR to parity in the next weeks.

What can I help you with? Do you want me to try a specific version?

ermalkaleci commented 8 months ago

@girazoki test latest beta 0.9.8-2 and let me know if it works

girazoki commented 8 months ago

@ermalkaleci we have not been able to use directly the version you point at:

npx @acala-network/chopsticks@0.9.8-2 --help throws:

const _jsondiffpatch = require("jsondiffpatch");
                       ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/girazoki/Desktop/tanssi/node_modules/.pnpm/jsondiffpatch@0.6.0/node_modules/jsondiffpatch/lib/index.js from /home/girazoki/Desktop/tanssi/node_modules/.pnpm/@acala-network+chopsticks@0.9.8-2_debug@4.3.4/node_modules/@acala-network/chopsticks/dist/cjs/utils/decoder.js not supported.
Instead change the require of index.js in /home/girazoki/Desktop/tanssi/node_modules/.pnpm/@acala-network+chopsticks@0.9.8-2_debug@4.3.4/node_modules/@acala-network/chopsticks/dist/cjs/utils/decoder.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/home/girazoki/Desktop/tanssi/node_modules/.pnpm/@acala-network+chopsticks@0.9.8-2_debug@4.3.4/node_modules/@acala-network/chopsticks/dist/cjs/utils/decoder.js:12:24) {
  code: 'ERR_REQUIRE_ESM'
}

However after hacking a bit in the version branch we have been able to make it work and we confirm that is able to fork correctly our networks. We might need to propose one additional inherent to make it fully compatible but we can do this, as right now it seems much easier.

Thanks!

ermalkaleci commented 8 months ago

@girazoki I've pushed a new beta with the fix

girazoki commented 8 months ago

I confirm it works with our container-chains, thank you so much! As I said for the tanssi chain we need an additional inherent, but we should be able to do a PR for it. Will let you know when we have it!

Once again, thank you!

ermalkaleci commented 8 months ago

Yes, with the refactored inherent it should be straightforward

girazoki commented 8 months ago

https://github.com/AcalaNetwork/chopsticks/pull/665 CC: @ermalkaleci