Skip to content

test(e2e): unify slashing timing profiles and merge duplicate suites#24495

Merged
PhilWindle merged 2 commits into
merge-train/spartan-v5from
spl/e2e-r2-slashing
Jul 5, 2026
Merged

test(e2e): unify slashing timing profiles and merge duplicate suites#24495
PhilWindle merged 2 commits into
merge-train/spartan-v5from
spl/e2e-r2-slashing

Conversation

@spalladino

@spalladino spalladino commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

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 setup are unchanged.

File Profile Effective value change?
equivocation_offenses (merged) baseSlashingOpts no (both source files already used it)
sentinel_status_slash.parallel SENTINEL_TIMING no
validators_sentinel.parallel SENTINEL_TIMING no
multiple_validators_sentinel.parallel SENTINEL_TIMING no
slash_veto_demo SENTINEL_TIMING no
broadcasted_invalid_block_proposal_slash SENTINEL_TIMING + sentinelEnabled:false no
broadcasted_invalid_checkpoint_proposal_slash.parallel SENTINEL_TIMING + sentinelEnabled:false no
data_withholding_slash SENTINEL_TIMING + sentinelEnabled:false, aztecSlotDuration:12 override no
attested_invalid_proposal.parallel SENTINEL_TIMING + sentinelEnabled:false, aztecSlotDuration:36 + committee:3 override no

Documented overrides: data_withholding (12s slots for the tolerance window) and attested_invalid_proposal (36s slots so an AVM-heavy 3-block checkpoint fits one slot) keep their bespoke aztecSlotDuration as a documented one-knob override on SENTINEL_TIMING; their eth/epoch come from the profile. Non-sentinel offense files spread SENTINEL_TIMING and set sentinelEnabled:false (= the prior default), reusing only the fast timing.

Kept bespoke: inactivity_setup.ts retains its CI-conditional timing (eth = CI ? 8 : 4, aztec = eth*2) — it is a shared fixture with a deliberate CI slot-doubling that SENTINEL_TIMING's fixed 4s cannot express; the two inactivity test files themselves declare no timing constants.

Merges

  • duplicate_attestation.test.ts + duplicate_proposal.test.tsequivocation_offenses.test.ts: a shared runEquivocationScenario runner plus two describes (the two setups differ in slashDuplicateAttestationPenalty / attestToEquivocatedProposals, so each keeps its own beforeEach).
  • inactivity_slash.test.ts and inactivity_slash_with_consecutive_epochs.test.ts stay as separate files. They share the InactivityTest fixture (inactivity_setup.ts), but the fixture is stateful across epochs, so each file still needs its own beforeAll — folding them into one file with two describes would have grown the file without sharing any setup.

Helpers / cleanups

  • Centralized findSlashOffense (and the SlashOffense type) in setup.ts, adopted by attested_invalid_proposal and broadcasted_invalid_checkpoint_proposal_slash (the latter's local offense-lookup wrappers now delegate to it, switching validator comparison from string to EthAddress.equals).
  • slash_veto_demo: deleted the dead shouldVeto:false branch (it.each([[true]]) → plain it). No running assertion was dropped — the false branch's balance-decrease assertions were never exercised.
  • sentinel_status_slash its 1-2: hoisted onto a shared runProposerFaultScenario helper as thin unrolled its (stays .parallel, plain string titles, no it.each).

Verification

yarn build, yarn format end-to-end, yarn lint end-to-end all 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_slash and inactivity_slash_with_consecutive_epochs cannot run in this local env — the InactivityTest fixture derives 0 blocks/checkpoint at the local aztec=8 (default 3s blocks); confirmed the unmodified base files fail identically, and CI's aztec=16 derivation is fine. Relying on CI for those files.

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.
@spalladino spalladino added wip Work in progress and removed wip Work in progress labels Jul 3, 2026
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.
@AztecBot

AztecBot commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/97adeeaef29dbd4e�97adeeaef29dbd4e8;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/multi-node/slashing/broadcasted_invalid_block_proposal_slash.test.ts (127s) (code: 0) group:e2e-p2p-epoch-flakes

@PhilWindle PhilWindle merged commit 842cb8d into merge-train/spartan-v5 Jul 5, 2026
12 checks passed
@PhilWindle PhilWindle deleted the spl/e2e-r2-slashing branch July 5, 2026 18:06
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.

3 participants