-
Notifications
You must be signed in to change notification settings - Fork 120
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
Implement fork from live chain capabilities #988
Comments
I think nowadays Chopsticks from Acala is also a very good tool and should be considered. |
@brunopgalvao asked me about this and I rather write my thoughts here for the sake of posterity. Executing the contract is at the end of the day just another call into the runtime, and if you want to "execute a particular runtime API call, on top of a particular state", then the underlying machinery used in try-runtime, or perhaps itself directly, can be used. ATM only nodes that integrate That being said, we are working with AlephZero to move it to a new repository, usable as a library. paritytech/try-runtime-cli#1 |
Thanks @kianenigma. Looks like substrate-contracts-node currently does not have the try-runtime cli configured. A few scenarios that I see:
|
Also, one thought that I have, teams that are building with pallet-contracts most likely use Cumulus (or parachain template) (which has try-runtime already configured) and add pallet contracts vs forking substrate-contracts-node. If so this could be good because it means that they already have try-runtime available. For demo purposes, we can configure a substrate node with pallet contracts or configure substrate-contracts-node with try-runtime and run the ink! e2e tests off of this try-runtime enabled node. |
This is actually a fairly simple thing to do. If you look into now it is integrated into node-template, is is merely adding a new CLI subcommand, and the rest is handled elsewhere. |
Thanks @kianenigma
I replicated how the node-template integrates try-runtime. You can see my work here: I am running into the following issue when running try-runtime on the contracts node:
So the issue here, most likely is that the contracts node does not use BABE/GRANDPA instead it uses manual-seal. I don't believe it will be able to get keys. This PR which removes aura and grandpa and implements manual-seal may help: Details on how to replicate the issue: |
Current state of the issue: We want to implement it via Chopsticks. Bruno got pretty far here, but it then turned out that smoldot (which Chopsticks uses) doesn't support There are two ways how this issue can be unblocked:
|
PR smol-dot/smoldot#166 is now merged, and smoldot should support pallet-contracts now, if I understand correctly? |
You are correct. However, chopsticks is still using version Which it looks like it is linked to this commit: The child trie support is in version |
This is an involved issue. Before any implementation is started, please discuss the design of the CLI API here.
To facilitate testing and development, it would be convenient to have the ability to implement fork capabilities in
cargo-contract
. This feature would allow developers to test their smart contracts using the current state of a target blockchain, which can help identify and fix potential issues before deploying the contract to a live network.This will be more involved, there is existing tooling in the Substrate ecosystem and this command should be built just using Rust dependencies.
Starting points:
The text was updated successfully, but these errors were encountered: