Skip to content

fix(devnet): fix the main sources of flakiness of the e2e tests in the CI - #3734

Draft
jpraynaud wants to merge 8 commits into
mainfrom
jpraynaud/3733-fix-ci-flakiness
Draft

jpraynaud wants to merge 8 commits into
mainfrom
jpraynaud/3733-fix-ci-flakiness

Conversation

@jpraynaud

Copy link
Copy Markdown
Member

Content

This PR includes fixes of the main sources of flakiness of the devnet in the e2e tests of the CI:

  • Fix the devnet scripts so that a written datum and transferred funds are checked against the submitted transaction, a lost transaction being retried instead of accepted
  • Write the protocol parameters update ahead of its activation (6 epochs on networks with epochs shorter than 30 s, 3 epochs otherwise) and check the certificates 3 epochs after the activation, failing with a retryable error when the update lands less than one epoch before its activation
  • Retry the download of the Cardano node and DMQ node archives on transient errors, and check their gzip integrity
  • Connect the devnet pools to all their local roots, including the full nodes, with every local root kept hot
  • Fail fast with a retryable error when two devnet pools logged a fork deeper than k against each other

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

Issue(s)

Closes #3733

…tion

A lost datum transaction left the previous datum in place and was reported as written.
…saction

The transaction id was expanded when generating the script, so any UTxO of the address passed the check.
…y are written at

Writing the protocol configuration datum spans several epochs when they are short, which left too few epochs for the new parameters to be used.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

An active finding remains because the new public context field lacks rustdoc documentation in the toolkit API.

1 open issue
What changed in this PR

This PR hardens the Cardano devnet and end-to-end test harness against transient downloads, lost transactions, protocol-parameter timing races, and pool-chain partitions.

Changes:

  • Adds epoch-aware protocol-parameter scheduling and transaction-specific output validation.
  • Strengthens devnet topology and startup checks for connectivity and deep forks.
  • Improves archive download retries and gzip integrity validation.
File Description
mithril-test-lab/​mithril-end-to-end/​src/​toolkit/​mod.rs Exposes the scenario context to scenario implementations.
mithril-test-lab/​mithril-end-to-end/​src/​toolkit/​context.rs Provides configured Cardano epoch-duration access and tests it.
mithril-test-lab/​mithril-end-to-end/​src/​scenario/​full.rs Schedules protocol-parameter updates with network-dependent lead time and validates activation timing.
mithril-test-lab/​cardano-devnet/​mkfiles/​mkfiles-topology-cardano.sh Connects pool and full nodes through hot local roots.
mithril-test-lab/​cardano-devnet/​mkfiles/​mkfiles-start.sh Checks for deep pool-chain partitions during startup.
mithril-test-lab/​cardano-devnet/​mkfiles/​mkfiles-init.sh Adds archive download retries and gzip integrity validation.
mithril-test-lab/​cardano-devnet/​mkfiles/​lib/​mkfiles-cardano-chain.sh Validates transaction-specific outputs and retries propagation failures while detecting partitions.

Review effort: Lite

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Test Results

     5 files  ± 0     211 suites  ±0   49m 33s ⏱️ - 1h 3m 0s
 4 688 tests  - 52   4 688 ✅  - 52  0 💤 ±0  0 ❌ ±0 
15 428 runs   - 34  15 428 ✅  - 34  0 💤 ±0  0 ❌ ±0 

Results for commit b657d39. ± Comparison against base commit 736297b.

This pull request removes 61 and adds 9 tests. Note that renamed tests count towards both.
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::index_out_of_bounds
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::index_too_large_for_circuit_range
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::indices_not_increasing
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_merkle_path_mismatch
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_swap_keep_merkle_path
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_wrong_verification_key
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_corrupt_sibling
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_flip_position
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_length_long
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_length_short
…
mithril-end-to-end ‑ scenario::full::tests::protocol_parameters_update_lead_is_3_epochs_from_the_fast_network_max_epoch_duration
mithril-end-to-end ‑ scenario::full::tests::protocol_parameters_update_lead_is_3_epochs_on_a_long_epoch_network
mithril-end-to-end ‑ scenario::full::tests::protocol_parameters_update_lead_is_3_epochs_when_restarting_the_aggregator
mithril-end-to-end ‑ scenario::full::tests::protocol_parameters_update_lead_is_6_epochs_on_a_fast_network
mithril-end-to-end ‑ scenario::full::tests::protocol_parameters_update_written_a_full_epoch_before_its_activation_is_accepted
mithril-end-to-end ‑ scenario::full::tests::protocol_parameters_update_written_after_its_activation_is_retryable
mithril-end-to-end ‑ scenario::full::tests::protocol_parameters_update_written_at_its_activation_is_retryable
mithril-end-to-end ‑ scenario::full::tests::protocol_parameters_update_written_the_epoch_before_its_activation_is_retryable
mithril-end-to-end ‑ toolkit::context::tests::context_exposes_the_epoch_duration_of_the_cardano_network

♻️ This comment has been updated with latest results.

@jpraynaud
jpraynaud deployed to testing-preview November 27, 2026 15:10 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-2-preview November 27, 2026 15:10 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-2-preview November 27, 2026 15:55 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-preview November 27, 2026 15:55 — with GitHub Actions Active
…activation on fast networks

A retried datum transaction could land after the activation epoch and block the certification.
Networks with epochs shorter than 30 s get a 6-epoch lead, and a late update fails with a retryable error.
An HTTP error body was saved as the archive and failed the extraction.
The download now fails on HTTP errors, retries them and checks the gzip integrity.
… full nodes

A single failed link at the system start let the pools fork away from each other beyond k.
The pools also no longer list themselves as producers.
A pool logging ForkTooDeep never rejoins the chain of the other pools, the transaction retries only delayed the failure.
The start and the chain writes now exit at once so that the run is retried on a fresh devnet.
@jpraynaud
jpraynaud deployed to testing-2-preview November 27, 2026 16:09 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-preview November 27, 2026 16:09 — with GitHub Actions Active
@jpraynaud
jpraynaud force-pushed the jpraynaud/3733-fix-ci-flakiness branch from aac3e38 to b657d39 Compare November 27, 2026 17:25
@jpraynaud
jpraynaud deployed to testing-2-preview November 27, 2026 18:12 — with GitHub Actions Active
@jpraynaud
jpraynaud deployed to testing-preview November 27, 2026 18:12 — with GitHub Actions Active

This branch was successfully deployed

2 active deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix flakiness of the devnet in the e2e tests of the CI

2 participants