@aztec/stdlib 1.2.0 → 1.2.1

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.
@@ -3,6 +3,7 @@ import type { ApiSchemaFor } from '../schemas/schemas.js';
3
3
  import { type ComponentsVersions } from '../versioning/index.js';
4
4
  import { type SequencerConfig } from './configs.js';
5
5
  import { type ProverConfig } from './prover-client.js';
6
+ import { type SlasherConfig } from './slasher.js';
6
7
  /**
7
8
  * Aztec node admin API.
8
9
  */
@@ -11,7 +12,7 @@ export interface AztecNodeAdmin {
11
12
  * Updates the configuration of this node.
12
13
  * @param config - Updated configuration to be merged with the current one.
13
14
  */
14
- setConfig(config: Partial<SequencerConfig & ProverConfig & {
15
+ setConfig(config: Partial<SequencerConfig & ProverConfig & SlasherConfig & {
15
16
  maxTxPoolSize: number;
16
17
  }>): Promise<void>;
17
18
  /**
@@ -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;AAI1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,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;AAE3E;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,GAAG,YAAY,GAAG;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtG;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;OAGG;IACH,mBAA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GG;IACH,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErD;;;;OAIG;IACH,UAAU,CAAC,iBAAiB,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtE,+CAA+C;IAC/C,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3B,gDAAgD;IAChD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,cAAc,CAUhE,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,OAAO,CAAC,kBAAkB,CAAM,EAC1C,KAAK,sBAAe,GACnB,cAAc,CAMhB"}
@@ -3,8 +3,9 @@ import { z } from 'zod';
3
3
  import { getVersioningResponseHandler } from '../versioning/index.js';
4
4
  import { SequencerConfigSchema } from './configs.js';
5
5
  import { ProverConfigSchema } from './prover-client.js';
6
+ import { SlasherConfigSchema } from './slasher.js';
6
7
  export const AztecNodeAdminApiSchema = {
7
- setConfig: z.function().args(SequencerConfigSchema.merge(ProverConfigSchema).partial()).returns(z.void()),
8
+ setConfig: z.function().args(SequencerConfigSchema.merge(ProverConfigSchema).merge(SlasherConfigSchema).partial()).returns(z.void()),
8
9
  flushTxs: z.function().returns(z.void()),
9
10
  startSnapshotUpload: z.function().args(z.string()).returns(z.void()),
10
11
  rollbackTo: z.function().args(z.number()).returns(z.void()),
@@ -1,5 +1,7 @@
1
1
  export * from './allowed_element.js';
2
+ export * from './api_limit.js';
2
3
  export * from './archiver.js';
4
+ export * from './aztec-node.js';
3
5
  export * from './block-builder.js';
4
6
  export * from './configs.js';
5
7
  export * from './epoch-prover.js';
@@ -17,7 +19,7 @@ export * from './proving-job-source.js';
17
19
  export * from './proving-job.js';
18
20
  export * from './server_circuit_prover.js';
19
21
  export * from './service.js';
22
+ export * from './slasher.js';
20
23
  export * from './tx-collector.js';
21
24
  export * from './world_state.js';
22
- export * from './api_limit.js';
23
25
  //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/interfaces/server.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/interfaces/server.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
@@ -1,5 +1,7 @@
1
1
  export * from './allowed_element.js';
2
+ export * from './api_limit.js';
2
3
  export * from './archiver.js';
4
+ export * from './aztec-node.js';
3
5
  export * from './block-builder.js';
4
6
  export * from './configs.js';
5
7
  export * from './epoch-prover.js';
@@ -17,6 +19,6 @@ export * from './proving-job-source.js';
17
19
  export * from './proving-job.js';
18
20
  export * from './server_circuit_prover.js';
19
21
  export * from './service.js';
22
+ export * from './slasher.js';
20
23
  export * from './tx-collector.js';
21
24
  export * from './world_state.js';
22
- export * from './api_limit.js';
@@ -0,0 +1,65 @@
1
+ import type { EthAddress } from '@aztec/foundation/eth-address';
2
+ import { z } from 'zod';
3
+ export interface SlasherConfig {
4
+ slashOverridePayload?: EthAddress;
5
+ slashPayloadTtlSeconds: number;
6
+ slashPruneEnabled: boolean;
7
+ slashPrunePenalty: bigint;
8
+ slashPruneMaxPenalty: bigint;
9
+ slashInvalidBlockEnabled: boolean;
10
+ slashInvalidBlockPenalty: bigint;
11
+ slashInvalidBlockMaxPenalty: bigint;
12
+ slashInactivityEnabled: boolean;
13
+ slashInactivityCreateTargetPercentage: number;
14
+ slashInactivitySignalTargetPercentage: number;
15
+ slashInactivityCreatePenalty: bigint;
16
+ slashInactivityMaxPenalty: bigint;
17
+ slashProposerRoundPollingIntervalSeconds: number;
18
+ }
19
+ export declare const SlasherConfigSchema: z.ZodObject<{
20
+ slashOverridePayload: z.ZodOptional<z.ZodType<EthAddress, any, string>>;
21
+ slashPayloadTtlSeconds: z.ZodNumber;
22
+ slashPruneEnabled: z.ZodBoolean;
23
+ slashPrunePenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
24
+ slashPruneMaxPenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
25
+ slashInvalidBlockEnabled: z.ZodBoolean;
26
+ slashInvalidBlockPenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
27
+ slashInvalidBlockMaxPenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
28
+ slashInactivityEnabled: z.ZodBoolean;
29
+ slashInactivityCreateTargetPercentage: z.ZodNumber;
30
+ slashInactivitySignalTargetPercentage: z.ZodNumber;
31
+ slashInactivityCreatePenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
32
+ slashInactivityMaxPenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
33
+ slashProposerRoundPollingIntervalSeconds: z.ZodNumber;
34
+ }, "strip", z.ZodTypeAny, {
35
+ slashPayloadTtlSeconds: number;
36
+ slashPruneEnabled: boolean;
37
+ slashPrunePenalty: bigint;
38
+ slashPruneMaxPenalty: bigint;
39
+ slashInvalidBlockEnabled: boolean;
40
+ slashInvalidBlockPenalty: bigint;
41
+ slashInvalidBlockMaxPenalty: bigint;
42
+ slashInactivityEnabled: boolean;
43
+ slashInactivityCreateTargetPercentage: number;
44
+ slashInactivitySignalTargetPercentage: number;
45
+ slashInactivityCreatePenalty: bigint;
46
+ slashInactivityMaxPenalty: bigint;
47
+ slashProposerRoundPollingIntervalSeconds: number;
48
+ slashOverridePayload?: EthAddress | undefined;
49
+ }, {
50
+ slashPayloadTtlSeconds: number;
51
+ slashPruneEnabled: boolean;
52
+ slashPrunePenalty: string | number | bigint;
53
+ slashPruneMaxPenalty: string | number | bigint;
54
+ slashInvalidBlockEnabled: boolean;
55
+ slashInvalidBlockPenalty: string | number | bigint;
56
+ slashInvalidBlockMaxPenalty: string | number | bigint;
57
+ slashInactivityEnabled: boolean;
58
+ slashInactivityCreateTargetPercentage: number;
59
+ slashInactivitySignalTargetPercentage: number;
60
+ slashInactivityCreatePenalty: string | number | bigint;
61
+ slashInactivityMaxPenalty: string | number | bigint;
62
+ slashProposerRoundPollingIntervalSeconds: number;
63
+ slashOverridePayload?: string | undefined;
64
+ }>;
65
+ //# sourceMappingURL=slasher.d.ts.map
@@ -0,0 +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,WAAW,aAAa;IAC5B,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,wBAAwB,EAAE,OAAO,CAAC;IAClC,wBAAwB,EAAE,MAAM,CAAC;IACjC,2BAA2B,EAAE,MAAM,CAAC;IACpC,sBAAsB,EAAE,OAAO,CAAC;IAChC,qCAAqC,EAAE,MAAM,CAAC;IAC9C,qCAAqC,EAAE,MAAM,CAAC;IAC9C,4BAA4B,EAAE,MAAM,CAAC;IACrC,yBAAyB,EAAE,MAAM,CAAC;IAClC,wCAAwC,EAAE,MAAM,CAAC;CAClD;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeE,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { schemas } from '@aztec/foundation/schemas';
2
+ import { z } from 'zod';
3
+ export const SlasherConfigSchema = z.object({
4
+ slashOverridePayload: schemas.EthAddress.optional(),
5
+ slashPayloadTtlSeconds: z.number(),
6
+ slashPruneEnabled: z.boolean(),
7
+ slashPrunePenalty: schemas.BigInt,
8
+ slashPruneMaxPenalty: schemas.BigInt,
9
+ slashInvalidBlockEnabled: z.boolean(),
10
+ slashInvalidBlockPenalty: schemas.BigInt,
11
+ slashInvalidBlockMaxPenalty: schemas.BigInt,
12
+ slashInactivityEnabled: z.boolean(),
13
+ slashInactivityCreateTargetPercentage: z.number(),
14
+ slashInactivitySignalTargetPercentage: z.number(),
15
+ slashInactivityCreatePenalty: schemas.BigInt,
16
+ slashInactivityMaxPenalty: schemas.BigInt,
17
+ slashProposerRoundPollingIntervalSeconds: z.number()
18
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/stdlib",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "inherits": [
6
6
  "../package.common.json",
@@ -67,12 +67,12 @@
67
67
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
68
68
  },
69
69
  "dependencies": {
70
- "@aztec/bb.js": "1.2.0",
71
- "@aztec/blob-lib": "1.2.0",
72
- "@aztec/constants": "1.2.0",
73
- "@aztec/ethereum": "1.2.0",
74
- "@aztec/foundation": "1.2.0",
75
- "@aztec/noir-noirc_abi": "1.2.0",
70
+ "@aztec/bb.js": "1.2.1",
71
+ "@aztec/blob-lib": "1.2.1",
72
+ "@aztec/constants": "1.2.1",
73
+ "@aztec/ethereum": "1.2.1",
74
+ "@aztec/foundation": "1.2.1",
75
+ "@aztec/noir-noirc_abi": "1.2.1",
76
76
  "@google-cloud/storage": "^7.15.0",
77
77
  "axios": "^1.9.0",
78
78
  "json-stringify-deterministic": "1.0.12",
@@ -6,6 +6,7 @@ import type { ApiSchemaFor } from '../schemas/schemas.js';
6
6
  import { type ComponentsVersions, getVersioningResponseHandler } from '../versioning/index.js';
7
7
  import { type SequencerConfig, SequencerConfigSchema } from './configs.js';
8
8
  import { type ProverConfig, ProverConfigSchema } from './prover-client.js';
9
+ import { type SlasherConfig, SlasherConfigSchema } from './slasher.js';
9
10
 
10
11
  /**
11
12
  * Aztec node admin API.
@@ -15,7 +16,7 @@ export interface AztecNodeAdmin {
15
16
  * Updates the configuration of this node.
16
17
  * @param config - Updated configuration to be merged with the current one.
17
18
  */
18
- setConfig(config: Partial<SequencerConfig & ProverConfig & { maxTxPoolSize: number }>): Promise<void>;
19
+ setConfig(config: Partial<SequencerConfig & ProverConfig & SlasherConfig & { maxTxPoolSize: number }>): Promise<void>;
19
20
 
20
21
  /**
21
22
  * Forces the next block to be built bypassing all time and pending checks.
@@ -44,7 +45,10 @@ export interface AztecNodeAdmin {
44
45
  }
45
46
 
46
47
  export const AztecNodeAdminApiSchema: ApiSchemaFor<AztecNodeAdmin> = {
47
- setConfig: z.function().args(SequencerConfigSchema.merge(ProverConfigSchema).partial()).returns(z.void()),
48
+ setConfig: z
49
+ .function()
50
+ .args(SequencerConfigSchema.merge(ProverConfigSchema).merge(SlasherConfigSchema).partial())
51
+ .returns(z.void()),
48
52
  flushTxs: z.function().returns(z.void()),
49
53
  startSnapshotUpload: z.function().args(z.string()).returns(z.void()),
50
54
  rollbackTo: z.function().args(z.number()).returns(z.void()),
@@ -1,5 +1,7 @@
1
1
  export * from './allowed_element.js';
2
+ export * from './api_limit.js';
2
3
  export * from './archiver.js';
4
+ export * from './aztec-node.js';
3
5
  export * from './block-builder.js';
4
6
  export * from './configs.js';
5
7
  export * from './epoch-prover.js';
@@ -17,6 +19,6 @@ export * from './proving-job-source.js';
17
19
  export * from './proving-job.js';
18
20
  export * from './server_circuit_prover.js';
19
21
  export * from './service.js';
22
+ export * from './slasher.js';
20
23
  export * from './tx-collector.js';
21
24
  export * from './world_state.js';
22
- export * from './api_limit.js';
@@ -0,0 +1,38 @@
1
+ import type { EthAddress } from '@aztec/foundation/eth-address';
2
+ import { type ZodFor, schemas } from '@aztec/foundation/schemas';
3
+
4
+ import { z } from 'zod';
5
+
6
+ export interface SlasherConfig {
7
+ slashOverridePayload?: EthAddress;
8
+ slashPayloadTtlSeconds: number; // TTL for payloads, in seconds
9
+ slashPruneEnabled: boolean;
10
+ slashPrunePenalty: bigint;
11
+ slashPruneMaxPenalty: bigint;
12
+ slashInvalidBlockEnabled: boolean;
13
+ slashInvalidBlockPenalty: bigint;
14
+ slashInvalidBlockMaxPenalty: bigint;
15
+ slashInactivityEnabled: boolean;
16
+ slashInactivityCreateTargetPercentage: number; // 0-1, 0.9 means 90%. Must be greater than 0
17
+ slashInactivitySignalTargetPercentage: number; // 0-1, 0.6 means 60%. Must be greater than 0
18
+ slashInactivityCreatePenalty: bigint;
19
+ slashInactivityMaxPenalty: bigint;
20
+ slashProposerRoundPollingIntervalSeconds: number;
21
+ }
22
+
23
+ export const SlasherConfigSchema = z.object({
24
+ slashOverridePayload: schemas.EthAddress.optional(),
25
+ slashPayloadTtlSeconds: z.number(),
26
+ slashPruneEnabled: z.boolean(),
27
+ slashPrunePenalty: schemas.BigInt,
28
+ slashPruneMaxPenalty: schemas.BigInt,
29
+ slashInvalidBlockEnabled: z.boolean(),
30
+ slashInvalidBlockPenalty: schemas.BigInt,
31
+ slashInvalidBlockMaxPenalty: schemas.BigInt,
32
+ slashInactivityEnabled: z.boolean(),
33
+ slashInactivityCreateTargetPercentage: z.number(),
34
+ slashInactivitySignalTargetPercentage: z.number(),
35
+ slashInactivityCreatePenalty: schemas.BigInt,
36
+ slashInactivityMaxPenalty: schemas.BigInt,
37
+ slashProposerRoundPollingIntervalSeconds: z.number(),
38
+ }) satisfies ZodFor<SlasherConfig>;