feat: accelerate aggregator startup by one epoch in e2e tests - #3436
Merged
Conversation
Clamp the signer retrieval epoch to epoch zero when computing the network configuration, so the aggregator can start as soon as the devnet is at epoch zero.
There was a problem hiding this comment.
Pull request overview
This PR reduces end-to-end test startup time and flakiness around epoch transitions by allowing the aggregator to compute “signer retrieval” epochs safely at epoch 0 (clamping instead of erroring), and by making the leader aggregator startup epoch deterministic in the e2e harness.
Changes:
- Add
Epoch::offset_to_signer_retrieval_epoch_saturating()inmithril-commonand unit-test its clamping behavior. - Switch aggregator/network-configuration code paths to use the saturating offset when deriving “aggregation / signer retrieval” epochs.
- Update e2e infrastructure to wait for epoch 1 before serving the leader aggregator for deterministic startup behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| mithril-test-lab/mithril-end-to-end/src/mithril/infrastructure.rs | Waits for epoch 1 before serving the leader aggregator to stabilize startup timing across runs. |
| mithril-common/src/entities/epoch.rs | Introduces a saturating epoch offset helper and tests for epoch-0 clamping. |
| mithril-aggregator/src/store/epoch_settings_storer.rs | Uses the saturating epoch offset when handling epoch-settings startup discrepancies. |
| mithril-aggregator/src/services/network_configuration_provider.rs | Uses the saturating offset when computing aggregation-related epochs (local provider). |
| mithril-aggregator/src/services/epoch_service.rs | Uses the saturating offset when computing signer retrieval epoch in the epoch service. |
| internal/mithril-protocol-config/src/http.rs | Uses the saturating offset when computing aggregation-related epochs (HTTP provider). |
jpraynaud
temporarily deployed
to
testing-preview
July 27, 2026 11:13 — with
GitHub Actions
Inactive
jpraynaud
temporarily deployed
to
testing-2-preview
July 27, 2026 11:13 — with
GitHub Actions
Inactive
Compute the clamped epoch on the underlying integer instead of discarding the error, so unrelated offset failures are no longer reported as epoch zero.
jpraynaud
temporarily deployed
to
testing-2-preview
July 27, 2026 13:26 — with
GitHub Actions
Inactive
jpraynaud
temporarily deployed
to
testing-preview
July 27, 2026 13:26 — with
GitHub Actions
Inactive
Replace the i64 cast in 'offset_by' with checked signed arithmetic, which no longer truncates above i64::MAX nor wraps above u64::MAX.
Alenar
approved these changes
Jul 27, 2026
Alenar
left a comment
Collaborator
There was a problem hiding this comment.
LGTM but this raise business questions, but since it will in fact only occurs on dev networks this should be fine.
Check that `inform_epoch` and the epoch settings discrepancy handling succeed at epoch zero with a clamped signer retrieval epoch.
* mithril-protocol-config from `0.1.11` to `0.1.12` * mithril-aggregator from `0.9.17` to `0.9.18` * mithril-common from `0.7.13` to `0.7.14` * mithril-end-to-end from `0.5.6` to `0.5.7`
jpraynaud
temporarily deployed
to
testing-preview
July 27, 2026 15:33 — with
GitHub Actions
Inactive
jpraynaud
temporarily deployed
to
testing-2-preview
July 27, 2026 15:33 — with
GitHub Actions
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Content
This PR includes an acceleration of the end to end tests by one epoch, by allowing the aggregator to start as soon as the devnet is at epoch zero instead of waiting for the next epoch.
1before the leader aggregator serves, so the startup epoch is deterministic across runsEpoch::offset_to_signer_retrieval_epoch_saturatinginmithril-common, which clamps to epoch zero instead of returning an error when the signer retrieval offset would yield a negative epochEpochService, in the local and HTTPMithrilNetworkConfigurationProviderimplementations, and in theEpochSettingsStorerstartup discrepancy handlingPre-submit checklist