chopsticks icon indicating copy to clipboard operation
chopsticks copied to clipboard

Mock grandpa and beefy rpc to allow P<>K bridge-init calls using chopsticks

Open xlc opened this issue 11 months ago • 3 comments

Context: https://github.com/paritytech/polkadot-sdk/issues/3522

xlc avatar Mar 05 '24 03:03 xlc

I think it is doable. However, Chopsticks is only a mocking client that doesn't actually finalize blocks using grandpa/beefy protocol so that it cannot provide real justifications.

There are two possible solutions:

1. Add a new feature to specify signing keys to Chopsticks so it can generate valid justifications.

2. Modify relayer to accept mock justifications. This will be useful to fork mainnet and run tests with it. As it is not possible to get real justifications from mainnet fork.

Let me know what do you think.

Also opened a tracking issue at Chopsticks AcalaNetwork/chopsticks#681

Thank you for opening this issue ! Moving the discussion here.

In the short term, mock or even empty finality proofs would help. We could probably modify the relayer and update the bridge hubs code to skip proof verification and run a basic test like this just to make sure that the rest of the functionality works. But it would be a complicated manual setup, and also it wouldn't cover everything.

So, in the long run, it would be great to have valid finality proofs though.

serban300 avatar Mar 05 '24 08:03 serban300

@serban300 can you give this a look and give it a try? https://github.com/AcalaNetwork/chopsticks/pull/695 it is currently just return mock data (0x7777...). Let us know if that works or if anything adjustments are needed

xlc avatar Mar 15 '24 05:03 xlc

@xlc Thank you ! Will give it a try next week.

serban300 avatar Mar 15 '24 08:03 serban300