@aztec/stdlib 2.0.0-nightly.20250831 → 2.0.0-nightly.20250902
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.
- package/dest/interfaces/aztec-node-admin.d.ts +3 -0
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/slasher.d.ts +4 -0
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +1 -0
- package/dest/slashing/helpers.d.ts +1 -1
- package/dest/slashing/helpers.d.ts.map +1 -1
- package/dest/slashing/helpers.js +6 -5
- package/package.json +8 -8
- package/src/interfaces/slasher.ts +2 -0
- package/src/slashing/helpers.ts +7 -5
|
@@ -108,6 +108,7 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<z.objectUtil.extend
|
|
|
108
108
|
slashValidatorsAlways: z.ZodArray<z.ZodType<import("@aztec/foundation/schemas").EthAddress, any, string>, "many">;
|
|
109
109
|
slashValidatorsNever: z.ZodArray<z.ZodType<import("@aztec/foundation/schemas").EthAddress, any, string>, "many">;
|
|
110
110
|
slashPrunePenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
111
|
+
slashDataWithholdingPenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
111
112
|
slashInactivityTargetPercentage: z.ZodNumber;
|
|
112
113
|
slashInactivityPenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
113
114
|
slashProposeInvalidAttestationsPenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
@@ -128,6 +129,7 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<z.objectUtil.extend
|
|
|
128
129
|
slashValidatorsAlways: import("@aztec/foundation/schemas").EthAddress[];
|
|
129
130
|
slashValidatorsNever: import("@aztec/foundation/schemas").EthAddress[];
|
|
130
131
|
slashPrunePenalty: bigint;
|
|
132
|
+
slashDataWithholdingPenalty: bigint;
|
|
131
133
|
slashInactivityTargetPercentage: number;
|
|
132
134
|
slashInactivityPenalty: bigint;
|
|
133
135
|
slashProposeInvalidAttestationsPenalty: bigint;
|
|
@@ -183,6 +185,7 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<z.objectUtil.extend
|
|
|
183
185
|
slashValidatorsAlways: string[];
|
|
184
186
|
slashValidatorsNever: string[];
|
|
185
187
|
slashPrunePenalty: string | number | bigint;
|
|
188
|
+
slashDataWithholdingPenalty: string | number | bigint;
|
|
186
189
|
slashInactivityTargetPercentage: number;
|
|
187
190
|
slashInactivityPenalty: string | number | bigint;
|
|
188
191
|
slashProposeInvalidAttestationsPenalty: string | number | bigint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec-node-admin.d.ts","sourceRoot":"","sources":["../../src/interfaces/aztec-node-admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAE1F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,KAAK,OAAO,EAAiB,KAAK,iBAAiB,EAA2B,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,KAAK,kBAAkB,EAAgC,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,cAAc,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC,oBAAo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;;;;;;;;;;;;;;;EAEU,CAAC;AAElD,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,cAAc,CAYhE,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,OAAO,CAAC,kBAAkB,CAAM,EAC1C,KAAK,sBAAe,GACnB,cAAc,CAMhB"}
|
|
@@ -10,6 +10,7 @@ export interface SlasherConfig {
|
|
|
10
10
|
slashValidatorsNever: EthAddress[];
|
|
11
11
|
slashInactivityTargetPercentage: number;
|
|
12
12
|
slashPrunePenalty: bigint;
|
|
13
|
+
slashDataWithholdingPenalty: bigint;
|
|
13
14
|
slashInactivityPenalty: bigint;
|
|
14
15
|
slashBroadcastedInvalidBlockPenalty: bigint;
|
|
15
16
|
slashProposeInvalidAttestationsPenalty: bigint;
|
|
@@ -26,6 +27,7 @@ export declare const SlasherConfigSchema: z.ZodObject<{
|
|
|
26
27
|
slashValidatorsAlways: z.ZodArray<z.ZodType<EthAddress, any, string>, "many">;
|
|
27
28
|
slashValidatorsNever: z.ZodArray<z.ZodType<EthAddress, any, string>, "many">;
|
|
28
29
|
slashPrunePenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
30
|
+
slashDataWithholdingPenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
29
31
|
slashInactivityTargetPercentage: z.ZodNumber;
|
|
30
32
|
slashInactivityPenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
31
33
|
slashProposeInvalidAttestationsPenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
@@ -42,6 +44,7 @@ export declare const SlasherConfigSchema: z.ZodObject<{
|
|
|
42
44
|
slashValidatorsAlways: EthAddress[];
|
|
43
45
|
slashValidatorsNever: EthAddress[];
|
|
44
46
|
slashPrunePenalty: bigint;
|
|
47
|
+
slashDataWithholdingPenalty: bigint;
|
|
45
48
|
slashInactivityTargetPercentage: number;
|
|
46
49
|
slashInactivityPenalty: bigint;
|
|
47
50
|
slashProposeInvalidAttestationsPenalty: bigint;
|
|
@@ -59,6 +62,7 @@ export declare const SlasherConfigSchema: z.ZodObject<{
|
|
|
59
62
|
slashValidatorsAlways: string[];
|
|
60
63
|
slashValidatorsNever: string[];
|
|
61
64
|
slashPrunePenalty: string | number | bigint;
|
|
65
|
+
slashDataWithholdingPenalty: string | number | bigint;
|
|
62
66
|
slashInactivityTargetPercentage: number;
|
|
63
67
|
slashInactivityPenalty: string | number | bigint;
|
|
64
68
|
slashProposeInvalidAttestationsPenalty: string | number | bigint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slasher.d.ts","sourceRoot":"","sources":["../../src/interfaces/slasher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC5B,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,yBAAyB,EAAE,MAAM,CAAC;IAClC,yBAAyB,EAAE,MAAM,CAAC;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qBAAqB,EAAE,UAAU,EAAE,CAAC;IACpC,oBAAoB,EAAE,UAAU,EAAE,CAAC;IACnC,+BAA+B,EAAE,MAAM,CAAC;IACxC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,mCAAmC,EAAE,MAAM,CAAC;IAC5C,sCAAsC,EAAE,MAAM,CAAC;IAC/C,qCAAqC,EAAE,MAAM,CAAC;IAC9C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,4BAA4B,EAAE,MAAM,CAAC;IACrC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"slasher.d.ts","sourceRoot":"","sources":["../../src/interfaces/slasher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC5B,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,yBAAyB,EAAE,MAAM,CAAC;IAClC,yBAAyB,EAAE,MAAM,CAAC;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qBAAqB,EAAE,UAAU,EAAE,CAAC;IACpC,oBAAoB,EAAE,UAAU,EAAE,CAAC;IACnC,+BAA+B,EAAE,MAAM,CAAC;IACxC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,2BAA2B,EAAE,MAAM,CAAC;IACpC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,mCAAmC,EAAE,MAAM,CAAC;IAC5C,sCAAsC,EAAE,MAAM,CAAC;IAC/C,qCAAqC,EAAE,MAAM,CAAC;IAC9C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,4BAA4B,EAAE,MAAM,CAAC;IACrC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBE,CAAC"}
|
|
@@ -7,6 +7,7 @@ export const SlasherConfigSchema = z.object({
|
|
|
7
7
|
slashValidatorsAlways: z.array(schemas.EthAddress),
|
|
8
8
|
slashValidatorsNever: z.array(schemas.EthAddress),
|
|
9
9
|
slashPrunePenalty: schemas.BigInt,
|
|
10
|
+
slashDataWithholdingPenalty: schemas.BigInt,
|
|
10
11
|
slashInactivityTargetPercentage: z.number(),
|
|
11
12
|
slashInactivityPenalty: schemas.BigInt,
|
|
12
13
|
slashProposeInvalidAttestationsPenalty: schemas.BigInt,
|
|
@@ -19,7 +19,7 @@ export declare function getEpochsForRound(round: bigint, constants: {
|
|
|
19
19
|
epochDuration: number;
|
|
20
20
|
}): bigint[];
|
|
21
21
|
/** Reads the configured penalty for a given offense type from a slasher config struct */
|
|
22
|
-
export declare function getPenaltyForOffense(offense: OffenseType, config: Pick<SlasherConfig, 'slashAttestDescendantOfInvalidPenalty' | 'slashBroadcastedInvalidBlockPenalty' | 'slashPrunePenalty' | 'slashUnknownPenalty' | 'slashInactivityPenalty' | 'slashProposeInvalidAttestationsPenalty'>): bigint;
|
|
22
|
+
export declare function getPenaltyForOffense(offense: OffenseType, config: Pick<SlasherConfig, 'slashAttestDescendantOfInvalidPenalty' | 'slashBroadcastedInvalidBlockPenalty' | 'slashPrunePenalty' | 'slashDataWithholdingPenalty' | 'slashUnknownPenalty' | 'slashInactivityPenalty' | 'slashProposeInvalidAttestationsPenalty'>): bigint;
|
|
23
23
|
/** Returns whether the `epochOrSlot` field for an offense references an epoch or a slot */
|
|
24
24
|
export declare function getTimeUnitForOffense(offense: OffenseType): 'epoch' | 'slot';
|
|
25
25
|
/** Returns the slot for a given offense. If the offense references an epoch, returns the first slot of the epoch. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/slashing/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAwC,MAAM,2BAA2B,CAAC;AACzG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,KAAK,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CA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/slashing/helpers.js
CHANGED
|
@@ -32,8 +32,9 @@ import { OffenseType } from './types.js';
|
|
|
32
32
|
/** Reads the configured penalty for a given offense type from a slasher config struct */ export function getPenaltyForOffense(offense, config) {
|
|
33
33
|
switch(offense){
|
|
34
34
|
case OffenseType.VALID_EPOCH_PRUNED:
|
|
35
|
-
case OffenseType.DATA_WITHHOLDING:
|
|
36
35
|
return config.slashPrunePenalty;
|
|
36
|
+
case OffenseType.DATA_WITHHOLDING:
|
|
37
|
+
return config.slashDataWithholdingPenalty;
|
|
37
38
|
case OffenseType.INACTIVITY:
|
|
38
39
|
return config.slashInactivityPenalty;
|
|
39
40
|
case OffenseType.PROPOSED_INSUFFICIENT_ATTESTATIONS:
|
|
@@ -47,8 +48,8 @@ import { OffenseType } from './types.js';
|
|
|
47
48
|
return config.slashUnknownPenalty;
|
|
48
49
|
default:
|
|
49
50
|
{
|
|
50
|
-
const
|
|
51
|
-
throw new Error(`Unknown offense type: ${
|
|
51
|
+
const _exhaustiveCheck = offense;
|
|
52
|
+
throw new Error(`Unknown offense type: ${_exhaustiveCheck}`);
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
}
|
|
@@ -66,8 +67,8 @@ import { OffenseType } from './types.js';
|
|
|
66
67
|
return 'epoch';
|
|
67
68
|
default:
|
|
68
69
|
{
|
|
69
|
-
const
|
|
70
|
-
throw new Error(`Unknown offense type: ${
|
|
70
|
+
const _exhaustiveCheck = offense;
|
|
71
|
+
throw new Error(`Unknown offense type: ${_exhaustiveCheck}`);
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "2.0.0-nightly.
|
|
3
|
+
"version": "2.0.0-nightly.20250902",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@aztec/bb.js": "2.0.0-nightly.
|
|
73
|
-
"@aztec/blob-lib": "2.0.0-nightly.
|
|
74
|
-
"@aztec/constants": "2.0.0-nightly.
|
|
75
|
-
"@aztec/ethereum": "2.0.0-nightly.
|
|
76
|
-
"@aztec/foundation": "2.0.0-nightly.
|
|
77
|
-
"@aztec/l1-artifacts": "2.0.0-nightly.
|
|
78
|
-
"@aztec/noir-noirc_abi": "2.0.0-nightly.
|
|
72
|
+
"@aztec/bb.js": "2.0.0-nightly.20250902",
|
|
73
|
+
"@aztec/blob-lib": "2.0.0-nightly.20250902",
|
|
74
|
+
"@aztec/constants": "2.0.0-nightly.20250902",
|
|
75
|
+
"@aztec/ethereum": "2.0.0-nightly.20250902",
|
|
76
|
+
"@aztec/foundation": "2.0.0-nightly.20250902",
|
|
77
|
+
"@aztec/l1-artifacts": "2.0.0-nightly.20250902",
|
|
78
|
+
"@aztec/noir-noirc_abi": "2.0.0-nightly.20250902",
|
|
79
79
|
"@google-cloud/storage": "^7.15.0",
|
|
80
80
|
"axios": "^1.9.0",
|
|
81
81
|
"json-stringify-deterministic": "1.0.12",
|
|
@@ -14,6 +14,7 @@ export interface SlasherConfig {
|
|
|
14
14
|
slashValidatorsNever: EthAddress[]; // Array of validator addresses
|
|
15
15
|
slashInactivityTargetPercentage: number; // 0-1, 0.9 means 90%. Must be greater than 0
|
|
16
16
|
slashPrunePenalty: bigint;
|
|
17
|
+
slashDataWithholdingPenalty: bigint;
|
|
17
18
|
slashInactivityPenalty: bigint;
|
|
18
19
|
slashBroadcastedInvalidBlockPenalty: bigint;
|
|
19
20
|
slashProposeInvalidAttestationsPenalty: bigint;
|
|
@@ -31,6 +32,7 @@ export const SlasherConfigSchema = z.object({
|
|
|
31
32
|
slashValidatorsAlways: z.array(schemas.EthAddress),
|
|
32
33
|
slashValidatorsNever: z.array(schemas.EthAddress),
|
|
33
34
|
slashPrunePenalty: schemas.BigInt,
|
|
35
|
+
slashDataWithholdingPenalty: schemas.BigInt,
|
|
34
36
|
slashInactivityTargetPercentage: z.number(),
|
|
35
37
|
slashInactivityPenalty: schemas.BigInt,
|
|
36
38
|
slashProposeInvalidAttestationsPenalty: schemas.BigInt,
|
package/src/slashing/helpers.ts
CHANGED
|
@@ -48,6 +48,7 @@ export function getPenaltyForOffense(
|
|
|
48
48
|
| 'slashAttestDescendantOfInvalidPenalty'
|
|
49
49
|
| 'slashBroadcastedInvalidBlockPenalty'
|
|
50
50
|
| 'slashPrunePenalty'
|
|
51
|
+
| 'slashDataWithholdingPenalty'
|
|
51
52
|
| 'slashUnknownPenalty'
|
|
52
53
|
| 'slashInactivityPenalty'
|
|
53
54
|
| 'slashProposeInvalidAttestationsPenalty'
|
|
@@ -55,8 +56,9 @@ export function getPenaltyForOffense(
|
|
|
55
56
|
) {
|
|
56
57
|
switch (offense) {
|
|
57
58
|
case OffenseType.VALID_EPOCH_PRUNED:
|
|
58
|
-
case OffenseType.DATA_WITHHOLDING:
|
|
59
59
|
return config.slashPrunePenalty;
|
|
60
|
+
case OffenseType.DATA_WITHHOLDING:
|
|
61
|
+
return config.slashDataWithholdingPenalty;
|
|
60
62
|
case OffenseType.INACTIVITY:
|
|
61
63
|
return config.slashInactivityPenalty;
|
|
62
64
|
case OffenseType.PROPOSED_INSUFFICIENT_ATTESTATIONS:
|
|
@@ -69,8 +71,8 @@ export function getPenaltyForOffense(
|
|
|
69
71
|
case OffenseType.UNKNOWN:
|
|
70
72
|
return config.slashUnknownPenalty;
|
|
71
73
|
default: {
|
|
72
|
-
const
|
|
73
|
-
throw new Error(`Unknown offense type: ${
|
|
74
|
+
const _exhaustiveCheck: never = offense;
|
|
75
|
+
throw new Error(`Unknown offense type: ${_exhaustiveCheck}`);
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
}
|
|
@@ -89,8 +91,8 @@ export function getTimeUnitForOffense(offense: OffenseType): 'epoch' | 'slot' {
|
|
|
89
91
|
case OffenseType.VALID_EPOCH_PRUNED:
|
|
90
92
|
return 'epoch';
|
|
91
93
|
default: {
|
|
92
|
-
const
|
|
93
|
-
throw new Error(`Unknown offense type: ${
|
|
94
|
+
const _exhaustiveCheck: never = offense;
|
|
95
|
+
throw new Error(`Unknown offense type: ${_exhaustiveCheck}`);
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
98
|
}
|