@aztec/slasher 2.0.0-nightly.20250903 → 3.0.0-canary.a9708bd

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAQnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B,eAAO,MAAM,oBAAoB,EAAE,aAkBlC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,kBAAkB,CAAC,aAAa,CAwGnE,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAQnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B,eAAO,MAAM,oBAAoB,EAAE,aAmBlC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,kBAAkB,CAAC,aAAa,CAoHnE,CAAC"}
package/dest/config.js CHANGED
@@ -10,6 +10,7 @@ export const DefaultSlasherConfig = {
10
10
  slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
11
11
  slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
12
12
  slashInactivityTargetPercentage: 0.9,
13
+ slashInactivityConsecutiveEpochThreshold: 1,
13
14
  slashBroadcastedInvalidBlockPenalty: DefaultL1ContractsConfig.slashAmountSmall,
14
15
  slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
15
16
  slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountSmall,
@@ -73,6 +74,18 @@ export const slasherConfigMappings = {
73
74
  }
74
75
  })
75
76
  },
77
+ slashInactivityConsecutiveEpochThreshold: {
78
+ env: 'SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD',
79
+ description: 'Number of consecutive epochs a validator must be inactive before slashing (minimum 1).',
80
+ ...numberConfigHelper(DefaultSlasherConfig.slashInactivityConsecutiveEpochThreshold),
81
+ parseEnv: (val)=>{
82
+ const parsed = parseInt(val, 10);
83
+ if (parsed < 1) {
84
+ throw new RangeError(`SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD must be at least 1 (got ${parsed})`);
85
+ }
86
+ return parsed;
87
+ }
88
+ },
76
89
  slashInactivityPenalty: {
77
90
  env: 'SLASH_INACTIVITY_PENALTY',
78
91
  description: 'Penalty amount for slashing an inactive validator (set to 0 to disable).',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/slasher",
3
- "version": "2.0.0-nightly.20250903",
3
+ "version": "3.0.0-canary.a9708bd",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/index.js",
@@ -54,20 +54,20 @@
54
54
  ]
55
55
  },
56
56
  "dependencies": {
57
- "@aztec/epoch-cache": "2.0.0-nightly.20250903",
58
- "@aztec/ethereum": "2.0.0-nightly.20250903",
59
- "@aztec/foundation": "2.0.0-nightly.20250903",
60
- "@aztec/kv-store": "2.0.0-nightly.20250903",
61
- "@aztec/l1-artifacts": "2.0.0-nightly.20250903",
62
- "@aztec/stdlib": "2.0.0-nightly.20250903",
63
- "@aztec/telemetry-client": "2.0.0-nightly.20250903",
57
+ "@aztec/epoch-cache": "3.0.0-canary.a9708bd",
58
+ "@aztec/ethereum": "3.0.0-canary.a9708bd",
59
+ "@aztec/foundation": "3.0.0-canary.a9708bd",
60
+ "@aztec/kv-store": "3.0.0-canary.a9708bd",
61
+ "@aztec/l1-artifacts": "3.0.0-canary.a9708bd",
62
+ "@aztec/stdlib": "3.0.0-canary.a9708bd",
63
+ "@aztec/telemetry-client": "3.0.0-canary.a9708bd",
64
64
  "source-map-support": "^0.5.21",
65
65
  "tslib": "^2.4.0",
66
66
  "viem": "2.23.7",
67
67
  "zod": "^3.23.8"
68
68
  },
69
69
  "devDependencies": {
70
- "@aztec/aztec.js": "2.0.0-nightly.20250903",
70
+ "@aztec/aztec.js": "3.0.0-canary.a9708bd",
71
71
  "@jest/globals": "^30.0.0",
72
72
  "@types/jest": "^30.0.0",
73
73
  "@types/node": "^22.15.17",
package/src/config.ts CHANGED
@@ -20,6 +20,7 @@ export const DefaultSlasherConfig: SlasherConfig = {
20
20
  slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
21
21
  slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
22
22
  slashInactivityTargetPercentage: 0.9,
23
+ slashInactivityConsecutiveEpochThreshold: 1, // Default to 1 for backward compatibility
23
24
  slashBroadcastedInvalidBlockPenalty: DefaultL1ContractsConfig.slashAmountSmall,
24
25
  slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
25
26
  slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountSmall,
@@ -95,6 +96,18 @@ export const slasherConfigMappings: ConfigMappingsType<SlasherConfig> = {
95
96
  }
96
97
  }),
97
98
  },
99
+ slashInactivityConsecutiveEpochThreshold: {
100
+ env: 'SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD',
101
+ description: 'Number of consecutive epochs a validator must be inactive before slashing (minimum 1).',
102
+ ...numberConfigHelper(DefaultSlasherConfig.slashInactivityConsecutiveEpochThreshold),
103
+ parseEnv: (val: string) => {
104
+ const parsed = parseInt(val, 10);
105
+ if (parsed < 1) {
106
+ throw new RangeError(`SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD must be at least 1 (got ${parsed})`);
107
+ }
108
+ return parsed;
109
+ },
110
+ },
98
111
  slashInactivityPenalty: {
99
112
  env: 'SLASH_INACTIVITY_PENALTY',
100
113
  description: 'Penalty amount for slashing an inactive validator (set to 0 to disable).',