@aztec/stdlib 0.87.3-nightly.20250528 → 0.87.3
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/abi/abi.d.ts +0 -3
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +0 -38
- package/dest/avm/avm.d.ts +12 -696
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +8 -16
- package/dest/avm/avm_accumulated_data.d.ts +0 -77
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.js +0 -67
- package/dest/avm/avm_circuit_public_inputs.d.ts +3 -73
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.js +9 -19
- package/dest/avm/avm_proving_request.d.ts +0 -366
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/block/body.d.ts +1 -1
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +2 -2
- package/dest/block/index.d.ts +0 -1
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +0 -1
- package/dest/block/l2_block.d.ts +1 -1
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +2 -2
- package/dest/block/l2_block_source.d.ts +4 -9
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +0 -1
- package/dest/block/published_l2_block.d.ts +69 -99
- package/dest/block/published_l2_block.d.ts.map +1 -1
- package/dest/block/published_l2_block.js +12 -38
- package/dest/block/test/l2_tips_store_test_suite.js +1 -1
- package/dest/interfaces/archiver.js +2 -2
- package/dest/interfaces/aztec-node.js +2 -2
- package/dest/interfaces/proving-job.d.ts +4 -370
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +2 -2
- package/dest/interfaces/server_circuit_prover.d.ts +2 -3
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/kernel/index.d.ts +0 -1
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +0 -1
- package/dest/kernel/private_kernel_data.d.ts +25 -6
- package/dest/kernel/private_kernel_data.d.ts.map +1 -1
- package/dest/kernel/private_kernel_data.js +19 -8
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts +2 -5
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.js +5 -9
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +1 -10
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +3 -8
- package/dest/kernel/public_call_request.d.ts +0 -54
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/public_call_request.js +0 -58
- package/dest/rollup/avm_proof_data.d.ts +5 -7
- package/dest/rollup/avm_proof_data.d.ts.map +1 -1
- package/dest/rollup/avm_proof_data.js +4 -12
- package/dest/rollup/previous_rollup_block_data.d.ts +15 -6
- package/dest/rollup/previous_rollup_block_data.d.ts.map +1 -1
- package/dest/rollup/previous_rollup_block_data.js +13 -8
- package/dest/rollup/previous_rollup_data.d.ts +15 -6
- package/dest/rollup/previous_rollup_data.d.ts.map +1 -1
- package/dest/rollup/previous_rollup_data.js +13 -8
- package/dest/rollup/private_tube_data.d.ts +3 -3
- package/dest/rollup/private_tube_data.d.ts.map +1 -1
- package/dest/rollup/private_tube_data.js +3 -3
- package/dest/rollup/public_tube_data.d.ts +3 -3
- package/dest/rollup/public_tube_data.d.ts.map +1 -1
- package/dest/rollup/public_tube_data.js +3 -3
- package/dest/rollup/root_rollup.d.ts +10 -9
- package/dest/rollup/root_rollup.d.ts.map +1 -1
- package/dest/rollup/root_rollup.js +20 -9
- package/dest/tests/factories.d.ts +1 -2
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +15 -21
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +3 -4
- package/dest/tx/tx_effect.d.ts +1 -1
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +2 -2
- package/dest/validators/types.d.ts +0 -4
- package/dest/validators/types.d.ts.map +1 -1
- package/dest/vks/index.d.ts +1 -1
- package/dest/vks/index.d.ts.map +1 -1
- package/dest/vks/index.js +1 -1
- package/dest/vks/{vk_data.d.ts → vk_witness_data.d.ts} +8 -8
- package/dest/vks/vk_witness_data.d.ts.map +1 -0
- package/dest/vks/{vk_data.js → vk_witness_data.js} +10 -10
- package/package.json +7 -7
- package/src/abi/abi.ts +0 -37
- package/src/avm/avm.ts +0 -14
- package/src/avm/avm_accumulated_data.ts +0 -93
- package/src/avm/avm_circuit_public_inputs.ts +2 -22
- package/src/block/body.ts +2 -7
- package/src/block/index.ts +0 -1
- package/src/block/l2_block.ts +1 -2
- package/src/block/l2_block_source.ts +3 -9
- package/src/block/published_l2_block.ts +24 -38
- package/src/block/test/l2_tips_store_test_suite.ts +1 -1
- package/src/interfaces/archiver.ts +2 -2
- package/src/interfaces/aztec-node.ts +2 -2
- package/src/interfaces/proving-job.ts +3 -3
- package/src/interfaces/server_circuit_prover.ts +2 -3
- package/src/kernel/index.ts +0 -1
- package/src/kernel/private_kernel_data.ts +29 -7
- package/src/kernel/private_kernel_reset_circuit_private_inputs.ts +3 -6
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +2 -10
- package/src/kernel/public_call_request.ts +0 -66
- package/src/rollup/avm_proof_data.ts +7 -14
- package/src/rollup/previous_rollup_block_data.ts +12 -6
- package/src/rollup/previous_rollup_data.ts +12 -6
- package/src/rollup/private_tube_data.ts +4 -4
- package/src/rollup/public_tube_data.ts +4 -4
- package/src/rollup/root_rollup.ts +19 -6
- package/src/tests/factories.ts +20 -32
- package/src/tests/mocks.ts +3 -6
- package/src/tx/tx_effect.ts +5 -23
- package/src/validators/types.ts +0 -2
- package/src/vks/index.ts +1 -1
- package/src/vks/{vk_data.ts → vk_witness_data.ts} +6 -6
- package/dest/block/proposal/committee_attestation.d.ts +0 -34
- package/dest/block/proposal/committee_attestation.d.ts.map +0 -1
- package/dest/block/proposal/committee_attestation.js +0 -59
- package/dest/block/proposal/index.d.ts +0 -2
- package/dest/block/proposal/index.d.ts.map +0 -1
- package/dest/block/proposal/index.js +0 -1
- package/dest/kernel/padded_side_effects.d.ts +0 -26
- package/dest/kernel/padded_side_effects.d.ts.map +0 -1
- package/dest/kernel/padded_side_effects.js +0 -51
- package/dest/vks/vk_data.d.ts.map +0 -1
- package/src/block/proposal/committee_attestation.ts +0 -70
- package/src/block/proposal/index.ts +0 -1
- package/src/kernel/padded_side_effects.ts +0 -73
package/dest/block/l2_block.js
CHANGED
|
@@ -60,8 +60,8 @@ import { makeAppendOnlyTreeSnapshot, makeHeader } from './l2_block_code_to_purge
|
|
|
60
60
|
* @param numPublicLogsPerCall - The number of public logs per 1 public function invocation.
|
|
61
61
|
* @param inHash - The hash of the L1 to L2 messages subtree which got inserted in this block.
|
|
62
62
|
* @returns The L2 block.
|
|
63
|
-
*/ static async random(l2BlockNum, txsPerBlock = 4, numPublicCallsPerTx = 3, numPublicLogsPerCall = 1, inHash = undefined, slotNumber = undefined
|
|
64
|
-
const body = await Body.random(txsPerBlock, numPublicCallsPerTx, numPublicLogsPerCall
|
|
63
|
+
*/ static async random(l2BlockNum, txsPerBlock = 4, numPublicCallsPerTx = 3, numPublicLogsPerCall = 1, inHash = undefined, slotNumber = undefined) {
|
|
64
|
+
const body = await Body.random(txsPerBlock, numPublicCallsPerTx, numPublicLogsPerCall);
|
|
65
65
|
return new L2Block(makeAppendOnlyTreeSnapshot(l2BlockNum + 1), makeHeader(0, txsPerBlock, l2BlockNum, slotNumber ?? l2BlockNum, inHash), body);
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import type {
|
|
2
|
+
import type { EventEmitter } from 'events';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import type { L1RollupConstants } from '../epoch-helpers/index.js';
|
|
5
5
|
import type { BlockHeader } from '../tx/block_header.js';
|
|
@@ -106,11 +106,7 @@ export interface L2BlockSource {
|
|
|
106
106
|
* L2BlockSource that emits events upon pending / proven chain changes.
|
|
107
107
|
* see L2BlockSourceEvents for the events emitted.
|
|
108
108
|
*/
|
|
109
|
-
export
|
|
110
|
-
[L2BlockSourceEvents.L2PruneDetected]: (args: L2BlockSourceEvent) => void;
|
|
111
|
-
[L2BlockSourceEvents.L2BlockProven]: (args: L2BlockSourceEvent) => void;
|
|
112
|
-
}>;
|
|
113
|
-
export interface L2BlockSourceEventEmitter extends L2BlockSource, ArchiverEmitter {
|
|
109
|
+
export interface L2BlockSourceEventEmitter extends L2BlockSource, EventEmitter {
|
|
114
110
|
}
|
|
115
111
|
/**
|
|
116
112
|
* Identifier for L2 block tags.
|
|
@@ -248,11 +244,10 @@ export declare const L2TipsSchema: z.ZodObject<{
|
|
|
248
244
|
};
|
|
249
245
|
}>;
|
|
250
246
|
export declare enum L2BlockSourceEvents {
|
|
251
|
-
L2PruneDetected = "l2PruneDetected"
|
|
252
|
-
L2BlockProven = "l2BlockProven"
|
|
247
|
+
L2PruneDetected = "l2PruneDetected"
|
|
253
248
|
}
|
|
254
249
|
export type L2BlockSourceEvent = {
|
|
255
|
-
type: 'l2PruneDetected'
|
|
250
|
+
type: 'l2PruneDetected';
|
|
256
251
|
blockNumber: bigint;
|
|
257
252
|
slotNumber: bigint;
|
|
258
253
|
epochNumber: bigint;
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"l2_block_source.d.ts","sourceRoot":"","sources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C;AAC7C,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,6BAA6B;AAC7B,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAKtE;AAGD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;IASnB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIK,CAAC;AAE/B,oBAAY,mBAAmB;IAC7B,eAAe,oBAAoB;CACpC;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,iBAAiB,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
|
@@ -26,6 +26,5 @@ export const L2TipsSchema = z.object({
|
|
|
26
26
|
});
|
|
27
27
|
export var L2BlockSourceEvents = /*#__PURE__*/ function(L2BlockSourceEvents) {
|
|
28
28
|
L2BlockSourceEvents["L2PruneDetected"] = "l2PruneDetected";
|
|
29
|
-
L2BlockSourceEvents["L2BlockProven"] = "l2BlockProven";
|
|
30
29
|
return L2BlockSourceEvents;
|
|
31
30
|
}({});
|
|
@@ -1,13 +1,54 @@
|
|
|
1
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
2
|
+
import { L2Block } from '@aztec/stdlib/block';
|
|
1
3
|
import { z } from 'zod';
|
|
2
4
|
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
3
|
-
|
|
4
|
-
import { CommitteeAttestation } from './proposal/committee_attestation.js';
|
|
5
|
-
export declare class L1PublishedData {
|
|
5
|
+
export type L1PublishedData = {
|
|
6
6
|
blockNumber: bigint;
|
|
7
7
|
timestamp: bigint;
|
|
8
8
|
blockHash: string;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
};
|
|
10
|
+
export type PublishedL2Block = {
|
|
11
|
+
block: L2Block;
|
|
12
|
+
l1: L1PublishedData;
|
|
13
|
+
signatures: Signature[];
|
|
14
|
+
};
|
|
15
|
+
export declare const PublishedL2BlockSchema: z.ZodObject<{
|
|
16
|
+
block: z.ZodEffects<z.ZodObject<{
|
|
17
|
+
archive: z.ZodEffects<z.ZodObject<{
|
|
18
|
+
root: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
|
|
19
|
+
nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
root: import("@aztec/foundation/schemas").Fr;
|
|
22
|
+
nextAvailableLeafIndex: number;
|
|
23
|
+
}, {
|
|
24
|
+
root: string;
|
|
25
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
26
|
+
}>, import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot, {
|
|
27
|
+
root: string;
|
|
28
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
29
|
+
}>;
|
|
30
|
+
header: import("@aztec/foundation/schemas").ZodFor<import("../tx/block_header.js").BlockHeader>;
|
|
31
|
+
body: import("@aztec/foundation/schemas").ZodFor<import("@aztec/stdlib/block").Body>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
archive: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
|
|
34
|
+
header: import("../tx/block_header.js").BlockHeader;
|
|
35
|
+
body: import("@aztec/stdlib/block").Body;
|
|
36
|
+
}, {
|
|
37
|
+
archive: {
|
|
38
|
+
root: string;
|
|
39
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
40
|
+
};
|
|
41
|
+
header?: any;
|
|
42
|
+
body?: any;
|
|
43
|
+
}>, L2Block, {
|
|
44
|
+
archive: {
|
|
45
|
+
root: string;
|
|
46
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
47
|
+
};
|
|
48
|
+
header?: any;
|
|
49
|
+
body?: any;
|
|
50
|
+
}>;
|
|
51
|
+
l1: z.ZodObject<{
|
|
11
52
|
blockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
12
53
|
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
13
54
|
blockHash: z.ZodString;
|
|
@@ -20,101 +61,30 @@ export declare class L1PublishedData {
|
|
|
20
61
|
timestamp: string | number | bigint;
|
|
21
62
|
blockHash: string;
|
|
22
63
|
}>;
|
|
23
|
-
}
|
|
24
|
-
|
|
64
|
+
signatures: z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, Signature, string>, "many">;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
66
|
block: L2Block;
|
|
26
|
-
l1:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}, {
|
|
38
|
-
root: string;
|
|
39
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
40
|
-
}>, import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot, {
|
|
41
|
-
root: string;
|
|
42
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
43
|
-
}>;
|
|
44
|
-
header: import("@aztec/foundation/schemas").ZodFor<import("../tx/block_header.js").BlockHeader>;
|
|
45
|
-
body: import("@aztec/foundation/schemas").ZodFor<import("./body.js").Body>;
|
|
46
|
-
}, "strip", z.ZodTypeAny, {
|
|
47
|
-
archive: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
|
|
48
|
-
header: import("../tx/block_header.js").BlockHeader;
|
|
49
|
-
body: import("./body.js").Body;
|
|
50
|
-
}, {
|
|
51
|
-
archive: {
|
|
52
|
-
root: string;
|
|
53
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
54
|
-
};
|
|
55
|
-
header?: any;
|
|
56
|
-
body?: any;
|
|
57
|
-
}>, L2Block, {
|
|
58
|
-
archive: {
|
|
59
|
-
root: string;
|
|
60
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
61
|
-
};
|
|
62
|
-
header?: any;
|
|
63
|
-
body?: any;
|
|
64
|
-
}>;
|
|
65
|
-
l1: z.ZodObject<{
|
|
66
|
-
blockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
67
|
-
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
68
|
-
blockHash: z.ZodString;
|
|
69
|
-
}, "strip", z.ZodTypeAny, {
|
|
70
|
-
blockNumber: bigint;
|
|
71
|
-
timestamp: bigint;
|
|
72
|
-
blockHash: string;
|
|
73
|
-
}, {
|
|
74
|
-
blockNumber: string | number | bigint;
|
|
75
|
-
timestamp: string | number | bigint;
|
|
76
|
-
blockHash: string;
|
|
77
|
-
}>;
|
|
78
|
-
attestations: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
79
|
-
address: z.ZodType<import("@aztec/foundation/schemas").EthAddress, any, string>;
|
|
80
|
-
signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, import("./proposal/committee_attestation.js").Signature, string>;
|
|
81
|
-
}, "strip", z.ZodTypeAny, {
|
|
82
|
-
address: import("@aztec/foundation/schemas").EthAddress;
|
|
83
|
-
signature: import("./proposal/committee_attestation.js").Signature;
|
|
84
|
-
}, {
|
|
85
|
-
address: string;
|
|
86
|
-
signature: string;
|
|
87
|
-
}>, CommitteeAttestation, {
|
|
88
|
-
address: string;
|
|
89
|
-
signature: string;
|
|
90
|
-
}>, "many">;
|
|
91
|
-
}, "strip", z.ZodTypeAny, {
|
|
92
|
-
block: L2Block;
|
|
93
|
-
l1: {
|
|
94
|
-
blockNumber: bigint;
|
|
95
|
-
timestamp: bigint;
|
|
96
|
-
blockHash: string;
|
|
97
|
-
};
|
|
98
|
-
attestations: CommitteeAttestation[];
|
|
99
|
-
}, {
|
|
100
|
-
block: {
|
|
101
|
-
archive: {
|
|
102
|
-
root: string;
|
|
103
|
-
nextAvailableLeafIndex: string | number | bigint;
|
|
104
|
-
};
|
|
105
|
-
header?: any;
|
|
106
|
-
body?: any;
|
|
107
|
-
};
|
|
108
|
-
l1: {
|
|
109
|
-
blockNumber: string | number | bigint;
|
|
110
|
-
timestamp: string | number | bigint;
|
|
111
|
-
blockHash: string;
|
|
67
|
+
l1: {
|
|
68
|
+
blockNumber: bigint;
|
|
69
|
+
timestamp: bigint;
|
|
70
|
+
blockHash: string;
|
|
71
|
+
};
|
|
72
|
+
signatures: Signature[];
|
|
73
|
+
}, {
|
|
74
|
+
block: {
|
|
75
|
+
archive: {
|
|
76
|
+
root: string;
|
|
77
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
112
78
|
};
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
79
|
+
header?: any;
|
|
80
|
+
body?: any;
|
|
81
|
+
};
|
|
82
|
+
l1: {
|
|
83
|
+
blockNumber: string | number | bigint;
|
|
84
|
+
timestamp: string | number | bigint;
|
|
85
|
+
blockHash: string;
|
|
86
|
+
};
|
|
87
|
+
signatures: string[];
|
|
88
|
+
}>;
|
|
119
89
|
export declare function getAttestationsFromPublishedL2Block(block: PublishedL2Block): BlockAttestation[];
|
|
120
90
|
//# sourceMappingURL=published_l2_block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"published_l2_block.d.ts","sourceRoot":"","sources":["../../src/block/published_l2_block.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"published_l2_block.d.ts","sourceRoot":"","sources":["../../src/block/published_l2_block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,EAAE,EAAE,eAAe,CAAC;IACpB,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQjC,CAAC;AAEH,wBAAgB,mCAAmC,CAAC,KAAK,EAAE,gBAAgB,sBAK1E"}
|
|
@@ -1,45 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
2
2
|
import { schemas } from '@aztec/foundation/schemas';
|
|
3
|
+
import { L2Block } from '@aztec/stdlib/block';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
5
6
|
import { ConsensusPayload } from '../p2p/consensus_payload.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.blockHash = blockHash;
|
|
16
|
-
}
|
|
17
|
-
static get schema() {
|
|
18
|
-
return z.object({
|
|
19
|
-
blockNumber: schemas.BigInt,
|
|
20
|
-
timestamp: schemas.BigInt,
|
|
21
|
-
blockHash: z.string()
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
export class PublishedL2Block {
|
|
26
|
-
block;
|
|
27
|
-
l1;
|
|
28
|
-
attestations;
|
|
29
|
-
constructor(block, l1, attestations){
|
|
30
|
-
this.block = block;
|
|
31
|
-
this.l1 = l1;
|
|
32
|
-
this.attestations = attestations;
|
|
33
|
-
}
|
|
34
|
-
static get schema() {
|
|
35
|
-
return z.object({
|
|
36
|
-
block: L2Block.schema,
|
|
37
|
-
l1: L1PublishedData.schema,
|
|
38
|
-
attestations: z.array(CommitteeAttestation.schema)
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
7
|
+
export const PublishedL2BlockSchema = z.object({
|
|
8
|
+
block: L2Block.schema,
|
|
9
|
+
l1: z.object({
|
|
10
|
+
blockNumber: schemas.BigInt,
|
|
11
|
+
timestamp: schemas.BigInt,
|
|
12
|
+
blockHash: z.string()
|
|
13
|
+
}),
|
|
14
|
+
signatures: z.array(Signature.schema)
|
|
15
|
+
});
|
|
42
16
|
export function getAttestationsFromPublishedL2Block(block) {
|
|
43
17
|
const payload = ConsensusPayload.fromBlock(block.block);
|
|
44
|
-
return block.
|
|
18
|
+
return block.signatures.filter((sig)=>!sig.isEmpty).map((signature)=>new BlockAttestation(block.block.header.globalVariables.blockNumber, payload, signature));
|
|
45
19
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { L2Block } from '../block/l2_block.js';
|
|
3
3
|
import { L2TipsSchema } from '../block/l2_block_source.js';
|
|
4
|
-
import {
|
|
4
|
+
import { PublishedL2BlockSchema } from '../block/published_l2_block.js';
|
|
5
5
|
import { ContractClassPublicSchema, ContractInstanceWithAddressSchema } from '../contract/index.js';
|
|
6
6
|
import { L1RollupConstantsSchema } from '../epoch-helpers/index.js';
|
|
7
7
|
import { LogFilterSchema } from '../logs/log_filter.js';
|
|
@@ -24,7 +24,7 @@ export const ArchiverApiSchema = {
|
|
|
24
24
|
z.literal('latest')
|
|
25
25
|
])).returns(BlockHeader.schema.optional()),
|
|
26
26
|
getBlocks: z.function().args(schemas.Integer, schemas.Integer, optional(z.boolean())).returns(z.array(L2Block.schema)),
|
|
27
|
-
getPublishedBlocks: z.function().args(schemas.Integer, schemas.Integer, optional(z.boolean())).returns(z.array(
|
|
27
|
+
getPublishedBlocks: z.function().args(schemas.Integer, schemas.Integer, optional(z.boolean())).returns(z.array(PublishedL2BlockSchema)),
|
|
28
28
|
getTxEffect: z.function().args(TxHash.schema).returns(indexedTxSchema().optional()),
|
|
29
29
|
getSettledTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema.optional()),
|
|
30
30
|
getL2SlotNumber: z.function().args().returns(schemas.BigInt),
|
|
@@ -7,7 +7,7 @@ import { inBlockSchemaFor } from '../block/in_block.js';
|
|
|
7
7
|
import { L2Block } from '../block/l2_block.js';
|
|
8
8
|
import { L2BlockNumberSchema } from '../block/l2_block_number.js';
|
|
9
9
|
import { L2TipsSchema } from '../block/l2_block_source.js';
|
|
10
|
-
import {
|
|
10
|
+
import { PublishedL2BlockSchema } from '../block/published_l2_block.js';
|
|
11
11
|
import { ContractClassPublicSchema, ContractInstanceWithAddressSchema, NodeInfoSchema, ProtocolContractAddressesSchema } from '../contract/index.js';
|
|
12
12
|
import { GasFees } from '../gas/gas_fees.js';
|
|
13
13
|
import { LogFilterSchema } from '../logs/log_filter.js';
|
|
@@ -48,7 +48,7 @@ export const AztecNodeApiSchema = {
|
|
|
48
48
|
isReady: z.function().returns(z.boolean()),
|
|
49
49
|
getNodeInfo: z.function().returns(NodeInfoSchema),
|
|
50
50
|
getBlocks: z.function().args(z.number(), z.number()).returns(z.array(L2Block.schema)),
|
|
51
|
-
getPublishedBlocks: z.function().args(z.number(), z.number()).returns(z.array(
|
|
51
|
+
getPublishedBlocks: z.function().args(z.number(), z.number()).returns(z.array(PublishedL2BlockSchema)),
|
|
52
52
|
getCurrentBaseFees: z.function().returns(GasFees.schema),
|
|
53
53
|
getNodeVersion: z.function().returns(z.string()),
|
|
54
54
|
getVersion: z.function().returns(z.number()),
|