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

Reshare e2e test #1254

Merged
merged 10 commits into from
Jan 31, 2025
Merged

Reshare e2e test #1254

merged 10 commits into from
Jan 31, 2025

Conversation

JesseAbram
Copy link
Member

@JesseAbram JesseAbram commented Jan 16, 2025

Adds a feature flag reshare-test to shorten session time and allow us to e2e test reshare test.

I added a step to release to test this manually, I don't think this is needed to be tested in CI everytime since it would be a whole recompile and would take time, however I am open to suggestions here

Closes #1210

@JesseAbram JesseAbram marked this pull request as ready for review January 17, 2025 19:10
Copy link
Contributor

@ameba23 ameba23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌟 This is great as i am really depressed about the fact that our CI is still not reliably passing after all the things we have tried.

I could only get this to work locally by manually adding the line:

reshare-test=["entropy-runtime/reshare-test"]

to ./node/cli/Cargo.toml. So please either add that or document how to run the test without needing to add that.

Also, i am not so sure about the second part of the test where we wait 80 seconds for another reshare. I ran the test 3 times locally, and twice is passed but once it failed with:

---- validator::tests::test_reshare_e2e stdout ----
thread 'validator::tests::test_reshare_e2e' panicked at crates/threshold-signature-server/src/validator/tests.rs:297:5:
assertion `left != right` failed

Yes, probably this is because i have slow hardware. But i think ideally the second reshare test should use the same code as the first bit, where we first wait to see if signers have changed, then wait another 10s for the rotation.

@@ -5,6 +5,9 @@ tagged as the final release.

## Pre-Prep
- [ ] Inform relevant parties that you're preparing a release (e.g, by posting on Discord)
- [ ] Manually run e2e reshare test
(first compile node with features=reshare-test and then run
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took this to mean do this:

cargo build -p entropy --release --features reshare-test

but this gives me:

error: none of the selected packages contains these features: reshare-test

How are you compiling the runtime with this feature flag without having it present in node/cli/Cargo.toml and propagated down?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gonna add based on the other comment, but weird I don't see it locally or on CI

runtime/Cargo.toml Show resolved Hide resolved
crates/threshold-signature-server/src/validator/tests.rs Outdated Show resolved Hide resolved
crates/threshold-signature-server/src/validator/tests.rs Outdated Show resolved Hide resolved
@JesseAbram
Copy link
Member Author

🌟 This is great as i am really depressed about the fact that our CI is still not reliably passing after all the things we have tried.

I could only get this to work locally by manually adding the line:

reshare-test=["entropy-runtime/reshare-test"]

to ./node/cli/Cargo.toml. So please either add that or document how to run the test without needing to add that.

hmmmm interesting worked locally and on the CI, but will add

Copy link
Collaborator

@HCastano HCastano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main thing for me is to try and get this to run in CI but only on release (or test release) tags

@@ -5,6 +5,9 @@ tagged as the final release.

## Pre-Prep
- [ ] Inform relevant parties that you're preparing a release (e.g, by posting on Discord)
- [ ] Manually run e2e reshare test
Copy link
Collaborator

@HCastano HCastano Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would try and avoid running this manually and instead make it a part of the release CI job. We have an on > push > release/... stage where we can add an extra testing stage which encompasses this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be doable but let me do in another PR so I can work with zach of vi on that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RELEASE_CHECKLIST.md Outdated Show resolved Hide resolved
pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 4 * HOURS;
#[cfg(feature = "reshare-test")]
pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 15 / (SECS_PER_BLOCK as BlockNumber);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why define this in terms of SECS_PER_BLOCK instead of having something fixed for tests? Say, 1 * MINUTE or something like that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because I want it less than one minuet and I I get an overflow problem that way

@@ -113,4 +113,5 @@ alice =[]
bob =[]
# Enable this feature to run the integration tests for the wasm API of entropy-protocol
# This requires the entropy-protocol node-js module to be built and so is not run by default
wasm_test=[]
wasm_test =[]
reshare-test=[]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add some comments explaining the feature here and in the other TOML files

Comment on lines +249 to +259
let (_validator_ips, _validator_ids) =
spawn_testing_validators(crate::helpers::tests::ChainSpecType::IntegrationJumpStarted)
.await;

let force_authoring = true;
let context =
test_node_process_testing_state(ChainSpecType::IntegrationJumpStarted, force_authoring)
.await;
let api = get_api(&context[0].ws_url).await.unwrap();
let rpc = get_rpc(&context[0].ws_url).await.unwrap();
let client = reqwest::Client::new();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can replace this with spawn_tss_nodes_and_start_chain()

@JesseAbram JesseAbram merged commit 2761a12 into master Jan 31, 2025
8 checks passed
@JesseAbram JesseAbram deleted the reshare-e2e-test branch January 31, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression test on reshare protocol
3 participants