-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add network-jumpstart
command to entropy-test-cli
#1004
Conversation
This PR adds a way to trigger a network jumpstart from the test CLI. This is useful for ensuring the network is in the correct state before registering using the new registration flow.
network-jumpstart
subcommand to entropy-test-cli
network-jumpstart
command to entropy-test-cli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Feels like we are getting close to be able to try all this out
let _result = | ||
submit_transaction_with_pair(api, rpc, &signer, &jump_start_request, None).await?; | ||
|
||
let mut blocks_sub = api.blocks().subscribe_finalized().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah i didn't know about this, this is so much nicer that polling with a timer.
|
||
let mut blocks_sub = api.blocks().subscribe_finalized().await?; | ||
|
||
while let Some(block) = blocks_sub.next().await { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the jump start DKG fails? Im guessing we just wont get confirmations and this will hang forever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah right now it would just sit waiting for the event 😅
JumpstartNetwork { | ||
/// The mnemonic for the signer which will trigger the jumpstart process. | ||
#[arg(short, long)] | ||
mnemonic_option: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated to this PR but i still think its insane that this isn't a positional argument
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually don't think it should be positional 😉 But we do need to refactor the CLI UX at some point, it's not as consistent or friendly as it can be
// In this case we don't care too much about the result because we're more interested in the | ||
// `FinishedNetworkJumpStart` event, which happens later on. | ||
let jump_start_request = entropy::tx().registry().jump_start_network(); | ||
let _result = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It says in the doccomment that this fails if the network has already been jumpstarted. I can't see where that would happen. Isn't there also a case where the network is not yet ready to be jumpstarted because of too few validators? Or do we just manually decide when its ready by running this command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the fails happens on chain here https://github.com/entropyxyz/entropy-core/blob/master/pallets/registry/src/lib.rs#L270
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, so what would happen is when we submit the jump_start_network()
extrinsic we'd get back one of those errors instead of a success event (StartedNetworkJumpStart
), and then we'd bail out of this function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pr looks good maybe some like concept of it it has run for X time fail the command so it doesn't hang forever, also maybe an exit case where it checks if the network is already jumpstarted and returns a message saying that
@@ -33,7 +33,7 @@ anyhow ="1.0.86" | |||
|
|||
# Only for the browser | |||
js-sys={ version="0.3.70", optional=true } | |||
tokio ="1.39" | |||
tokio ={ version="1.39", features=["time"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ameba23 not sure if adding this feature will be problematic for Wasm compilation. In the docs it seems like it's fine as long as the Wasm environment is in the web, so not wasm32-unknown-unknown
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess if it turns out to be a problem we can find a way to fix it
* master: Bump serde_json from 1.0.124 to 1.0.125 in the patch-dependencies group (#1007) Signing flow with derived accounts (#990) Add `network-jumpstart` command to `entropy-test-cli` (#1004) Refactor reshare (#994) Migrate circle-ci workflow to github actions (#991) Delete old keyshare if not in next_signers (#999)
This PR adds a way to trigger a network jumpstart from the test CLI. This is useful for ensuring the
network is in the correct state before registering using the new registration flow.