@aztec/aztec-node 0.0.1-commit.b33fc05d0 → 0.0.1-commit.b3d3157a
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/aztec-node/block_response_helpers.d.ts +25 -0
- package/dest/aztec-node/block_response_helpers.d.ts.map +1 -0
- package/dest/aztec-node/block_response_helpers.js +112 -0
- package/dest/aztec-node/config.d.ts +7 -4
- package/dest/aztec-node/config.d.ts.map +1 -1
- package/dest/aztec-node/config.js +5 -5
- package/dest/aztec-node/public_data_overrides.d.ts +13 -0
- package/dest/aztec-node/public_data_overrides.d.ts.map +1 -0
- package/dest/aztec-node/public_data_overrides.js +21 -0
- package/dest/aztec-node/server.d.ts +73 -108
- package/dest/aztec-node/server.d.ts.map +1 -1
- package/dest/aztec-node/server.js +988 -495
- package/dest/sentinel/config.d.ts +3 -2
- package/dest/sentinel/config.d.ts.map +1 -1
- package/dest/sentinel/config.js +15 -5
- package/dest/sentinel/factory.d.ts +4 -2
- package/dest/sentinel/factory.d.ts.map +1 -1
- package/dest/sentinel/factory.js +4 -4
- package/dest/sentinel/sentinel.d.ts +133 -9
- package/dest/sentinel/sentinel.d.ts.map +1 -1
- package/dest/sentinel/sentinel.js +212 -70
- package/dest/sentinel/store.d.ts +8 -8
- package/dest/sentinel/store.d.ts.map +1 -1
- package/dest/sentinel/store.js +25 -17
- package/dest/test/index.d.ts +3 -3
- package/dest/test/index.d.ts.map +1 -1
- package/package.json +27 -27
- package/src/aztec-node/block_response_helpers.ts +161 -0
- package/src/aztec-node/config.ts +11 -7
- package/src/aztec-node/public_data_overrides.ts +35 -0
- package/src/aztec-node/server.ts +1090 -615
- package/src/sentinel/README.md +103 -0
- package/src/sentinel/config.ts +18 -6
- package/src/sentinel/factory.ts +7 -4
- package/src/sentinel/sentinel.ts +267 -82
- package/src/sentinel/store.ts +26 -18
- package/src/test/index.ts +2 -2
package/dest/test/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EpochCacheInterface } from '@aztec/epoch-cache';
|
|
2
2
|
import type { P2P } from '@aztec/p2p';
|
|
3
3
|
import { SequencerClient } from '@aztec/sequencer-client';
|
|
4
|
-
import {
|
|
4
|
+
import { DataWithholdingWatcher, type SlasherClientInterface } from '@aztec/slasher';
|
|
5
5
|
import type { L2BlockSource } from '@aztec/stdlib/block';
|
|
6
6
|
import type { ContractDataSource } from '@aztec/stdlib/contract';
|
|
7
7
|
import type { L2LogsSource, Service, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
|
|
@@ -21,11 +21,11 @@ export declare class TestAztecNodeService extends AztecNodeService {
|
|
|
21
21
|
sequencer: SequencerClient | undefined;
|
|
22
22
|
slasherClient: SlasherClientInterface | undefined;
|
|
23
23
|
validatorsSentinel: Sentinel | undefined;
|
|
24
|
-
|
|
24
|
+
dataWithholdingWatcher: DataWithholdingWatcher | undefined;
|
|
25
25
|
l1ChainId: number;
|
|
26
26
|
version: number;
|
|
27
27
|
globalVariableBuilder: GlobalVariableBuilderInterface;
|
|
28
28
|
epochCache: EpochCacheInterface;
|
|
29
29
|
packageVersion: string;
|
|
30
30
|
}
|
|
31
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDOUQsT0FBTyxLQUFLLEVBQUUsR0FBRyxFQUFFLE1BQU0sWUFBWSxDQUFDO0FBQ3RDLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUMxRCxPQUFPLEVBQUUsc0JBQXNCLEVBQUUsS0FBSyxzQkFBc0IsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3JGLE9BQU8sS0FBSyxFQUFFLGFBQWEsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ3pELE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDakUsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ3JHLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDbkUsT0FBTyxLQUFLLEVBQUUscUJBQXFCLElBQUksOEJBQThCLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUVoRyxPQUFPLEtBQUssRUFBRSxlQUFlLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUMvRCxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUMzRCxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFFbkQsTUFBTSxDQUFDLE9BQU8sT0FBTyxvQkFBcUIsU0FBUSxnQkFBZ0I7SUFDakQsTUFBTSxFQUFFLGVBQWUsQ0FBQztJQUN4QixTQUFTLEVBQUUsR0FBRyxDQUFDO0lBQ2YsV0FBVyxFQUFFLGFBQWEsR0FBRyxPQUFPLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDOUMsVUFBVSxFQUFFLFlBQVksQ0FBQztJQUN6QixrQkFBa0IsRUFBRSxrQkFBa0IsQ0FBQztJQUN2QyxtQkFBbUIsRUFBRSxtQkFBbUIsQ0FBQztJQUN6QyxzQkFBc0IsRUFBRSxzQkFBc0IsQ0FBQztJQUMvQyxTQUFTLEVBQUUsZUFBZSxHQUFHLFNBQVMsQ0FBQztJQUN2QyxhQUFhLEVBQUUsc0JBQXNCLEdBQUcsU0FBUyxDQUFDO0lBQ2xELGtCQUFrQixFQUFFLFFBQVEsR0FBRyxTQUFTLENBQUM7SUFDekMsc0JBQXNCLEVBQUUsc0JBQXNCLEdBQUcsU0FBUyxDQUFDO0lBQzNELFNBQVMsRUFBRSxNQUFNLENBQUM7SUFDbEIsT0FBTyxFQUFFLE1BQU0sQ0FBQztJQUNoQixxQkFBcUIsRUFBRSw4QkFBOEIsQ0FBQztJQUN0RCxVQUFVLEVBQUUsbUJBQW1CLENBQUM7SUFDaEMsY0FBYyxFQUFFLE1BQU0sQ0FBQztDQUN2QyJ9
|
package/dest/test/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACrG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,qBAAqB,IAAI,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAEhG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,gBAAgB;IACjD,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,GAAG,CAAC;IACf,WAAW,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9C,UAAU,EAAE,YAAY,CAAC;IACzB,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,SAAS,EAAE,eAAe,GAAG,SAAS,CAAC;IACvC,aAAa,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAClD,kBAAkB,EAAE,QAAQ,GAAG,SAAS,CAAC;IACzC,sBAAsB,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,qBAAqB,EAAE,8BAA8B,CAAC;IACtD,UAAU,EAAE,mBAAmB,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;CACvC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec-node",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.b3d3157a",
|
|
4
4
|
"main": "dest/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -65,32 +65,32 @@
|
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
69
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
70
|
-
"@aztec/blob-client": "0.0.1-commit.
|
|
71
|
-
"@aztec/blob-lib": "0.0.1-commit.
|
|
72
|
-
"@aztec/constants": "0.0.1-commit.
|
|
73
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
74
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
75
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
76
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
77
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
78
|
-
"@aztec/
|
|
79
|
-
"@aztec/node-
|
|
80
|
-
"@aztec/
|
|
81
|
-
"@aztec/
|
|
82
|
-
"@aztec/
|
|
83
|
-
"@aztec/
|
|
84
|
-
"@aztec/prover-
|
|
85
|
-
"@aztec/
|
|
86
|
-
"@aztec/
|
|
87
|
-
"@aztec/
|
|
88
|
-
"@aztec/
|
|
89
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
90
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
91
|
-
"@aztec/validator-client": "0.0.1-commit.
|
|
92
|
-
"@aztec/validator-ha-signer": "0.0.1-commit.
|
|
93
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
68
|
+
"@aztec/archiver": "0.0.1-commit.b3d3157a",
|
|
69
|
+
"@aztec/bb-prover": "0.0.1-commit.b3d3157a",
|
|
70
|
+
"@aztec/blob-client": "0.0.1-commit.b3d3157a",
|
|
71
|
+
"@aztec/blob-lib": "0.0.1-commit.b3d3157a",
|
|
72
|
+
"@aztec/constants": "0.0.1-commit.b3d3157a",
|
|
73
|
+
"@aztec/epoch-cache": "0.0.1-commit.b3d3157a",
|
|
74
|
+
"@aztec/ethereum": "0.0.1-commit.b3d3157a",
|
|
75
|
+
"@aztec/foundation": "0.0.1-commit.b3d3157a",
|
|
76
|
+
"@aztec/kv-store": "0.0.1-commit.b3d3157a",
|
|
77
|
+
"@aztec/l1-artifacts": "0.0.1-commit.b3d3157a",
|
|
78
|
+
"@aztec/node-keystore": "0.0.1-commit.b3d3157a",
|
|
79
|
+
"@aztec/node-lib": "0.0.1-commit.b3d3157a",
|
|
80
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.b3d3157a",
|
|
81
|
+
"@aztec/p2p": "0.0.1-commit.b3d3157a",
|
|
82
|
+
"@aztec/protocol-contracts": "0.0.1-commit.b3d3157a",
|
|
83
|
+
"@aztec/prover-client": "0.0.1-commit.b3d3157a",
|
|
84
|
+
"@aztec/prover-node": "0.0.1-commit.b3d3157a",
|
|
85
|
+
"@aztec/sequencer-client": "0.0.1-commit.b3d3157a",
|
|
86
|
+
"@aztec/simulator": "0.0.1-commit.b3d3157a",
|
|
87
|
+
"@aztec/slasher": "0.0.1-commit.b3d3157a",
|
|
88
|
+
"@aztec/standard-contracts": "0.0.1-commit.b3d3157a",
|
|
89
|
+
"@aztec/stdlib": "0.0.1-commit.b3d3157a",
|
|
90
|
+
"@aztec/telemetry-client": "0.0.1-commit.b3d3157a",
|
|
91
|
+
"@aztec/validator-client": "0.0.1-commit.b3d3157a",
|
|
92
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.b3d3157a",
|
|
93
|
+
"@aztec/world-state": "0.0.1-commit.b3d3157a",
|
|
94
94
|
"koa": "^2.16.1",
|
|
95
95
|
"koa-router": "^13.1.1",
|
|
96
96
|
"tslib": "^2.4.0",
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { type BlockData, type CommitteeAttestation, L2Block } from '@aztec/stdlib/block';
|
|
3
|
+
import type {
|
|
4
|
+
CheckpointData,
|
|
5
|
+
L1PublishedData,
|
|
6
|
+
ProposedCheckpointData,
|
|
7
|
+
PublishedCheckpoint,
|
|
8
|
+
} from '@aztec/stdlib/checkpoint';
|
|
9
|
+
import {
|
|
10
|
+
type BlockIncludeOptions,
|
|
11
|
+
type BlockResponse,
|
|
12
|
+
type CheckpointIncludeOptions,
|
|
13
|
+
type CheckpointResponse,
|
|
14
|
+
l1PublishInfoFromL1PublishedData,
|
|
15
|
+
} from '@aztec/stdlib/interfaces/client';
|
|
16
|
+
|
|
17
|
+
/** Projects a full {@link L2Block} into a {@link BlockResponse}, attaching L1 / attestation context when provided. */
|
|
18
|
+
export async function blockResponseFromL2Block(
|
|
19
|
+
block: L2Block,
|
|
20
|
+
options: BlockIncludeOptions,
|
|
21
|
+
context?: { l1?: L1PublishedData; attestations?: CommitteeAttestation[] },
|
|
22
|
+
): Promise<BlockResponse> {
|
|
23
|
+
const response: BlockResponse = {
|
|
24
|
+
header: block.header,
|
|
25
|
+
archive: block.archive,
|
|
26
|
+
hash: await block.hash(),
|
|
27
|
+
checkpointNumber: block.checkpointNumber,
|
|
28
|
+
indexWithinCheckpoint: block.indexWithinCheckpoint,
|
|
29
|
+
number: block.number,
|
|
30
|
+
};
|
|
31
|
+
if (options.includeTransactions) {
|
|
32
|
+
(response as BlockResponse).body = block.body;
|
|
33
|
+
}
|
|
34
|
+
if (options.includeL1PublishInfo) {
|
|
35
|
+
(response as BlockResponse).l1 = l1PublishInfoFromL1PublishedData(context?.l1);
|
|
36
|
+
}
|
|
37
|
+
if (options.includeAttestations) {
|
|
38
|
+
(response as BlockResponse).attestations = context?.attestations ?? [];
|
|
39
|
+
}
|
|
40
|
+
return response;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Projects metadata-only {@link BlockData} into a {@link BlockResponse}. */
|
|
44
|
+
export function blockResponseFromBlockData(
|
|
45
|
+
data: BlockData,
|
|
46
|
+
options: BlockIncludeOptions,
|
|
47
|
+
context?: { l1?: L1PublishedData; attestations?: CommitteeAttestation[] },
|
|
48
|
+
): BlockResponse {
|
|
49
|
+
const response: BlockResponse = {
|
|
50
|
+
header: data.header,
|
|
51
|
+
archive: data.archive,
|
|
52
|
+
hash: data.blockHash,
|
|
53
|
+
checkpointNumber: data.checkpointNumber,
|
|
54
|
+
indexWithinCheckpoint: data.indexWithinCheckpoint,
|
|
55
|
+
number: data.header.getBlockNumber(),
|
|
56
|
+
};
|
|
57
|
+
if (options.includeL1PublishInfo) {
|
|
58
|
+
(response as BlockResponse).l1 = l1PublishInfoFromL1PublishedData(context?.l1);
|
|
59
|
+
}
|
|
60
|
+
if (options.includeAttestations) {
|
|
61
|
+
(response as BlockResponse).attestations = context?.attestations ?? [];
|
|
62
|
+
}
|
|
63
|
+
return response;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Projects a {@link PublishedCheckpoint} into a {@link CheckpointResponse}. */
|
|
67
|
+
export async function checkpointResponseFromPublishedCheckpoint(
|
|
68
|
+
pc: PublishedCheckpoint,
|
|
69
|
+
options: CheckpointIncludeOptions,
|
|
70
|
+
): Promise<CheckpointResponse> {
|
|
71
|
+
const response: CheckpointResponse = {
|
|
72
|
+
number: pc.checkpoint.number,
|
|
73
|
+
header: pc.checkpoint.header,
|
|
74
|
+
archive: pc.checkpoint.archive,
|
|
75
|
+
checkpointOutHash: pc.checkpoint.getCheckpointOutHash(),
|
|
76
|
+
startBlock: pc.checkpoint.blocks[0]?.number ?? BlockNumber.ZERO,
|
|
77
|
+
blockCount: pc.checkpoint.blocks.length,
|
|
78
|
+
feeAssetPriceModifier: pc.checkpoint.feeAssetPriceModifier,
|
|
79
|
+
};
|
|
80
|
+
if (options.includeBlocks) {
|
|
81
|
+
(response as CheckpointResponse).blocks = await Promise.all(
|
|
82
|
+
pc.checkpoint.blocks.map(block =>
|
|
83
|
+
blockResponseFromL2Block(block, {
|
|
84
|
+
includeTransactions: options.includeTransactions,
|
|
85
|
+
includeL1PublishInfo: false,
|
|
86
|
+
includeAttestations: false,
|
|
87
|
+
}),
|
|
88
|
+
),
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
if (options.includeL1PublishInfo) {
|
|
92
|
+
(response as CheckpointResponse).l1 = l1PublishInfoFromL1PublishedData(pc.l1);
|
|
93
|
+
}
|
|
94
|
+
if (options.includeAttestations) {
|
|
95
|
+
(response as CheckpointResponse).attestations = pc.attestations;
|
|
96
|
+
}
|
|
97
|
+
return response;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Projects metadata-only {@link CheckpointData} into a {@link CheckpointResponse}. `includeBlocks` is ignored (no blocks loaded). */
|
|
101
|
+
export function checkpointResponseFromCheckpointData(
|
|
102
|
+
cd: CheckpointData,
|
|
103
|
+
options: CheckpointIncludeOptions,
|
|
104
|
+
): CheckpointResponse {
|
|
105
|
+
const response: CheckpointResponse = {
|
|
106
|
+
number: cd.checkpointNumber,
|
|
107
|
+
header: cd.header,
|
|
108
|
+
archive: cd.archive,
|
|
109
|
+
checkpointOutHash: cd.checkpointOutHash,
|
|
110
|
+
startBlock: cd.startBlock,
|
|
111
|
+
blockCount: cd.blockCount,
|
|
112
|
+
feeAssetPriceModifier: cd.feeAssetPriceModifier,
|
|
113
|
+
};
|
|
114
|
+
if (options.includeL1PublishInfo) {
|
|
115
|
+
(response as CheckpointResponse).l1 = l1PublishInfoFromL1PublishedData(cd.l1);
|
|
116
|
+
}
|
|
117
|
+
if (options.includeAttestations) {
|
|
118
|
+
(response as CheckpointResponse).attestations = cd.attestations;
|
|
119
|
+
}
|
|
120
|
+
return response;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Projects a {@link ProposedCheckpointData} into a {@link CheckpointResponse}.
|
|
125
|
+
* Pure projection — caller pre-fetches `blocks` via `blockSource.getBlocks(...)` when
|
|
126
|
+
* `options.includeBlocks` is true. Throws if `includeL1PublishInfo` or `includeAttestations`
|
|
127
|
+
* is requested (proposed checkpoints have no L1 publish info or attestations).
|
|
128
|
+
*/
|
|
129
|
+
export async function projectProposedToCheckpointResponse(
|
|
130
|
+
proposed: ProposedCheckpointData,
|
|
131
|
+
options: CheckpointIncludeOptions,
|
|
132
|
+
blocks?: L2Block[],
|
|
133
|
+
): Promise<CheckpointResponse> {
|
|
134
|
+
if (options.includeL1PublishInfo || options.includeAttestations) {
|
|
135
|
+
throw new Error('Proposed checkpoints have no L1 publish info or attestations');
|
|
136
|
+
}
|
|
137
|
+
const response: CheckpointResponse = {
|
|
138
|
+
number: proposed.checkpointNumber,
|
|
139
|
+
header: proposed.header,
|
|
140
|
+
archive: proposed.archive,
|
|
141
|
+
checkpointOutHash: proposed.checkpointOutHash,
|
|
142
|
+
startBlock: proposed.startBlock,
|
|
143
|
+
blockCount: proposed.blockCount,
|
|
144
|
+
feeAssetPriceModifier: proposed.feeAssetPriceModifier,
|
|
145
|
+
};
|
|
146
|
+
if (options.includeBlocks) {
|
|
147
|
+
if (!blocks) {
|
|
148
|
+
throw new Error('Blocks must be supplied when includeBlocks is true');
|
|
149
|
+
}
|
|
150
|
+
(response as CheckpointResponse).blocks = await Promise.all(
|
|
151
|
+
blocks.map(block =>
|
|
152
|
+
blockResponseFromL2Block(block, {
|
|
153
|
+
includeTransactions: options.includeTransactions,
|
|
154
|
+
includeL1PublishInfo: false,
|
|
155
|
+
includeAttestations: false,
|
|
156
|
+
}),
|
|
157
|
+
),
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
return response;
|
|
161
|
+
}
|
package/src/aztec-node/config.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
|
|
2
2
|
import { type GenesisStateConfig, genesisStateConfigMappings } from '@aztec/ethereum/config';
|
|
3
|
-
import { type L1ContractAddresses, l1ContractAddressesMapping } from '@aztec/ethereum/l1-contract-addresses';
|
|
4
3
|
import { type ConfigMappingsType, booleanConfigHelper, getConfigFromMappings } from '@aztec/foundation/config';
|
|
5
4
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
6
5
|
import {
|
|
@@ -53,8 +52,6 @@ export type AztecNodeConfig = ArchiverConfig &
|
|
|
53
52
|
NodeRPCConfig &
|
|
54
53
|
SlasherConfig &
|
|
55
54
|
ProverNodeConfig & {
|
|
56
|
-
/** L1 contracts addresses */
|
|
57
|
-
l1Contracts: L1ContractAddresses;
|
|
58
55
|
/** Whether the validator is disabled for this node */
|
|
59
56
|
disableValidator: boolean;
|
|
60
57
|
/** Whether to skip waiting for the archiver to be fully synced before starting other services */
|
|
@@ -63,6 +60,12 @@ export type AztecNodeConfig = ArchiverConfig &
|
|
|
63
60
|
debugForceTxProofVerification: boolean;
|
|
64
61
|
/** Whether to enable the prover node as a subsystem. */
|
|
65
62
|
enableProverNode: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Test-only: use the deterministic AutomineSequencer instead of the production Sequencer.
|
|
65
|
+
* Requires `aztecTargetCommitteeSize === 0` on the deployed rollup and anvil-backed L1.
|
|
66
|
+
* See `AUTOMINE_E2E_OPTS` in `end-to-end/src/fixtures/fixtures.ts`.
|
|
67
|
+
*/
|
|
68
|
+
useAutomineSequencer?: boolean;
|
|
66
69
|
};
|
|
67
70
|
|
|
68
71
|
export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
@@ -81,10 +84,6 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
|
81
84
|
...nodeRpcConfigMappings,
|
|
82
85
|
...slasherConfigMappings,
|
|
83
86
|
...specificProverNodeConfigMappings,
|
|
84
|
-
l1Contracts: {
|
|
85
|
-
description: 'The deployed L1 contract addresses',
|
|
86
|
-
nested: l1ContractAddressesMapping,
|
|
87
|
-
},
|
|
88
87
|
disableValidator: {
|
|
89
88
|
env: 'VALIDATOR_DISABLED',
|
|
90
89
|
description: 'Whether the validator is disabled for this node.',
|
|
@@ -105,6 +104,11 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
|
105
104
|
description: 'Whether to enable the prover node as a subsystem.',
|
|
106
105
|
...booleanConfigHelper(false),
|
|
107
106
|
},
|
|
107
|
+
useAutomineSequencer: {
|
|
108
|
+
env: 'USE_AUTOMINE_SEQUENCER',
|
|
109
|
+
description: 'Test-only: use AutomineSequencer instead of the production Sequencer.',
|
|
110
|
+
...booleanConfigHelper(false),
|
|
111
|
+
},
|
|
108
112
|
};
|
|
109
113
|
|
|
110
114
|
/**
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PublicDataWrite } from '@aztec/stdlib/avm';
|
|
2
|
+
import { computePublicDataTreeLeafSlot } from '@aztec/stdlib/hash';
|
|
3
|
+
import type { PublicStorageOverride } from '@aztec/stdlib/interfaces/client';
|
|
4
|
+
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
|
|
5
|
+
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Injects public-state overrides into an (ephemeral) world-state fork before simulation.
|
|
9
|
+
*
|
|
10
|
+
* Each override is written via the same `sequentialInsert` path the public processor
|
|
11
|
+
* uses during real transaction execution, so low-leaf updates and root coherence are
|
|
12
|
+
* handled identically for both simulation and proof generation.
|
|
13
|
+
*
|
|
14
|
+
* Writes never reach committed world state — the fork is thrown away after simulation.
|
|
15
|
+
*/
|
|
16
|
+
export async function applyPublicDataOverrides(
|
|
17
|
+
fork: MerkleTreeWriteOperations,
|
|
18
|
+
publicStorage: PublicStorageOverride[] | undefined,
|
|
19
|
+
): Promise<void> {
|
|
20
|
+
if (!publicStorage?.length) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const writes = await Promise.all(
|
|
25
|
+
publicStorage.map(async o => {
|
|
26
|
+
const leafSlot = await computePublicDataTreeLeafSlot(o.contract, o.slot);
|
|
27
|
+
return new PublicDataWrite(leafSlot, o.value);
|
|
28
|
+
}),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
await fork.sequentialInsert(
|
|
32
|
+
MerkleTreeId.PUBLIC_DATA_TREE,
|
|
33
|
+
writes.map(w => w.toBuffer()),
|
|
34
|
+
);
|
|
35
|
+
}
|