@aztec/stdlib 3.0.0-nightly.20250910 → 3.0.0-nightly.20250911
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/block/index.d.ts +2 -0
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +2 -0
- package/dest/block/l2_block.d.ts +2 -8
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +5 -3
- package/dest/block/l2_block_info.d.ts +41 -0
- package/dest/block/l2_block_info.d.ts.map +1 -0
- package/dest/block/l2_block_info.js +40 -0
- package/dest/block/l2_block_source.d.ts +1 -428
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +0 -28
- package/dest/block/published_l2_block.d.ts +25 -1
- package/dest/block/published_l2_block.d.ts.map +1 -1
- package/dest/block/published_l2_block.js +20 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +2 -1
- package/dest/block/validate_block_result.d.ts +222 -0
- package/dest/block/validate_block_result.d.ts.map +1 -0
- package/dest/block/validate_block_result.js +83 -0
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +2 -1
- package/dest/p2p/block_attestation.d.ts +1 -0
- package/dest/p2p/block_attestation.d.ts.map +1 -1
- package/dest/p2p/block_attestation.js +3 -0
- package/dest/p2p/block_proposal.d.ts +2 -2
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +3 -1
- package/dest/p2p/consensus_payload.d.ts +1 -0
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +6 -4
- package/dest/tests/mocks.d.ts +1 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +5 -8
- package/dest/tx/content_commitment.d.ts +1 -0
- package/dest/tx/content_commitment.d.ts.map +1 -1
- package/dest/tx/content_commitment.js +3 -0
- package/dest/tx/partial_state_reference.d.ts +1 -0
- package/dest/tx/partial_state_reference.d.ts.map +1 -1
- package/dest/tx/partial_state_reference.js +3 -0
- package/dest/tx/proposed_block_header.d.ts +1 -0
- package/dest/tx/proposed_block_header.d.ts.map +1 -1
- package/dest/tx/proposed_block_header.js +3 -0
- package/dest/tx/state_reference.d.ts +1 -0
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/state_reference.js +3 -0
- package/dest/update-checker/update-checker.d.ts +1 -1
- package/dest/update-checker/update-checker.d.ts.map +1 -1
- package/dest/update-checker/update-checker.js +1 -1
- package/package.json +8 -8
- package/src/block/index.ts +2 -0
- package/src/block/l2_block.ts +6 -11
- package/src/block/l2_block_info.ts +63 -0
- package/src/block/l2_block_source.ts +1 -51
- package/src/block/published_l2_block.ts +38 -5
- package/src/block/test/l2_tips_store_test_suite.ts +7 -6
- package/src/block/validate_block_result.ts +122 -0
- package/src/interfaces/archiver.ts +2 -1
- package/src/p2p/block_attestation.ts +4 -0
- package/src/p2p/block_proposal.ts +5 -3
- package/src/p2p/consensus_payload.ts +7 -4
- package/src/tests/mocks.ts +5 -5
- package/src/tx/content_commitment.ts +4 -0
- package/src/tx/partial_state_reference.ts +8 -0
- package/src/tx/proposed_block_header.ts +13 -0
- package/src/tx/state_reference.ts +4 -0
- package/src/update-checker/update-checker.ts +1 -1
package/dest/block/index.d.ts
CHANGED
|
@@ -7,4 +7,6 @@ export * from './l2_block_source.js';
|
|
|
7
7
|
export * from './block_hash.js';
|
|
8
8
|
export * from './published_l2_block.js';
|
|
9
9
|
export * from './proposal/index.js';
|
|
10
|
+
export * from './validate_block_result.js';
|
|
11
|
+
export * from './l2_block_info.js';
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/block/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/block/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC"}
|
package/dest/block/index.js
CHANGED
package/dest/block/l2_block.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { z } from 'zod';
|
|
|
4
4
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
5
5
|
import { BlockHeader } from '../tx/block_header.js';
|
|
6
6
|
import { Body } from './body.js';
|
|
7
|
+
import type { L2BlockInfo } from './l2_block_info.js';
|
|
7
8
|
/**
|
|
8
9
|
* The data that makes up the rollup proof, with encoder decoder functions.
|
|
9
10
|
*/
|
|
@@ -114,14 +115,7 @@ export declare class L2Block {
|
|
|
114
115
|
blockNumber: number;
|
|
115
116
|
blockTimestamp: number;
|
|
116
117
|
};
|
|
117
|
-
toBlockInfo():
|
|
118
|
+
toBlockInfo(): L2BlockInfo;
|
|
118
119
|
equals(other: L2Block): boolean;
|
|
119
120
|
}
|
|
120
|
-
export type BlockInfo = {
|
|
121
|
-
blockHash?: string;
|
|
122
|
-
archive: string;
|
|
123
|
-
blockNumber: number;
|
|
124
|
-
slotNumber: number;
|
|
125
|
-
txCount: number;
|
|
126
|
-
};
|
|
127
121
|
//# sourceMappingURL=l2_block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l2_block.d.ts","sourceRoot":"","sources":["../../src/block/l2_block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAG9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"l2_block.d.ts","sourceRoot":"","sources":["../../src/block/l2_block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAG9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,qBAAa,OAAO;IAEhB,2DAA2D;IACpD,OAAO,EAAE,sBAAsB;IACtC,uBAAuB;IAChB,MAAM,EAAE,WAAW;IAC1B,qBAAqB;IACd,IAAI,EAAE,IAAI;IACjB,OAAO,CAAC,SAAS;;IANjB,2DAA2D;IACpD,OAAO,EAAE,sBAAsB;IACtC,uBAAuB;IAChB,MAAM,EAAE,WAAW;IAC1B,qBAAqB;IACd,IAAI,EAAE,IAAI,EACT,SAAS,GAAE,EAAE,GAAG,SAAqB;IAG/C,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAQhB;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY;IAS5C;;;OAGG;IACH,QAAQ;IAIR;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIvC;;;OAGG;IACH,QAAQ,IAAI,MAAM;IAIlB;;;;;;;;OAQG;WACU,MAAM,CACjB,UAAU,EAAE,MAAM,EAClB,WAAW,SAAI,EACf,mBAAmB,SAAI,EACvB,oBAAoB,SAAI,EACxB,MAAM,GAAE,EAAE,GAAG,SAAqB,EAClC,UAAU,GAAE,MAAM,GAAG,SAAqB,EAC1C,UAAU,GAAE,MAAM,GAAG,SAAqB,GACzC,OAAO,CAAC,OAAO,CAAC;IAUnB;;;OAGG;IACH,MAAM,CAAC,KAAK,IAAI,OAAO;IAIvB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;;OAGG;IACU,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC;IAOhC;;;OAGG;IACH,QAAQ;;;;;;;;;IAuBR,WAAW,IAAI,WAAW;IAY1B,MAAM,CAAC,KAAK,EAAE,OAAO;CAGtB"}
|
package/dest/block/l2_block.js
CHANGED
|
@@ -109,11 +109,13 @@ import { makeAppendOnlyTreeSnapshot, makeHeader } from './l2_block_code_to_purge
|
|
|
109
109
|
}
|
|
110
110
|
toBlockInfo() {
|
|
111
111
|
return {
|
|
112
|
-
blockHash: this.blockHash
|
|
113
|
-
archive: this.archive.root
|
|
112
|
+
blockHash: this.blockHash,
|
|
113
|
+
archive: this.archive.root,
|
|
114
|
+
lastArchive: this.header.lastArchive.root,
|
|
114
115
|
blockNumber: this.number,
|
|
115
116
|
slotNumber: Number(this.header.getSlot()),
|
|
116
|
-
txCount: this.body.txEffects.length
|
|
117
|
+
txCount: this.body.txEffects.length,
|
|
118
|
+
timestamp: this.header.globalVariables.timestamp
|
|
117
119
|
};
|
|
118
120
|
}
|
|
119
121
|
equals(other) {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export type L2BlockInfo = {
|
|
5
|
+
blockHash?: Fr;
|
|
6
|
+
archive: Fr;
|
|
7
|
+
lastArchive: Fr;
|
|
8
|
+
blockNumber: number;
|
|
9
|
+
slotNumber: number;
|
|
10
|
+
txCount: number;
|
|
11
|
+
timestamp: bigint;
|
|
12
|
+
};
|
|
13
|
+
export declare function randomBlockInfo(blockNumber?: number): L2BlockInfo;
|
|
14
|
+
export declare const BlockInfoSchema: z.ZodObject<{
|
|
15
|
+
blockHash: z.ZodOptional<z.ZodType<Fr, any, string>>;
|
|
16
|
+
archive: z.ZodType<Fr, any, string>;
|
|
17
|
+
lastArchive: z.ZodType<Fr, any, string>;
|
|
18
|
+
blockNumber: z.ZodNumber;
|
|
19
|
+
slotNumber: z.ZodNumber;
|
|
20
|
+
txCount: z.ZodNumber;
|
|
21
|
+
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
blockNumber: number;
|
|
24
|
+
slotNumber: number;
|
|
25
|
+
timestamp: bigint;
|
|
26
|
+
lastArchive: Fr;
|
|
27
|
+
archive: Fr;
|
|
28
|
+
txCount: number;
|
|
29
|
+
blockHash?: Fr | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
blockNumber: number;
|
|
32
|
+
slotNumber: number;
|
|
33
|
+
timestamp: string | number | bigint;
|
|
34
|
+
lastArchive: string;
|
|
35
|
+
archive: string;
|
|
36
|
+
txCount: number;
|
|
37
|
+
blockHash?: string | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
export declare function serializeBlockInfo(blockInfo: L2BlockInfo): Buffer;
|
|
40
|
+
export declare function deserializeBlockInfo(buffer: Buffer | BufferReader): L2BlockInfo;
|
|
41
|
+
//# sourceMappingURL=l2_block_info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"l2_block_info.d.ts","sourceRoot":"","sources":["../../src/block/l2_block_info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,CAAC,EAAE,EAAE,CAAC;IACf,OAAO,EAAE,EAAE,CAAC;IACZ,WAAW,EAAE,EAAE,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,eAAe,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,CAUjE;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;EAQ1B,CAAC;AAEH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,WAAW,GAAG,MAAM,CAUjE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,WAAW,CAY/E"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import { schemas } from '@aztec/foundation/schemas';
|
|
3
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export function randomBlockInfo(blockNumber) {
|
|
6
|
+
return {
|
|
7
|
+
blockHash: Fr.random(),
|
|
8
|
+
archive: Fr.random(),
|
|
9
|
+
lastArchive: Fr.random(),
|
|
10
|
+
blockNumber: blockNumber ?? Math.floor(Math.random() * 100000) + 1,
|
|
11
|
+
slotNumber: Math.floor(Math.random() * 100000) + 1,
|
|
12
|
+
txCount: Math.floor(Math.random() * 100),
|
|
13
|
+
timestamp: BigInt(Math.floor(Date.now() / 1000))
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export const BlockInfoSchema = z.object({
|
|
17
|
+
blockHash: schemas.Fr.optional(),
|
|
18
|
+
archive: schemas.Fr,
|
|
19
|
+
lastArchive: schemas.Fr,
|
|
20
|
+
blockNumber: z.number(),
|
|
21
|
+
slotNumber: z.number(),
|
|
22
|
+
txCount: z.number(),
|
|
23
|
+
timestamp: schemas.BigInt
|
|
24
|
+
});
|
|
25
|
+
export function serializeBlockInfo(blockInfo) {
|
|
26
|
+
return serializeToBuffer(blockInfo.blockHash ?? Fr.ZERO, blockInfo.archive, blockInfo.lastArchive, blockInfo.blockNumber, blockInfo.slotNumber, blockInfo.txCount, blockInfo.timestamp);
|
|
27
|
+
}
|
|
28
|
+
export function deserializeBlockInfo(buffer) {
|
|
29
|
+
const reader = BufferReader.asReader(buffer);
|
|
30
|
+
const blockHash = reader.readObject(Fr);
|
|
31
|
+
return {
|
|
32
|
+
blockHash: blockHash.equals(Fr.ZERO) ? undefined : blockHash,
|
|
33
|
+
archive: reader.readObject(Fr),
|
|
34
|
+
lastArchive: reader.readObject(Fr),
|
|
35
|
+
blockNumber: reader.readNumber(),
|
|
36
|
+
slotNumber: reader.readNumber(),
|
|
37
|
+
txCount: reader.readNumber(),
|
|
38
|
+
timestamp: reader.readBigInt()
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import { type ZodFor } from '@aztec/foundation/schemas';
|
|
3
2
|
import type { TypedEventEmitter } from '@aztec/foundation/types';
|
|
4
3
|
import { z } from 'zod';
|
|
5
4
|
import type { L1RollupConstants } from '../epoch-helpers/index.js';
|
|
6
|
-
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
7
5
|
import type { BlockHeader } from '../tx/block_header.js';
|
|
8
6
|
import type { IndexedTxEffect } from '../tx/indexed_tx_effect.js';
|
|
9
7
|
import type { TxHash } from '../tx/tx_hash.js';
|
|
10
8
|
import type { TxReceipt } from '../tx/tx_receipt.js';
|
|
11
9
|
import type { L2Block } from './l2_block.js';
|
|
12
10
|
import { PublishedL2Block } from './published_l2_block.js';
|
|
11
|
+
import type { ValidateBlockNegativeResult, ValidateBlockResult } from './validate_block_result.js';
|
|
13
12
|
/**
|
|
14
13
|
* Interface of classes allowing for the retrieval of L2 blocks.
|
|
15
14
|
*/
|
|
@@ -116,432 +115,6 @@ export interface L2BlockSource {
|
|
|
116
115
|
/** Force a sync. */
|
|
117
116
|
syncImmediate(): Promise<void>;
|
|
118
117
|
}
|
|
119
|
-
/** Subtype for invalid block validation results */
|
|
120
|
-
export type ValidateBlockNegativeResult = {
|
|
121
|
-
valid: false;
|
|
122
|
-
block: PublishedL2Block;
|
|
123
|
-
committee: EthAddress[];
|
|
124
|
-
epoch: bigint;
|
|
125
|
-
seed: bigint;
|
|
126
|
-
attestations: BlockAttestation[];
|
|
127
|
-
reason: 'insufficient-attestations';
|
|
128
|
-
} | {
|
|
129
|
-
valid: false;
|
|
130
|
-
block: PublishedL2Block;
|
|
131
|
-
committee: EthAddress[];
|
|
132
|
-
epoch: bigint;
|
|
133
|
-
seed: bigint;
|
|
134
|
-
reason: 'invalid-attestation';
|
|
135
|
-
attestations: BlockAttestation[];
|
|
136
|
-
invalidIndex: number;
|
|
137
|
-
};
|
|
138
|
-
/** Result type for validating a block attestations */
|
|
139
|
-
export type ValidateBlockResult = {
|
|
140
|
-
valid: true;
|
|
141
|
-
} | ValidateBlockNegativeResult;
|
|
142
|
-
export declare const ValidateBlockResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
143
|
-
valid: z.ZodLiteral<true>;
|
|
144
|
-
block: z.ZodOptional<z.ZodObject<{
|
|
145
|
-
block: z.ZodEffects<z.ZodObject<{
|
|
146
|
-
archive: z.ZodEffects<z.ZodObject<{
|
|
147
|
-
root: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
|
|
148
|
-
nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
149
|
-
}, "strip", z.ZodTypeAny, {
|
|
150
|
-
root: import("@aztec/foundation/schemas").Fr;
|
|
151
|
-
nextAvailableLeafIndex: number;
|
|
152
|
-
}, {
|
|
153
|
-
root: string;
|
|
154
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
155
|
-
}>, import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot, {
|
|
156
|
-
root: string;
|
|
157
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
158
|
-
}>;
|
|
159
|
-
header: ZodFor<BlockHeader>;
|
|
160
|
-
body: ZodFor<import("./body.js").Body>;
|
|
161
|
-
}, "strip", z.ZodTypeAny, {
|
|
162
|
-
archive: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
|
|
163
|
-
header: BlockHeader;
|
|
164
|
-
body: import("./body.js").Body;
|
|
165
|
-
}, {
|
|
166
|
-
archive: {
|
|
167
|
-
root: string;
|
|
168
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
169
|
-
};
|
|
170
|
-
header?: any;
|
|
171
|
-
body?: any;
|
|
172
|
-
}>, L2Block, {
|
|
173
|
-
archive: {
|
|
174
|
-
root: string;
|
|
175
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
176
|
-
};
|
|
177
|
-
header?: any;
|
|
178
|
-
body?: any;
|
|
179
|
-
}>;
|
|
180
|
-
l1: z.ZodObject<{
|
|
181
|
-
blockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
182
|
-
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
183
|
-
blockHash: z.ZodString;
|
|
184
|
-
}, "strip", z.ZodTypeAny, {
|
|
185
|
-
blockNumber: bigint;
|
|
186
|
-
timestamp: bigint;
|
|
187
|
-
blockHash: string;
|
|
188
|
-
}, {
|
|
189
|
-
blockNumber: string | number | bigint;
|
|
190
|
-
timestamp: string | number | bigint;
|
|
191
|
-
blockHash: string;
|
|
192
|
-
}>;
|
|
193
|
-
attestations: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
194
|
-
address: z.ZodType<EthAddress, any, string>;
|
|
195
|
-
signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, import("./index.js").Signature, string>;
|
|
196
|
-
}, "strip", z.ZodTypeAny, {
|
|
197
|
-
address: EthAddress;
|
|
198
|
-
signature: import("./index.js").Signature;
|
|
199
|
-
}, {
|
|
200
|
-
address: string;
|
|
201
|
-
signature: string;
|
|
202
|
-
}>, import("./index.js").CommitteeAttestation, {
|
|
203
|
-
address: string;
|
|
204
|
-
signature: string;
|
|
205
|
-
}>, "many">;
|
|
206
|
-
}, "strip", z.ZodTypeAny, {
|
|
207
|
-
block: L2Block;
|
|
208
|
-
l1: {
|
|
209
|
-
blockNumber: bigint;
|
|
210
|
-
timestamp: bigint;
|
|
211
|
-
blockHash: string;
|
|
212
|
-
};
|
|
213
|
-
attestations: import("./index.js").CommitteeAttestation[];
|
|
214
|
-
}, {
|
|
215
|
-
block: {
|
|
216
|
-
archive: {
|
|
217
|
-
root: string;
|
|
218
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
219
|
-
};
|
|
220
|
-
header?: any;
|
|
221
|
-
body?: any;
|
|
222
|
-
};
|
|
223
|
-
l1: {
|
|
224
|
-
blockNumber: string | number | bigint;
|
|
225
|
-
timestamp: string | number | bigint;
|
|
226
|
-
blockHash: string;
|
|
227
|
-
};
|
|
228
|
-
attestations: {
|
|
229
|
-
address: string;
|
|
230
|
-
signature: string;
|
|
231
|
-
}[];
|
|
232
|
-
}>>;
|
|
233
|
-
}, "strip", z.ZodTypeAny, {
|
|
234
|
-
valid: true;
|
|
235
|
-
block?: {
|
|
236
|
-
block: L2Block;
|
|
237
|
-
l1: {
|
|
238
|
-
blockNumber: bigint;
|
|
239
|
-
timestamp: bigint;
|
|
240
|
-
blockHash: string;
|
|
241
|
-
};
|
|
242
|
-
attestations: import("./index.js").CommitteeAttestation[];
|
|
243
|
-
} | undefined;
|
|
244
|
-
}, {
|
|
245
|
-
valid: true;
|
|
246
|
-
block?: {
|
|
247
|
-
block: {
|
|
248
|
-
archive: {
|
|
249
|
-
root: string;
|
|
250
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
251
|
-
};
|
|
252
|
-
header?: any;
|
|
253
|
-
body?: any;
|
|
254
|
-
};
|
|
255
|
-
l1: {
|
|
256
|
-
blockNumber: string | number | bigint;
|
|
257
|
-
timestamp: string | number | bigint;
|
|
258
|
-
blockHash: string;
|
|
259
|
-
};
|
|
260
|
-
attestations: {
|
|
261
|
-
address: string;
|
|
262
|
-
signature: string;
|
|
263
|
-
}[];
|
|
264
|
-
} | undefined;
|
|
265
|
-
}>, z.ZodObject<{
|
|
266
|
-
valid: z.ZodLiteral<false>;
|
|
267
|
-
block: z.ZodObject<{
|
|
268
|
-
block: z.ZodEffects<z.ZodObject<{
|
|
269
|
-
archive: z.ZodEffects<z.ZodObject<{
|
|
270
|
-
root: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
|
|
271
|
-
nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
272
|
-
}, "strip", z.ZodTypeAny, {
|
|
273
|
-
root: import("@aztec/foundation/schemas").Fr;
|
|
274
|
-
nextAvailableLeafIndex: number;
|
|
275
|
-
}, {
|
|
276
|
-
root: string;
|
|
277
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
278
|
-
}>, import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot, {
|
|
279
|
-
root: string;
|
|
280
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
281
|
-
}>;
|
|
282
|
-
header: ZodFor<BlockHeader>;
|
|
283
|
-
body: ZodFor<import("./body.js").Body>;
|
|
284
|
-
}, "strip", z.ZodTypeAny, {
|
|
285
|
-
archive: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
|
|
286
|
-
header: BlockHeader;
|
|
287
|
-
body: import("./body.js").Body;
|
|
288
|
-
}, {
|
|
289
|
-
archive: {
|
|
290
|
-
root: string;
|
|
291
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
292
|
-
};
|
|
293
|
-
header?: any;
|
|
294
|
-
body?: any;
|
|
295
|
-
}>, L2Block, {
|
|
296
|
-
archive: {
|
|
297
|
-
root: string;
|
|
298
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
299
|
-
};
|
|
300
|
-
header?: any;
|
|
301
|
-
body?: any;
|
|
302
|
-
}>;
|
|
303
|
-
l1: z.ZodObject<{
|
|
304
|
-
blockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
305
|
-
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
306
|
-
blockHash: z.ZodString;
|
|
307
|
-
}, "strip", z.ZodTypeAny, {
|
|
308
|
-
blockNumber: bigint;
|
|
309
|
-
timestamp: bigint;
|
|
310
|
-
blockHash: string;
|
|
311
|
-
}, {
|
|
312
|
-
blockNumber: string | number | bigint;
|
|
313
|
-
timestamp: string | number | bigint;
|
|
314
|
-
blockHash: string;
|
|
315
|
-
}>;
|
|
316
|
-
attestations: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
317
|
-
address: z.ZodType<EthAddress, any, string>;
|
|
318
|
-
signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, import("./index.js").Signature, string>;
|
|
319
|
-
}, "strip", z.ZodTypeAny, {
|
|
320
|
-
address: EthAddress;
|
|
321
|
-
signature: import("./index.js").Signature;
|
|
322
|
-
}, {
|
|
323
|
-
address: string;
|
|
324
|
-
signature: string;
|
|
325
|
-
}>, import("./index.js").CommitteeAttestation, {
|
|
326
|
-
address: string;
|
|
327
|
-
signature: string;
|
|
328
|
-
}>, "many">;
|
|
329
|
-
}, "strip", z.ZodTypeAny, {
|
|
330
|
-
block: L2Block;
|
|
331
|
-
l1: {
|
|
332
|
-
blockNumber: bigint;
|
|
333
|
-
timestamp: bigint;
|
|
334
|
-
blockHash: string;
|
|
335
|
-
};
|
|
336
|
-
attestations: import("./index.js").CommitteeAttestation[];
|
|
337
|
-
}, {
|
|
338
|
-
block: {
|
|
339
|
-
archive: {
|
|
340
|
-
root: string;
|
|
341
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
342
|
-
};
|
|
343
|
-
header?: any;
|
|
344
|
-
body?: any;
|
|
345
|
-
};
|
|
346
|
-
l1: {
|
|
347
|
-
blockNumber: string | number | bigint;
|
|
348
|
-
timestamp: string | number | bigint;
|
|
349
|
-
blockHash: string;
|
|
350
|
-
};
|
|
351
|
-
attestations: {
|
|
352
|
-
address: string;
|
|
353
|
-
signature: string;
|
|
354
|
-
}[];
|
|
355
|
-
}>;
|
|
356
|
-
committee: z.ZodArray<z.ZodType<EthAddress, any, string>, "many">;
|
|
357
|
-
epoch: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
358
|
-
seed: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
359
|
-
attestations: z.ZodArray<ZodFor<BlockAttestation>, "many">;
|
|
360
|
-
reason: z.ZodLiteral<"insufficient-attestations">;
|
|
361
|
-
}, "strip", z.ZodTypeAny, {
|
|
362
|
-
valid: false;
|
|
363
|
-
block: {
|
|
364
|
-
block: L2Block;
|
|
365
|
-
l1: {
|
|
366
|
-
blockNumber: bigint;
|
|
367
|
-
timestamp: bigint;
|
|
368
|
-
blockHash: string;
|
|
369
|
-
};
|
|
370
|
-
attestations: import("./index.js").CommitteeAttestation[];
|
|
371
|
-
};
|
|
372
|
-
attestations: BlockAttestation[];
|
|
373
|
-
committee: EthAddress[];
|
|
374
|
-
epoch: bigint;
|
|
375
|
-
seed: bigint;
|
|
376
|
-
reason: "insufficient-attestations";
|
|
377
|
-
}, {
|
|
378
|
-
valid: false;
|
|
379
|
-
block: {
|
|
380
|
-
block: {
|
|
381
|
-
archive: {
|
|
382
|
-
root: string;
|
|
383
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
384
|
-
};
|
|
385
|
-
header?: any;
|
|
386
|
-
body?: any;
|
|
387
|
-
};
|
|
388
|
-
l1: {
|
|
389
|
-
blockNumber: string | number | bigint;
|
|
390
|
-
timestamp: string | number | bigint;
|
|
391
|
-
blockHash: string;
|
|
392
|
-
};
|
|
393
|
-
attestations: {
|
|
394
|
-
address: string;
|
|
395
|
-
signature: string;
|
|
396
|
-
}[];
|
|
397
|
-
};
|
|
398
|
-
attestations: any[];
|
|
399
|
-
committee: string[];
|
|
400
|
-
epoch: string | number | bigint;
|
|
401
|
-
seed: string | number | bigint;
|
|
402
|
-
reason: "insufficient-attestations";
|
|
403
|
-
}>, z.ZodObject<{
|
|
404
|
-
valid: z.ZodLiteral<false>;
|
|
405
|
-
block: z.ZodObject<{
|
|
406
|
-
block: z.ZodEffects<z.ZodObject<{
|
|
407
|
-
archive: z.ZodEffects<z.ZodObject<{
|
|
408
|
-
root: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
|
|
409
|
-
nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
410
|
-
}, "strip", z.ZodTypeAny, {
|
|
411
|
-
root: import("@aztec/foundation/schemas").Fr;
|
|
412
|
-
nextAvailableLeafIndex: number;
|
|
413
|
-
}, {
|
|
414
|
-
root: string;
|
|
415
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
416
|
-
}>, import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot, {
|
|
417
|
-
root: string;
|
|
418
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
419
|
-
}>;
|
|
420
|
-
header: ZodFor<BlockHeader>;
|
|
421
|
-
body: ZodFor<import("./body.js").Body>;
|
|
422
|
-
}, "strip", z.ZodTypeAny, {
|
|
423
|
-
archive: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
|
|
424
|
-
header: BlockHeader;
|
|
425
|
-
body: import("./body.js").Body;
|
|
426
|
-
}, {
|
|
427
|
-
archive: {
|
|
428
|
-
root: string;
|
|
429
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
430
|
-
};
|
|
431
|
-
header?: any;
|
|
432
|
-
body?: any;
|
|
433
|
-
}>, L2Block, {
|
|
434
|
-
archive: {
|
|
435
|
-
root: string;
|
|
436
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
437
|
-
};
|
|
438
|
-
header?: any;
|
|
439
|
-
body?: any;
|
|
440
|
-
}>;
|
|
441
|
-
l1: z.ZodObject<{
|
|
442
|
-
blockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
443
|
-
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
444
|
-
blockHash: z.ZodString;
|
|
445
|
-
}, "strip", z.ZodTypeAny, {
|
|
446
|
-
blockNumber: bigint;
|
|
447
|
-
timestamp: bigint;
|
|
448
|
-
blockHash: string;
|
|
449
|
-
}, {
|
|
450
|
-
blockNumber: string | number | bigint;
|
|
451
|
-
timestamp: string | number | bigint;
|
|
452
|
-
blockHash: string;
|
|
453
|
-
}>;
|
|
454
|
-
attestations: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
455
|
-
address: z.ZodType<EthAddress, any, string>;
|
|
456
|
-
signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, import("./index.js").Signature, string>;
|
|
457
|
-
}, "strip", z.ZodTypeAny, {
|
|
458
|
-
address: EthAddress;
|
|
459
|
-
signature: import("./index.js").Signature;
|
|
460
|
-
}, {
|
|
461
|
-
address: string;
|
|
462
|
-
signature: string;
|
|
463
|
-
}>, import("./index.js").CommitteeAttestation, {
|
|
464
|
-
address: string;
|
|
465
|
-
signature: string;
|
|
466
|
-
}>, "many">;
|
|
467
|
-
}, "strip", z.ZodTypeAny, {
|
|
468
|
-
block: L2Block;
|
|
469
|
-
l1: {
|
|
470
|
-
blockNumber: bigint;
|
|
471
|
-
timestamp: bigint;
|
|
472
|
-
blockHash: string;
|
|
473
|
-
};
|
|
474
|
-
attestations: import("./index.js").CommitteeAttestation[];
|
|
475
|
-
}, {
|
|
476
|
-
block: {
|
|
477
|
-
archive: {
|
|
478
|
-
root: string;
|
|
479
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
480
|
-
};
|
|
481
|
-
header?: any;
|
|
482
|
-
body?: any;
|
|
483
|
-
};
|
|
484
|
-
l1: {
|
|
485
|
-
blockNumber: string | number | bigint;
|
|
486
|
-
timestamp: string | number | bigint;
|
|
487
|
-
blockHash: string;
|
|
488
|
-
};
|
|
489
|
-
attestations: {
|
|
490
|
-
address: string;
|
|
491
|
-
signature: string;
|
|
492
|
-
}[];
|
|
493
|
-
}>;
|
|
494
|
-
committee: z.ZodArray<z.ZodType<EthAddress, any, string>, "many">;
|
|
495
|
-
epoch: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
496
|
-
seed: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
497
|
-
attestations: z.ZodArray<ZodFor<BlockAttestation>, "many">;
|
|
498
|
-
reason: z.ZodLiteral<"invalid-attestation">;
|
|
499
|
-
invalidIndex: z.ZodNumber;
|
|
500
|
-
}, "strip", z.ZodTypeAny, {
|
|
501
|
-
valid: false;
|
|
502
|
-
block: {
|
|
503
|
-
block: L2Block;
|
|
504
|
-
l1: {
|
|
505
|
-
blockNumber: bigint;
|
|
506
|
-
timestamp: bigint;
|
|
507
|
-
blockHash: string;
|
|
508
|
-
};
|
|
509
|
-
attestations: import("./index.js").CommitteeAttestation[];
|
|
510
|
-
};
|
|
511
|
-
attestations: BlockAttestation[];
|
|
512
|
-
committee: EthAddress[];
|
|
513
|
-
epoch: bigint;
|
|
514
|
-
seed: bigint;
|
|
515
|
-
reason: "invalid-attestation";
|
|
516
|
-
invalidIndex: number;
|
|
517
|
-
}, {
|
|
518
|
-
valid: false;
|
|
519
|
-
block: {
|
|
520
|
-
block: {
|
|
521
|
-
archive: {
|
|
522
|
-
root: string;
|
|
523
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
524
|
-
};
|
|
525
|
-
header?: any;
|
|
526
|
-
body?: any;
|
|
527
|
-
};
|
|
528
|
-
l1: {
|
|
529
|
-
blockNumber: string | number | bigint;
|
|
530
|
-
timestamp: string | number | bigint;
|
|
531
|
-
blockHash: string;
|
|
532
|
-
};
|
|
533
|
-
attestations: {
|
|
534
|
-
address: string;
|
|
535
|
-
signature: string;
|
|
536
|
-
}[];
|
|
537
|
-
};
|
|
538
|
-
attestations: any[];
|
|
539
|
-
committee: string[];
|
|
540
|
-
epoch: string | number | bigint;
|
|
541
|
-
seed: string | number | bigint;
|
|
542
|
-
reason: "invalid-attestation";
|
|
543
|
-
invalidIndex: number;
|
|
544
|
-
}>]>;
|
|
545
118
|
/**
|
|
546
119
|
* L2BlockSource that emits events upon pending / proven chain changes.
|
|
547
120
|
* see L2BlockSourceEvents for the events emitted.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l2_block_source.d.ts","sourceRoot":"","sources":["../../src/block/l2_block_source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"l2_block_source.d.ts","sourceRoot":"","sources":["../../src/block/l2_block_source.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
import { schemas } from '@aztec/foundation/schemas';
|
|
2
1
|
import { z } from 'zod';
|
|
3
|
-
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
4
|
-
import { PublishedL2Block } from './published_l2_block.js';
|
|
5
|
-
export const ValidateBlockResultSchema = z.union([
|
|
6
|
-
z.object({
|
|
7
|
-
valid: z.literal(true),
|
|
8
|
-
block: PublishedL2Block.schema.optional()
|
|
9
|
-
}),
|
|
10
|
-
z.object({
|
|
11
|
-
valid: z.literal(false),
|
|
12
|
-
block: PublishedL2Block.schema,
|
|
13
|
-
committee: z.array(schemas.EthAddress),
|
|
14
|
-
epoch: schemas.BigInt,
|
|
15
|
-
seed: schemas.BigInt,
|
|
16
|
-
attestations: z.array(BlockAttestation.schema),
|
|
17
|
-
reason: z.literal('insufficient-attestations')
|
|
18
|
-
}),
|
|
19
|
-
z.object({
|
|
20
|
-
valid: z.literal(false),
|
|
21
|
-
block: PublishedL2Block.schema,
|
|
22
|
-
committee: z.array(schemas.EthAddress),
|
|
23
|
-
epoch: schemas.BigInt,
|
|
24
|
-
seed: schemas.BigInt,
|
|
25
|
-
attestations: z.array(BlockAttestation.schema),
|
|
26
|
-
reason: z.literal('invalid-attestation'),
|
|
27
|
-
invalidIndex: z.number()
|
|
28
|
-
})
|
|
29
|
-
]);
|
|
30
2
|
/** Creates an L2 block id */ export function makeL2BlockId(number, hash) {
|
|
31
3
|
if (number !== 0 && !hash) {
|
|
32
4
|
throw new Error(`Hash is required for non-genesis blocks (got block number ${number})`);
|