test(e2e): unify slashing timing profiles and merge duplicate suites#24495
Merged
Conversation
Round-2 consolidation of multi-node/slashing: - Add a SENTINEL_TIMING profile to setup.ts and route every test file's slot timing through it or baseSlashingOpts, removing the per-file redeclared ETHEREUM_SLOT_DURATION/AZTEC_SLOT_DURATION/AZTEC_EPOCH_DURATION constants. - Merge duplicate_attestation + duplicate_proposal into equivocation_offenses with a shared scenario runner and two describes. - Fold inactivity_slash_with_consecutive_epochs into inactivity_slash (2 describes). - Centralize the findSlashOffense offense lookup (and SlashOffense type) in setup.ts. - Remove the dead shouldVeto:false branch in slash_veto_demo. - Hoist sentinel_status_slash its 1-2 onto a shared runProposerFaultScenario helper.
The two inactivity describes don't share a beforeAll (the InactivityTest fixture is stateful per-instance), so merging them into one file only made it longer without gaining shared setup. Split back into separate files and revert the bootstrap.sh timeout bump that only applied to the merged file.
Collaborator
Flakey Tests🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
PhilWindle
approved these changes
Jul 5, 2026
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.
Round-2 e2e consolidation, PR 6 of 9 — scope:
multi-node/slashing/**. Every asserted behavior is preserved; no assertions were dropped.Timing profiles (B3)
The directory now uses exactly two named profiles in
slashing/setup.ts, with zero free-floating local slot/epoch timing constants in the test files:baseSlashingOpts(existing, eth 8s / aztec 24s) — the equivocation suites.SENTINEL_TIMING(new:{anvilSlotsInAnEpoch:4, listenAddress, ethereumSlotDuration:4, aztecSlotDuration:8, aztecEpochDuration:2, sentinelEnabled:true}) — the fast 8s-slot timing.Every adoption below is a pure re-expression: the effective config values passed to
setupare unchanged.equivocation_offenses(merged)baseSlashingOptssentinel_status_slash.parallelSENTINEL_TIMINGvalidators_sentinel.parallelSENTINEL_TIMINGmultiple_validators_sentinel.parallelSENTINEL_TIMINGslash_veto_demoSENTINEL_TIMINGbroadcasted_invalid_block_proposal_slashSENTINEL_TIMING+sentinelEnabled:falsebroadcasted_invalid_checkpoint_proposal_slash.parallelSENTINEL_TIMING+sentinelEnabled:falsedata_withholding_slashSENTINEL_TIMING+sentinelEnabled:false,aztecSlotDuration:12overrideattested_invalid_proposal.parallelSENTINEL_TIMING+sentinelEnabled:false,aztecSlotDuration:36+committee:3overrideDocumented overrides:
data_withholding(12s slots for the tolerance window) andattested_invalid_proposal(36s slots so an AVM-heavy 3-block checkpoint fits one slot) keep their bespokeaztecSlotDurationas a documented one-knob override onSENTINEL_TIMING; their eth/epoch come from the profile. Non-sentinel offense files spreadSENTINEL_TIMINGand setsentinelEnabled:false(= the prior default), reusing only the fast timing.Kept bespoke:
inactivity_setup.tsretains its CI-conditional timing (eth = CI ? 8 : 4,aztec = eth*2) — it is a shared fixture with a deliberate CI slot-doubling thatSENTINEL_TIMING's fixed 4s cannot express; the two inactivity test files themselves declare no timing constants.Merges
duplicate_attestation.test.ts+duplicate_proposal.test.ts→equivocation_offenses.test.ts: a sharedrunEquivocationScenariorunner plus two describes (the two setups differ inslashDuplicateAttestationPenalty/attestToEquivocatedProposals, so each keeps its ownbeforeEach).inactivity_slash.test.tsandinactivity_slash_with_consecutive_epochs.test.tsstay as separate files. They share theInactivityTestfixture (inactivity_setup.ts), but the fixture is stateful across epochs, so each file still needs its ownbeforeAll— folding them into one file with two describes would have grown the file without sharing any setup.Helpers / cleanups
findSlashOffense(and theSlashOffensetype) insetup.ts, adopted byattested_invalid_proposalandbroadcasted_invalid_checkpoint_proposal_slash(the latter's local offense-lookup wrappers now delegate to it, switching validator comparison from string toEthAddress.equals).slash_veto_demo: deleted the deadshouldVeto:falsebranch (it.each([[true]])→ plainit). No running assertion was dropped — the false branch's balance-decrease assertions were never exercised.sentinel_status_slashits 1-2: hoisted onto a sharedrunProposerFaultScenariohelper as thin unrolled its (stays.parallel, plain string titles, noit.each).Verification
yarn build,yarn format end-to-end,yarn lint end-to-endall pass. Ran locally (green):equivocation_offenses(both its ×2),slash_veto_demo,sentinel_status_slash(3),attested_invalid_proposal(2),broadcasted_invalid_checkpoint_proposal_slash(3),broadcasted_invalid_block_proposal_slash,data_withholding_slash,validators_sentinel(4),multiple_validators_sentinel.inactivity_slashandinactivity_slash_with_consecutive_epochscannot run in this local env — theInactivityTestfixture derives 0 blocks/checkpoint at the localaztec=8(default 3s blocks); confirmed the unmodified base files fail identically, and CI'saztec=16derivation is fine. Relying on CI for those files.