Skip to content

fix: align testnet slashing penalties with L1 slash amounts#21722

Merged
aminsammara merged 4 commits intobackport-to-v4-stagingfrom
claudebox/fix-testnet-slashing-config
Mar 18, 2026
Merged

fix: align testnet slashing penalties with L1 slash amounts#21722
aminsammara merged 4 commits intobackport-to-v4-stagingfrom
claudebox/fix-testnet-slashing-config

Conversation

@AztecBot
Copy link
Collaborator

Summary

Testnet validators were detecting inactive validators and starting slashing rounds, but all votes were computed as zero because the per-offense penalty (10e18 = 10 TST) was far below the L1 contract's minimum slash threshold (100000e18 = 100,000 TST).

This PR sets all testnet slashing penalty values to 100000e18 to match AZTEC_SLASH_AMOUNT_SMALL, which is the minimum amount needed for a vote to register as 1 slash unit.

Root Cause

The vote computation in getSlashUnitsForAmount() (yarn-project/stdlib/src/slashing/tally.ts) checks if the accumulated offense amount reaches slashingAmounts[0] (= AZTEC_SLASH_AMOUNT_SMALL). Since 10e18 < 100000e18, the function always returned 0 slash units, causing all votes to be skipped.

BigInt Parsing Verification

  • The penalty values flow through env vars as strings (e.g. "100000e18")
  • bigintConfigHelper in foundation/src/config/index.ts handles scientific notation losslessly using bigint arithmetic (not float64)
  • The parsing regex correctly handles 100000e18BigInt("100000") * 10n ** 18n = exact result

Changes

  • spartan/environments/network-defaults.yml: Updated all testnet SLASH_*_PENALTY values from 10e18 to 100000e18

ClaudeBox log: https://claudebox.work/s/a2a0d7830a3d8ce3?run=2

ludamad and others added 2 commits March 17, 2026 14:35
BEGIN_COMMIT_OVERRIDE
fix: HA deadlock for last block edge case (#21690)
fix: process all contract classes in storeBroadcastedIndividualFunctions
(A-683) (#21686)
END_COMMIT_OVERRIDE
Testnet validators were detecting inactive validators and starting slashing
rounds, but all votes were computed as zero because the per-offense penalty
(10e18) was far below the L1 contract's minimum slash threshold (100000e18).

Set all testnet penalty values to 100000e18 to match AZTEC_SLASH_AMOUNT_SMALL.
@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Mar 18, 2026
- Disable PRUNE, DATA_WITHHOLDING, DUPLICATE_PROPOSAL, DUPLICATE_ATTESTATION penalties (set to 0)
- Lower inactivity target percentage from 0.9 to 0.7
- Increase consecutive epoch threshold from 1 to 2
- Increase grace period from 64 to 3600 L2 slots
@aminsammara aminsammara marked this pull request as ready for review March 18, 2026 10:12
@aminsammara aminsammara merged commit 129851b into backport-to-v4-staging Mar 18, 2026
10 checks passed
@aminsammara aminsammara deleted the claudebox/fix-testnet-slashing-config branch March 18, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants