Skip to content

chore: Fix slash veto demo flake#16934

Merged
LHerskind merged 1 commit intonextfrom
palla/try-fix-veto-demo-flake
Sep 11, 2025
Merged

chore: Fix slash veto demo flake#16934
LHerskind merged 1 commit intonextfrom
palla/try-fix-veto-demo-flake

Conversation

@spalladino
Copy link
Contributor

@spalladino spalladino commented Sep 10, 2025

The slash_veto_demo e2e test was failing since a view-like call to the contract to get the committees slashed for a given round reverted:

21:15:59   ● veto slash › vetoes true and sets the new tally slasher
21:15:59 
21:15:59     ContractFunctionExecutionError: The contract function "getSlashTargetCommittees" reverted.
21:15:59 
21:15:59     Error: ValidatorSelection__InsufficientValidatorSetSize(uint256 actual, uint256 expected)
21:15:59                                                            (0, 4)
21:15:59      
21:15:59     Contract Call:
21:15:59       address:   0x9debab8762554f8b8f5dfad92e40c1c7d2b0263a
21:15:59       function:  getSlashTargetCommittees(uint256 _round)
21:15:59       args:                              (3)
21:15:59       sender:    0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
21:15:59 
21:15:59     Docs: https://viem.sh/docs/contract/simulateContract
21:15:59     Version: viem@2.23.7
21:15:59 
21:15:59       71 |     }
21:15:59       72 |     /** Returns the slash actions and payload address for a given round (zero if no slash actions) */ async getPayload(round) {
21:15:59     > 73 |         const { result: committees } = await this.contract.simulate.getSlashTargetCommittees([
21:15:59          |                                        ^
21:15:59       74 |             round
21:15:59       75 |         ]);
21:15:59       76 |         const tally = await this.contract.read.getTally([
21:15:59 
21:15:59       at getContractError (../../node_modules/viem/utils/errors/getContractError.ts:78:10)
21:15:59       at simulateContract (../../node_modules/viem/actions/public/simulateContract.ts:308:11)
21:15:59       at TallySlashingProposerContract.getPayload (../../ethereum/dest/contracts/tally_slashing_proposer.js:73:40)
21:15:59       at e2e_p2p/slash_veto_demo.test.ts:247:40
21:15:59       at retryUntil (../../foundation/dest/retry/index.js:84:24)
21:15:59       at e2e_p2p/slash_veto_demo.test.ts:310:32
21:15:59 
21:15:59     Cause:
21:15:59     ContractFunctionRevertedError: The contract function "getSlashTargetCommittees" reverted.
21:15:59 
21:15:59     Error: ValidatorSelection__InsufficientValidatorSetSize(uint256 actual, uint256 expected)
21:15:59                                                            (0, 4)

My guess is this happened because the round queried included early epochs where the committee had not yet been formed, so one of the calls to the rollup to get the committee failed, causing the entire call to fail even if other epochs in the round did have committees.

This PR fixes the L1 contract so it try/catches calls to the rollup and returns whatever committees could be fetched.

@spalladino spalladino force-pushed the palla/try-fix-veto-demo-flake branch from db8289d to b59e100 Compare September 10, 2025 20:10
for (uint256 epochIndex; epochIndex < ROUND_SIZE_IN_EPOCHS; ++epochIndex) {
Epoch epoch = getSlashTargetEpoch(_round, epochIndex);
committees[epochIndex] = rollup.getEpochCommittee(epoch);
try rollup.getEpochCommittee(epoch) returns (address[] memory committee) {
Copy link
Contributor

Choose a reason for hiding this comment

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

💀

@LHerskind LHerskind added this pull request to the merge queue Sep 11, 2025
Merged via the queue into next with commit 31331e2 Sep 11, 2025
15 checks passed
@LHerskind LHerskind deleted the palla/try-fix-veto-demo-flake branch September 11, 2025 11:21
spalladino pushed a commit that referenced this pull request Sep 12, 2025
The `slash_veto_demo` e2e test was failing since a view-like call to the
contract to get the committees slashed for a given round reverted:

```
21:15:59   ● veto slash › vetoes true and sets the new tally slasher
21:15:59
21:15:59     ContractFunctionExecutionError: The contract function "getSlashTargetCommittees" reverted.
21:15:59
21:15:59     Error: ValidatorSelection__InsufficientValidatorSetSize(uint256 actual, uint256 expected)
21:15:59                                                            (0, 4)
21:15:59
21:15:59     Contract Call:
21:15:59       address:   0x9debab8762554f8b8f5dfad92e40c1c7d2b0263a
21:15:59       function:  getSlashTargetCommittees(uint256 _round)
21:15:59       args:                              (3)
21:15:59       sender:    0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
21:15:59
21:15:59     Docs: https://viem.sh/docs/contract/simulateContract
21:15:59     Version: viem@2.23.7
21:15:59
21:15:59       71 |     }
21:15:59       72 |     /** Returns the slash actions and payload address for a given round (zero if no slash actions) */ async getPayload(round) {
21:15:59     > 73 |         const { result: committees } = await this.contract.simulate.getSlashTargetCommittees([
21:15:59          |                                        ^
21:15:59       74 |             round
21:15:59       75 |         ]);
21:15:59       76 |         const tally = await this.contract.read.getTally([
21:15:59
21:15:59       at getContractError (../../node_modules/viem/utils/errors/getContractError.ts:78:10)
21:15:59       at simulateContract (../../node_modules/viem/actions/public/simulateContract.ts:308:11)
21:15:59       at TallySlashingProposerContract.getPayload (../../ethereum/dest/contracts/tally_slashing_proposer.js:73:40)
21:15:59       at e2e_p2p/slash_veto_demo.test.ts:247:40
21:15:59       at retryUntil (../../foundation/dest/retry/index.js:84:24)
21:15:59       at e2e_p2p/slash_veto_demo.test.ts:310:32
21:15:59
21:15:59     Cause:
21:15:59     ContractFunctionRevertedError: The contract function "getSlashTargetCommittees" reverted.
21:15:59
21:15:59     Error: ValidatorSelection__InsufficientValidatorSetSize(uint256 actual, uint256 expected)
21:15:59                                                            (0, 4)
```

My guess is this happened because the round queried included early
epochs where the committee had not yet been formed, so one of the calls
to the rollup to get the committee failed, causing the entire call to
fail even if other epochs in the round did have committees.

This PR fixes the L1 contract so it try/catches calls to the rollup and
returns whatever committees _could_ be fetched.
PhilWindle pushed a commit that referenced this pull request Sep 30, 2025
Plenty contract PR's have been implemented since the cut of V2. I'm
taking a look into them to figure out if we need all of them. And can
make a potential monster cherry pick.

```bash
git --no-pager log --oneline v2..next -- "l1-contracts/"
44e3f64 fix: tmnt 412
70f004d fix: tmnt 405, 411, 413, 414, 418, 419, 421, 425
b02160b fix: Fix the hash to point function randomness
5cd8f41 fix: gas boundary and removal of isOnCurve
a310dd9 chore: fix misc issues for clarity
46e3dd7 chore: update gse deposit natspec (#17247)
7a12a96 chore: add comment to addRollup
3887ea2 feat: queue flushing update
a3e23b9 Checkpoint circuits.
545904b (origin/saleel/zkpassport-update) chore: add validity period check on zkpassport (#17054)
10e4df4 chore: update zkpassport version (#17044)
ffd05ca (tag: v3.0.0-nightly.20250915) chore: update coin issuer rate (#16985)
ac300f4 chore: Fix governance vote test (#17023)
e7136e6 chore: Fix governance vote test
4502f07 fix: unbounded lock delay (#16951)
ba13aa6 (origin/gh-readonly-queue/next/pr-16971-0fcfb7625e38cd58b602a8b09b1f6b48cfbc693a) feat: Allow vetoer to disable slasher temporarily (#16971)
cf3afa8 (origin/palla/disable-slashing) feat: Allow vetoer to disable slasher
0fcfb76 (origin/gh-readonly-queue/next/pr-16950-d6cff17e9a10e8305925d1cd1020c30a0e3eb6bf) fix: error prefix (#16950)
50b0c1d chore: reject gov deposit into gov (#16917)
1175713 chore: update coin issuer rate
45e3bdb fix: unbounded lock delay
93976d6 fix: error prefix
95c296f chore: reject gov deposit into gov
b208c8e (origin/09-11-refactor_fixing_offchain_onchain_naming) refactor: fixing offchain/onchain naming
e87438b chore: minor misc solidity changes
a29ccaa fix: align timestamps for sample values
31331e2 (origin/gh-readonly-queue/next/pr-16934-7188c46c1b4a151b77c3ec5a4a8817a19b74927c) chore: Fix slash veto demo flake (#16934)
b59e100 (origin/palla/try-fix-veto-demo-flake) chore: Try fix slash veto demo flake
2695b7b fix: never use cache in `verifyProposer`
9193dfb chore: add few extra checks
f85a17f feat: local ejection threshold
97928de (origin/gh-readonly-queue/next/pr-16753-5475f5b912ae31492bb93c783f08ca6f7d38b2c6) fix: proposer sign digest of attestations (#16753)
87038a3 chore: silence unhelpful forge lints (#16809)
1305503 (origin/tf/silence-forge-lints) chore: silence unhelpful forge lints
2f71e44 fix: proposer sign digest of attestations
f4b78b5 Merge branch 'next' into merge-train/avm
```

I'll be cherry picking these with a few exceptions, namely:
```bash
a3e23b9 Checkpoint circuits.
b208c8e (origin/09-11-refactor_fixing_offchain_onchain_naming) refactor: fixing offchain/onchain naming
```

as these are touching so so many files. a3e23b9 deals with the
checkpoint building, which we don't really need for ignition. And the
other is just spelling in the comments. And to be frank, I'm not feeling
all that great about doing a 125 file commit backport just for spelling
in the comments

---------

Co-authored-by: TomAFrench <15848336+TomAFrench@users.noreply.github.com>
Co-authored-by: Santiago Palladino <santiago@aztec-labs.com>
Co-authored-by: saleel <saleel@saleel.xyz>
ludamad pushed a commit that referenced this pull request Dec 16, 2025
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.

2 participants