Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ SLASH_DATA_WITHHOLDING_PENALTY=0 # Set to >0 to enable

# Invalid attestations and blocks
SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY=2000000000000000000000 # 2000 tokens
SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY=2000000000000000000000 # 2000 tokens
SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY=2000000000000000000000 # 2000 tokens
SLASH_INVALID_BLOCK_PENALTY=2000000000000000000000 # 2000 tokens

# Offense expiration
Expand Down
6 changes: 3 additions & 3 deletions spartan/aztec-node/templates/_pod-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ spec:
- name: SLASH_DUPLICATE_ATTESTATION_PENALTY
value: {{ .Values.node.slash.duplicateAttestationPenalty | quote }}
{{- end }}
{{- if .Values.node.slash.attestDescendantOfInvalidPenalty }}
- name: SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY
value: {{ .Values.node.slash.attestDescendantOfInvalidPenalty | quote }}
{{- if .Values.node.slash.proposeDescendantOfCheckpointWithInvalidAttestationsPenalty }}
- name: SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY
value: {{ .Values.node.slash.proposeDescendantOfCheckpointWithInvalidAttestationsPenalty | quote }}
{{- end }}
{{- if .Values.node.slash.attestInvalidCheckpointProposalPenalty }}
- name: SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY
Expand Down
2 changes: 1 addition & 1 deletion spartan/aztec-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ node:
invalidBlockPenalty: ""
invalidCheckpointProposalPenalty: ""
proposeInvalidAttestationsPenalty: ""
attestDescendantOfInvalidPenalty: ""
proposeDescendantOfCheckpointWithInvalidAttestationsPenalty: ""
attestInvalidCheckpointProposalPenalty: ""
unknownPenalty: ""
# Slasher behavior configuration
Expand Down
10 changes: 5 additions & 5 deletions spartan/environments/network-defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ slasher: &slasher
SLASH_INACTIVITY_PENALTY: 10e18
# Penalty for proposing invalid attestations.
SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10e18
# Penalty for attesting to a descendant of an invalid block.
SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10e18
# Penalty for proposing a checkpoint that builds on an invalid checkpoint.
SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY: 10e18
# Penalty for attesting to an invalid checkpoint proposal.
SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 10e18
# Penalty for proposing two different block or checkpoint proposal for the same position.
Expand Down Expand Up @@ -244,7 +244,7 @@ networks:
SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10e18
SLASH_DUPLICATE_PROPOSAL_PENALTY: 10e18
SLASH_DUPLICATE_ATTESTATION_PENALTY: 10e18
SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10e18
SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY: 10e18
SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 10e18
SLASH_UNKNOWN_PENALTY: 10e18
SLASH_INVALID_BLOCK_PENALTY: 10e18
Expand Down Expand Up @@ -290,7 +290,7 @@ networks:
SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 10e18
SLASH_DUPLICATE_PROPOSAL_PENALTY: 10e18
SLASH_DUPLICATE_ATTESTATION_PENALTY: 10e18
SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 10e18
SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY: 10e18
SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 10e18
SLASH_UNKNOWN_PENALTY: 10e18
SLASH_INVALID_BLOCK_PENALTY: 10e18
Expand Down Expand Up @@ -350,7 +350,7 @@ networks:
SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 2000e18
SLASH_DUPLICATE_PROPOSAL_PENALTY: 2000e18
SLASH_DUPLICATE_ATTESTATION_PENALTY: 2000e18
SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 2000e18
SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY: 2000e18
SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY: 2000e18
SLASH_UNKNOWN_PENALTY: 2000e18
SLASH_INVALID_BLOCK_PENALTY: 2000e18
Expand Down
2 changes: 1 addition & 1 deletion spartan/scripts/deploy_network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ SLASH_DATA_WITHHOLDING_TOLERANCE_SLOTS = ${SLASH_DATA_WITHHOLDING_TOLERANCE_SLOT
SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY = ${SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY:-null}
SLASH_DUPLICATE_PROPOSAL_PENALTY = ${SLASH_DUPLICATE_PROPOSAL_PENALTY:-null}
SLASH_DUPLICATE_ATTESTATION_PENALTY = ${SLASH_DUPLICATE_ATTESTATION_PENALTY:-null}
SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY = ${SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY:-null}
SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY = ${SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY:-null}
SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY = ${SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY:-null}
SLASH_UNKNOWN_PENALTY = ${SLASH_UNKNOWN_PENALTY:-null}
SLASH_INVALID_BLOCK_PENALTY = ${SLASH_INVALID_BLOCK_PENALTY:-null}
Expand Down
4 changes: 2 additions & 2 deletions spartan/terraform/deploy-aztec-infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ locals {
"validator.slash.proposeInvalidAttestationsPenalty" = var.SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY
"validator.slash.duplicateProposalPenalty" = var.SLASH_DUPLICATE_PROPOSAL_PENALTY
"validator.slash.duplicateAttestationPenalty" = var.SLASH_DUPLICATE_ATTESTATION_PENALTY
"validator.slash.attestDescendantOfInvalidPenalty" = var.SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY
"validator.slash.attestInvalidCheckpointProposalPenalty" = var.SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY
"validator.slash.proposeDescendantOfCheckpointWithInvalidAttestationsPenalty" = var.SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY
"validator.slash.attestInvalidCheckpointProposalPenalty" = var.SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY
"validator.slash.unknownPenalty" = var.SLASH_UNKNOWN_PENALTY
"validator.slash.invalidBlockPenalty" = var.SLASH_INVALID_BLOCK_PENALTY
"validator.slash.invalidCheckpointProposalPenalty" = var.SLASH_INVALID_CHECKPOINT_PROPOSAL_PENALTY
Expand Down
4 changes: 2 additions & 2 deletions spartan/terraform/deploy-aztec-infra/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,8 @@ variable "SLASH_DUPLICATE_ATTESTATION_PENALTY" {
nullable = true
}

variable "SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY" {
description = "The slash attest descendant of invalid penalty"
variable "SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY" {
description = "The slash propose descendant of invalid penalty"
type = string
nullable = true
}
Expand Down
5 changes: 4 additions & 1 deletion yarn-project/aztec-node/src/aztec-node/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,10 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, AztecNodeDeb
}

// We assume we want to slash for invalid attestations unless all max penalties are set to 0
if (config.slashProposeInvalidAttestationsPenalty > 0n || config.slashAttestDescendantOfInvalidPenalty > 0n) {
if (
config.slashProposeInvalidAttestationsPenalty > 0n ||
config.slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty > 0n
) {
attestationsBlockWatcher = new AttestationsBlockWatcher(archiver, epochCache, config);
watchers.push(attestationsBlockWatcher);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ describe('e2e_slashing_broadcasted_invalid_checkpoint_proposal_slash', () => {
slashDuplicateProposalPenalty: 0n,
slashDuplicateAttestationPenalty: 0n,
slashProposeInvalidAttestationsPenalty: 0n,
slashAttestDescendantOfInvalidPenalty: 0n,
slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty: 0n,
slashAttestInvalidCheckpointProposalPenalty: 0n,
slashUnknownPenalty: 0n,
slashSelfAllowed: true,
Expand Down
10 changes: 6 additions & 4 deletions yarn-project/end-to-end/src/spartan/invalidate_blocks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('invalidate blocks test', () => {
let node: AztecNode;
let origMinTxsPerBlock: number | undefined;
let origSlashProposeInvalidAttestationsPenalty: bigint | undefined;
let origSlashAttestDescendantOfInvalidPenalty: bigint | undefined;
let origSlashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty: bigint | undefined;
const health = new ChainHealth(config.NAMESPACE, logger);

const waitForSequencersToApplyConfig = async (expected: Partial<AztecNodeAdminConfig>, description: string) => {
Expand Down Expand Up @@ -78,7 +78,8 @@ describe('invalidate blocks test', () => {
skipCollectingAttestations: false,
minTxsPerBlock: origMinTxsPerBlock,
slashProposeInvalidAttestationsPenalty: origSlashProposeInvalidAttestationsPenalty,
slashAttestDescendantOfInvalidPenalty: origSlashAttestDescendantOfInvalidPenalty,
slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty:
origSlashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty,
};
await updateSequencersConfig(config, restoreConfig);
// Ensure config has actually propagated before the next scenario test starts
Expand Down Expand Up @@ -107,7 +108,8 @@ describe('invalidate blocks test', () => {
const first = configs?.[0];
origMinTxsPerBlock = first?.minTxsPerBlock ?? origMinTxsPerBlock;
origSlashProposeInvalidAttestationsPenalty = first?.slashProposeInvalidAttestationsPenalty;
origSlashAttestDescendantOfInvalidPenalty = first?.slashAttestDescendantOfInvalidPenalty;
origSlashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty =
first?.slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty;

const initialCheckpointNumber = (await monitor.run()).checkpointNumber;

Expand All @@ -116,7 +118,7 @@ describe('invalidate blocks test', () => {
await updateSequencersConfig(config, {
skipCollectingAttestations: true,
slashProposeInvalidAttestationsPenalty: 0n,
slashAttestDescendantOfInvalidPenalty: 0n,
slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty: 0n,
minTxsPerBlock: 0,
});

Expand Down
2 changes: 1 addition & 1 deletion yarn-project/foundation/src/config/env_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export type EnvVar =
| 'SLASH_DUPLICATE_ATTESTATION_PENALTY'
| 'SLASH_OVERRIDE_PAYLOAD'
| 'SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY'
| 'SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY'
| 'SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY'
| 'SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY'
| 'SLASH_UNKNOWN_PENALTY'
| 'SLASH_GRACE_PERIOD_L2_SLOTS'
Expand Down
10 changes: 5 additions & 5 deletions yarn-project/slasher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ List of all slashable offenses in the system:
**Target**: Block proposer.
**Time Unit**: Slot-based offense.

### ATTESTED_DESCENDANT_OF_INVALID
**Description**: A committee member attested to a block built on top of an invalid ancestor.
**Detection**: AttestationsBlockWatcher tracks invalid blocks and their descendants.
**Target**: Committee members who attested to the descendant block.
### PROPOSED_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS
**Description**: A proposer published a checkpoint to L1 that builds on an invalid checkpoint (one with invalid or insufficient attestations).
**Detection**: AttestationsBlockWatcher tracks invalid checkpoints and their descendants.
**Target**: Proposer of the descendant checkpoint.
**Time Unit**: Slot-based offense.

### DUPLICATE_PROPOSAL
Expand Down Expand Up @@ -174,7 +174,7 @@ with divergent validation limits.
- `slashBroadcastedInvalidCheckpointProposalPenalty`: Penalty for BROADCASTED_INVALID_CHECKPOINT_PROPOSAL
- `slashDuplicateProposalPenalty`: Penalty for DUPLICATE_PROPOSAL
- `slashProposeInvalidAttestationsPenalty`: Penalty for PROPOSED_INSUFFICIENT_ATTESTATIONS and PROPOSED_INCORRECT_ATTESTATIONS
- `slashAttestDescendantOfInvalidPenalty`: Penalty for ATTESTED_DESCENDANT_OF_INVALID
- `slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty`: Penalty for PROPOSED_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS
- `slashAttestInvalidCheckpointProposalPenalty`: Penalty for ATTESTED_TO_INVALID_CHECKPOINT_PROPOSAL
- `slashUnknownPenalty`: Default penalty for unknown offense types
- `slashMaxPayloadSize`: Limits the number of **unique validators** (across all committees and epochs in a round) that receive non-zero votes. When this cap is hit, the lowest-severity validator-epoch pairs are zeroed out first, so the most severe slashes are always preserved. Note that multiple offenses for the same validator in the same epoch are summed and counted as a single validator entry against this limit.
Expand Down
12 changes: 7 additions & 5 deletions yarn-project/slasher/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export const DefaultSlasherConfig: SlasherConfig = {
slashDuplicateAttestationPenalty: BigInt(slasherDefaultEnv.SLASH_DUPLICATE_ATTESTATION_PENALTY),
slashInactivityPenalty: BigInt(slasherDefaultEnv.SLASH_INACTIVITY_PENALTY),
slashProposeInvalidAttestationsPenalty: BigInt(slasherDefaultEnv.SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY),
slashAttestDescendantOfInvalidPenalty: BigInt(slasherDefaultEnv.SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY),
slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty: BigInt(
slasherDefaultEnv.SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY,
),
slashAttestInvalidCheckpointProposalPenalty: BigInt(
slasherDefaultEnv.SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY,
),
Expand Down Expand Up @@ -131,11 +133,11 @@ export const slasherConfigMappings: ConfigMappingsType<SlasherConfig> = {
description: 'Penalty amount for slashing a proposer that proposed invalid attestations (set to 0 to disable).',
...bigintConfigHelper(DefaultSlasherConfig.slashProposeInvalidAttestationsPenalty),
},
slashAttestDescendantOfInvalidPenalty: {
env: 'SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY',
slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty: {
env: 'SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY',
description:
'Penalty amount for slashing a validator that attested to a descendant of an invalid block (set to 0 to disable).',
...bigintConfigHelper(DefaultSlasherConfig.slashAttestDescendantOfInvalidPenalty),
'Penalty amount for slashing a proposer that published a checkpoint building on an invalid checkpoint (set to 0 to disable).',
...bigintConfigHelper(DefaultSlasherConfig.slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty),
},
slashAttestInvalidCheckpointProposalPenalty: {
env: 'SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY',
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/slasher/src/slash_offenses_collector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ describe('SlashOffensesCollector', () => {
{
validator: validator3,
amount: 1500000000000000000n,
offenseType: OffenseType.ATTESTED_DESCENDANT_OF_INVALID,
offenseType: OffenseType.PROPOSED_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS,
epochOrSlot: 175n, // slot 175 >= 110
},
];
Expand Down Expand Up @@ -201,7 +201,7 @@ describe('SlashOffensesCollector', () => {
expect(offensesByValidator[validator3.toString()]).toMatchObject({
validator: validator3,
amount: 1500000000000000000n,
offenseType: OffenseType.ATTESTED_DESCENDANT_OF_INVALID,
offenseType: OffenseType.PROPOSED_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS,
epochOrSlot: 175n,
});
});
Expand Down
11 changes: 9 additions & 2 deletions yarn-project/slasher/src/stores/offenses_store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,22 @@ describe('SlasherOffensesStore', () => {

it('should preserve offense data across store operations', async () => {
const validator = EthAddress.fromString('0x1234567890abcdef1234567890abcdef12345678');
const offense = createOffense(validator, 12345n, OffenseType.ATTESTED_DESCENDANT_OF_INVALID, 54321n);
const offense = createOffense(
validator,
12345n,
OffenseType.PROPOSED_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS,
54321n,
);

await store.addOffense(offense);

const pendingOffenses = await store.getOffenses();
expect(pendingOffenses).toHaveLength(1);
expect(pendingOffenses[0].validator.toString()).toBe(validator.toString());
expect(pendingOffenses[0].amount).toBe(12345n);
expect(pendingOffenses[0].offenseType).toBe(OffenseType.ATTESTED_DESCENDANT_OF_INVALID);
expect(pendingOffenses[0].offenseType).toBe(
OffenseType.PROPOSED_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS,
);
expect(pendingOffenses[0].epochOrSlot).toBe(54321n);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ describe('AttestationsBlockWatcher', () => {
expect(handler).toHaveBeenCalledWith([
{
validator: attestor1,
amount: config.slashAttestDescendantOfInvalidPenalty,
offenseType: OffenseType.ATTESTED_DESCENDANT_OF_INVALID,
amount: config.slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty,
offenseType: OffenseType.PROPOSED_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS,
epochOrSlot: 2n,
},
{
validator: attestor2,
amount: config.slashAttestDescendantOfInvalidPenalty,
offenseType: OffenseType.ATTESTED_DESCENDANT_OF_INVALID,
amount: config.slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty,
offenseType: OffenseType.PROPOSED_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS,
epochOrSlot: 2n,
},
] satisfies WantToSlashArgs[]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type { SlasherConfig } from '../config.js';
import { WANT_TO_SLASH_EVENT, type WantToSlashArgs, type Watcher, type WatcherEmitter } from '../watcher.js';

const AttestationsBlockWatcherConfigKeys = [
'slashAttestDescendantOfInvalidPenalty',
'slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty',
'slashProposeInvalidAttestationsPenalty',
] as const;
const MAX_INVALID_CHECKPOINTS = 100;
Expand Down Expand Up @@ -124,8 +124,8 @@ export class AttestationsBlockWatcher extends (EventEmitter as new () => Watcher
WANT_TO_SLASH_EVENT,
attestors.map(attestor => ({
validator: attestor,
amount: this.config.slashAttestDescendantOfInvalidPenalty,
offenseType: OffenseType.ATTESTED_DESCENDANT_OF_INVALID,
amount: this.config.slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty,
offenseType: OffenseType.PROPOSED_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS,
epochOrSlot: BigInt(SlotNumber(checkpoint.slotNumber)),
})),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class MockAztecNodeAdmin implements AztecNodeAdmin {
secondsBeforeInvalidatingBlockAsCommitteeMember: 0,
secondsBeforeInvalidatingBlockAsNonCommitteeMember: 0,
slashProposeInvalidAttestationsPenalty: 1000n,
slashAttestDescendantOfInvalidPenalty: 1000n,
slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty: 1000n,
slashOffenseExpirationRounds: 4,
slashMaxPayloadSize: 50,
slashUnknownPenalty: 1000n,
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/stdlib/src/interfaces/slasher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface SlasherConfig {
slashDuplicateProposalPenalty: bigint;
slashDuplicateAttestationPenalty: bigint;
slashProposeInvalidAttestationsPenalty: bigint;
slashAttestDescendantOfInvalidPenalty: bigint;
slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty: bigint;
slashAttestInvalidCheckpointProposalPenalty: bigint;
slashUnknownPenalty: bigint;
slashOffenseExpirationRounds: number; // Number of rounds after which pending offenses expire
Expand All @@ -50,7 +50,7 @@ export const SlasherConfigSchema = zodFor<SlasherConfig>()(
slashBroadcastedInvalidCheckpointProposalPenalty: schemas.BigInt.default(0n),
slashDuplicateProposalPenalty: schemas.BigInt,
slashDuplicateAttestationPenalty: schemas.BigInt,
slashAttestDescendantOfInvalidPenalty: schemas.BigInt,
slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty: schemas.BigInt,
slashAttestInvalidCheckpointProposalPenalty: schemas.BigInt,
slashUnknownPenalty: schemas.BigInt,
slashOffenseExpirationRounds: z.number(),
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/stdlib/src/slashing/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ describe('SlashingHelpers', () => {
describe('getPenaltyForOffense', () => {
it('returns the configured penalty for attesting to invalid checkpoint proposal', () => {
const penalty = getPenaltyForOffense(OffenseType.ATTESTED_TO_INVALID_CHECKPOINT_PROPOSAL, {
slashAttestDescendantOfInvalidPenalty: 1n,
slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty: 1n,
slashBroadcastedInvalidBlockPenalty: 2n,
slashBroadcastedInvalidCheckpointProposalPenalty: 11n,
slashDuplicateProposalPenalty: 3n,
Expand All @@ -214,7 +214,7 @@ describe('SlashingHelpers', () => {

it('returns the configured penalty for broadcasting invalid checkpoint proposal', () => {
const penalty = getPenaltyForOffense(OffenseType.BROADCASTED_INVALID_CHECKPOINT_PROPOSAL, {
slashAttestDescendantOfInvalidPenalty: 1n,
slashProposeDescendantOfCheckpointWithInvalidAttestationsPenalty: 1n,
slashBroadcastedInvalidBlockPenalty: 2n,
slashBroadcastedInvalidCheckpointProposalPenalty: 11n,
slashDuplicateProposalPenalty: 3n,
Expand Down
Loading
Loading