Skip to content
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 option to start in a pre-jumpstarted state to genesis config #1162

Merged
merged 29 commits into from
Nov 26, 2024

Conversation

ameba23
Copy link
Contributor

@ameba23 ameba23 commented Nov 13, 2024

This is a sub-PR of #1147 and targets that branch.

To speed things up in our signing tests we mock the jumpstart DKG and use pre-generated keyshares. Changes in #1147 mean that the way we were mocking the jumpstart no longer works, because sending the jumpstart extrinsic will trigger an actual jumpstart DKG.

This fixes that by offering the option to start the chain in a pre-jumpstarted state.

The pre-generated keyshares are still used, but since we know who the initial signers are, we only need one set and can remove the extra ones we created to get around the problem of DKG signers being chosen randomly.

It should also make the signing tests slightly faster as we no longer need the jump start and jump start confirmation extrinsics to go through before we can sign.

I am also hoping it will shed light on the problems i am having resharing, as we wont have the problem of needing to time the reshare to happen after DKG.

The downside is, i couldn't figure out how to do this without adding an extra chainspec type, which complicates the code a bit.

@ameba23 ameba23 self-assigned this Nov 13, 2024
@ameba23 ameba23 marked this pull request as draft November 13, 2024 12:33
@ameba23 ameba23 changed the title Add option to start in a pre-jumpstarted starte to genesis config Add option to start in a pre-jumpstarted state to genesis config Nov 14, 2024
@ameba23
Copy link
Contributor Author

ameba23 commented Nov 14, 2024

I am having a strange problem following making these changes to the chainspec.

In tests, if i make any api or rpc call to the chain, even something as simple as getting current block number with rpc, i get this error:

thread 'user::tests::signature_request_with_derived_account_works' panicked at crates/threshold-signature-server/src/helpers/tests.rs:304:89:
called `Result::unwrap()` on an `Err` value: GenericSubstrate(Rpc(ClientError(RestartNeeded(Transport(i/o error: Connection reset by peer (os error 104)

I have tried building this branch with docker compose, and everything is working fine, i can register and sign messages with the test CLI. So it seems it related to the test setup, not the chainspec itself.

So i also tried reverting the change which makes bob, charlie, and dave's chain contact their TSS nodes (changing it back to fuck_off_tss_ip). As this is as far as i can see the only significant change i have made to the test setup. But that does not fix the problem.

To be sure this is an issue with the TSS test setup and not the chain, i changed to the branch this PR is based off (peg/dont-mock-propagation), did NOT recompile the chain node, and ran some tests. And they worked - as in they were able to make chain api calls.


Update: this is now fixed - the issue was that the helper function which started the chain nodes returned the api and rpc, but not the test node context itself. Dropping that when the function returned meant that the process was stopped.

@ameba23 ameba23 marked this pull request as ready for review November 26, 2024 12:01
@ameba23 ameba23 merged commit 9346adf into peg/dont-mock-propagation Nov 26, 2024
8 checks passed
@ameba23 ameba23 deleted the peg/pre-jumpstart-chainspec branch November 26, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant