fix: limit offenses when voting in tally slashing mode by slashMaxPayloadSize#20683
Conversation
eaee53d to
31085e6
Compare
31085e6 to
2a3210d
Compare
PhilWindle
left a comment
There was a problem hiding this comment.
This looks ok to me. @spalladino is this approach sufficient to at least fix the bug?
spalladino
left a comment
There was a problem hiding this comment.
Heads up we're limiting the total number of offenses here, but IIRC the gas usage when slashing is dominated by the number of slashed parties, not individual offenses. We should trim the list of offenders rather than the list of offenses.
Also, note that here we're trimming the offenses we load from the store, but those then get expanded with always-slash offenses from config, so we could overrun the max size.
I think the right place to truncate is getSlashConsensusVotesFromOffenses, which is called immediately before computing the tally.
spalladino
left a comment
There was a problem hiding this comment.
Looks good! Just a few nits:
- Let's keep the return type of
getSlashConsensusVotesFromOffensesto be just the votes, but pass a logger so we can log if we truncate. And most importantly, log which ones we truncated. - Let's add a unit test where we have multiple offenses for the same validators, to test that we are indeed truncating validators and not offenders.
- Update the slasher README to reflect that we truncate validator count.
|
Welp, got merged anyway. |
BEGIN_COMMIT_OVERRIDE fix: track last seen nonce in case of stale fallback L1 RPC node (#20855) feat: Validate num txs in block proposals (#20850) fix(archiver): enforce checkpoint boundary on rollbackTo (#20908) fix: tps zero metrics (#20656) fix: handle scientific notation in bigintConfigHelper (#20929) feat(aztec): node enters standby mode on genesis root mismatch (#20938) fix: logging of class instances (#20807) feat(slasher): make slash grace period relative to rollup upgrade time (#20942) chore: add script to find PRs to backport (#20956) chore: remove unused prover-node dep (#20955) fix: increase minFeePadding in e2e_bot bridge resume tests and harden GasFees.mul() (#20962) feat(sequencer): (A-526) rotate publishers when send fails (#20888) chore: (A-554) bump reth version 1.6.0 -> 1.11.1 for eth devnet (#20889) chore: metric on how many epochs validator has been on committee (#20967) fix: set wallet minFeePadding in BotFactory constructor (#20992) chore: deflake epoch invalidate block test (#21001) chore(sequencer): e2e tests for invalid signature recovery in checkpoint attestations (#20971) chore: deflake duplicate proposals and attestations (#20990) chore: deflake epochs mbps test (#21003) feat: reenable function selectors in txPublicSetupAllowList (#20909) fix: limit offenses when voting in tally slashing mode by slashMaxPayloadSize (#20683) fix(spartan): wire SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT env var (#21017) END_COMMIT_OVERRIDE
Fixes A-507