@aztec/aztec-node 1.0.0-nightly.20250611 → 1.0.0-nightly.20250613
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/server.d.ts +11 -6
- package/dest/aztec-node/server.d.ts.map +1 -1
- package/dest/aztec-node/server.js +35 -8
- package/package.json +23 -23
- package/src/aztec-node/server.ts +44 -13
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type BlobSinkClientInterface } from '@aztec/blob-sink/client';
|
|
2
|
-
import {
|
|
2
|
+
import { ARCHIVE_HEIGHT, type L1_TO_L2_MSG_TREE_HEIGHT, type NOTE_HASH_TREE_HEIGHT, type NULLIFIER_TREE_HEIGHT, type PUBLIC_DATA_TREE_HEIGHT } from '@aztec/constants';
|
|
3
3
|
import { type L1ContractAddresses } from '@aztec/ethereum';
|
|
4
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
5
5
|
import { type Logger } from '@aztec/foundation/log';
|
|
6
6
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
7
|
-
import { SiblingPath } from '@aztec/foundation/trees';
|
|
7
|
+
import { MembershipWitness, SiblingPath } from '@aztec/foundation/trees';
|
|
8
8
|
import { type P2P } from '@aztec/p2p';
|
|
9
9
|
import { SequencerClient, type SequencerPublisher } from '@aztec/sequencer-client';
|
|
10
10
|
import { EpochPruneWatcher, SlasherClient } from '@aztec/slasher';
|
|
@@ -58,7 +58,7 @@ export declare class AztecNodeService implements AztecNode, AztecNodeAdmin, Trac
|
|
|
58
58
|
* @param config - The configuration to be used by the aztec node.
|
|
59
59
|
* @returns - A fully synced Aztec Node for use in development/testing.
|
|
60
60
|
*/
|
|
61
|
-
static createAndSync(
|
|
61
|
+
static createAndSync(inputConfig: AztecNodeConfig, deps?: {
|
|
62
62
|
telemetry?: TelemetryClient;
|
|
63
63
|
logger?: Logger;
|
|
64
64
|
publisher?: SequencerPublisher;
|
|
@@ -139,10 +139,11 @@ export declare class AztecNodeService implements AztecNode, AztecNodeAdmin, Trac
|
|
|
139
139
|
/**
|
|
140
140
|
* Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
|
|
141
141
|
* @param tags - The tags to filter the logs by.
|
|
142
|
+
* @param logsPerTag - The maximum number of logs to return for each tag. By default no limit is set
|
|
142
143
|
* @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
|
|
143
144
|
* that tag.
|
|
144
145
|
*/
|
|
145
|
-
getLogsByTags(tags: Fr[]): Promise<TxScopedL2Log[][]>;
|
|
146
|
+
getLogsByTags(tags: Fr[], logsPerTag?: number): Promise<TxScopedL2Log[][]>;
|
|
146
147
|
/**
|
|
147
148
|
* Gets public logs based on the provided filter.
|
|
148
149
|
* @param filter - The filter to apply to the logs.
|
|
@@ -168,9 +169,11 @@ export declare class AztecNodeService implements AztecNode, AztecNodeAdmin, Trac
|
|
|
168
169
|
stop(): Promise<void>;
|
|
169
170
|
/**
|
|
170
171
|
* Method to retrieve pending txs.
|
|
172
|
+
* @param limit - The number of items to returns
|
|
173
|
+
* @param after - The last known pending tx. Used for pagination
|
|
171
174
|
* @returns - The pending txs.
|
|
172
175
|
*/
|
|
173
|
-
getPendingTxs(): Promise<Tx[]>;
|
|
176
|
+
getPendingTxs(limit?: number, after?: TxHash): Promise<Tx[]>;
|
|
174
177
|
getPendingTxCount(): Promise<number>;
|
|
175
178
|
/**
|
|
176
179
|
* Method to retrieve a single tx from the mempool or unfinalised chain.
|
|
@@ -207,6 +210,8 @@ export declare class AztecNodeService implements AztecNode, AztecNodeAdmin, Trac
|
|
|
207
210
|
* @returns The sibling path for the leaf index.
|
|
208
211
|
*/
|
|
209
212
|
getNoteHashSiblingPath(blockNumber: L2BlockNumber, leafIndex: bigint): Promise<SiblingPath<typeof NOTE_HASH_TREE_HEIGHT>>;
|
|
213
|
+
getArchiveMembershipWitness(blockNumber: L2BlockNumber, archive: Fr): Promise<MembershipWitness<typeof ARCHIVE_HEIGHT> | undefined>;
|
|
214
|
+
getNoteHashMembershipWitness(blockNumber: L2BlockNumber, noteHash: Fr): Promise<MembershipWitness<typeof NOTE_HASH_TREE_HEIGHT> | undefined>;
|
|
210
215
|
/**
|
|
211
216
|
* Returns the index and a sibling path for a leaf in the committed l1 to l2 data tree.
|
|
212
217
|
* @param blockNumber - The block number at which to get the data.
|
|
@@ -291,7 +296,7 @@ export declare class AztecNodeService implements AztecNode, AztecNodeAdmin, Trac
|
|
|
291
296
|
}): Promise<TxValidationResult>;
|
|
292
297
|
setConfig(config: Partial<SequencerConfig & ProverConfig>): Promise<void>;
|
|
293
298
|
getProtocolContractAddresses(): Promise<ProtocolContractAddresses>;
|
|
294
|
-
registerContractFunctionSignatures(
|
|
299
|
+
registerContractFunctionSignatures(signatures: string[]): Promise<void>;
|
|
295
300
|
flushTxs(): Promise<void>;
|
|
296
301
|
getValidatorsStats(): Promise<ValidatorsStats>;
|
|
297
302
|
startSnapshotUpload(location: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/aztec-node/server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/aztec-node/server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EACL,cAAc,EAEd,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEL,KAAK,mBAAmB,EAKzB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAGlE,OA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AAI,CAAC;IAMhC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CA6CnC"}
|
|
@@ -19,6 +19,7 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
19
19
|
import { SerialQueue } from '@aztec/foundation/queue';
|
|
20
20
|
import { count } from '@aztec/foundation/string';
|
|
21
21
|
import { DateProvider, Timer } from '@aztec/foundation/timer';
|
|
22
|
+
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
22
23
|
import { trySnapshotSync, uploadSnapshot } from '@aztec/node-lib/actions';
|
|
23
24
|
import { TxCollector, createP2PClient, getDefaultAllowedSetupFunctions } from '@aztec/p2p';
|
|
24
25
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
@@ -103,7 +104,10 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
103
104
|
* initializes the Aztec Node, wait for component to sync.
|
|
104
105
|
* @param config - The configuration to be used by the aztec node.
|
|
105
106
|
* @returns - A fully synced Aztec Node for use in development/testing.
|
|
106
|
-
*/ static async createAndSync(
|
|
107
|
+
*/ static async createAndSync(inputConfig, deps = {}, options = {}) {
|
|
108
|
+
const config = {
|
|
109
|
+
...inputConfig
|
|
110
|
+
}; // Copy the config so we dont mutate the input object
|
|
107
111
|
const log = deps.logger ?? createLogger('node');
|
|
108
112
|
const packageVersion = getPackageVersion() ?? '';
|
|
109
113
|
const telemetry = deps.telemetry ?? getTelemetryClient();
|
|
@@ -344,10 +348,11 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
344
348
|
/**
|
|
345
349
|
* Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
|
|
346
350
|
* @param tags - The tags to filter the logs by.
|
|
351
|
+
* @param logsPerTag - The maximum number of logs to return for each tag. By default no limit is set
|
|
347
352
|
* @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
|
|
348
353
|
* that tag.
|
|
349
|
-
*/ getLogsByTags(tags) {
|
|
350
|
-
return this.logsSource.getLogsByTags(tags);
|
|
354
|
+
*/ getLogsByTags(tags, logsPerTag) {
|
|
355
|
+
return this.logsSource.getLogsByTags(tags, logsPerTag);
|
|
351
356
|
}
|
|
352
357
|
/**
|
|
353
358
|
* Gets public logs based on the provided filter.
|
|
@@ -422,9 +427,11 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
422
427
|
}
|
|
423
428
|
/**
|
|
424
429
|
* Method to retrieve pending txs.
|
|
430
|
+
* @param limit - The number of items to returns
|
|
431
|
+
* @param after - The last known pending tx. Used for pagination
|
|
425
432
|
* @returns - The pending txs.
|
|
426
|
-
*/ getPendingTxs() {
|
|
427
|
-
return this.p2pClient.getPendingTxs();
|
|
433
|
+
*/ getPendingTxs(limit, after) {
|
|
434
|
+
return this.p2pClient.getPendingTxs(limit, after);
|
|
428
435
|
}
|
|
429
436
|
getPendingTxCount() {
|
|
430
437
|
return this.p2pClient.getPendingTxCount();
|
|
@@ -517,6 +524,26 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
517
524
|
const committedDb = await this.#getWorldState(blockNumber);
|
|
518
525
|
return committedDb.getSiblingPath(MerkleTreeId.NOTE_HASH_TREE, leafIndex);
|
|
519
526
|
}
|
|
527
|
+
async getArchiveMembershipWitness(blockNumber, archive) {
|
|
528
|
+
const committedDb = await this.#getWorldState(blockNumber);
|
|
529
|
+
const [index] = await committedDb.findLeafIndices(MerkleTreeId.ARCHIVE, [
|
|
530
|
+
archive
|
|
531
|
+
]);
|
|
532
|
+
if (index === undefined) {
|
|
533
|
+
return undefined;
|
|
534
|
+
}
|
|
535
|
+
return MembershipWitness.fromSiblingPath(index, await committedDb.getSiblingPath(MerkleTreeId.ARCHIVE, index));
|
|
536
|
+
}
|
|
537
|
+
async getNoteHashMembershipWitness(blockNumber, noteHash) {
|
|
538
|
+
const committedDb = await this.#getWorldState(blockNumber);
|
|
539
|
+
const [index] = await committedDb.findLeafIndices(MerkleTreeId.NOTE_HASH_TREE, [
|
|
540
|
+
noteHash
|
|
541
|
+
]);
|
|
542
|
+
if (index === undefined) {
|
|
543
|
+
return undefined;
|
|
544
|
+
}
|
|
545
|
+
return MembershipWitness.fromSiblingPath(index, await committedDb.getSiblingPath(MerkleTreeId.NOTE_HASH_TREE, index));
|
|
546
|
+
}
|
|
520
547
|
/**
|
|
521
548
|
* Returns the index and a sibling path for a leaf in the committed l1 to l2 data tree.
|
|
522
549
|
* @param blockNumber - The block number at which to get the data.
|
|
@@ -671,7 +698,7 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
671
698
|
// If sequencer is not initialized, we just set these values to zero for simulation.
|
|
672
699
|
const coinbase = this.sequencer?.coinbase || EthAddress.ZERO;
|
|
673
700
|
const feeRecipient = this.sequencer?.feeRecipient || AztecAddress.ZERO;
|
|
674
|
-
const newGlobalVariables = await this.globalVariableBuilder.buildGlobalVariables(
|
|
701
|
+
const newGlobalVariables = await this.globalVariableBuilder.buildGlobalVariables(blockNumber, coinbase, feeRecipient);
|
|
675
702
|
const publicProcessorFactory = new PublicProcessorFactory(this.contractDataSource, new DateProvider(), this.telemetry);
|
|
676
703
|
this.log.verbose(`Simulating public calls for tx ${txHash}`, {
|
|
677
704
|
globalVariables: newGlobalVariables.toInspect(),
|
|
@@ -733,8 +760,8 @@ import { NodeMetrics } from './node_metrics.js';
|
|
|
733
760
|
multiCallEntrypoint: ProtocolContractAddress.MultiCallEntrypoint
|
|
734
761
|
});
|
|
735
762
|
}
|
|
736
|
-
registerContractFunctionSignatures(
|
|
737
|
-
return this.contractDataSource.registerContractFunctionSignatures(
|
|
763
|
+
registerContractFunctionSignatures(signatures) {
|
|
764
|
+
return this.contractDataSource.registerContractFunctionSignatures(signatures);
|
|
738
765
|
}
|
|
739
766
|
flushTxs() {
|
|
740
767
|
if (!this.sequencer) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec-node",
|
|
3
|
-
"version": "1.0.0-nightly.
|
|
3
|
+
"version": "1.0.0-nightly.20250613",
|
|
4
4
|
"main": "dest/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -62,28 +62,28 @@
|
|
|
62
62
|
"testEnvironment": "../../foundation/src/jest/env.mjs"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@aztec/archiver": "1.0.0-nightly.
|
|
66
|
-
"@aztec/bb-prover": "1.0.0-nightly.
|
|
67
|
-
"@aztec/blob-sink": "1.0.0-nightly.
|
|
68
|
-
"@aztec/constants": "1.0.0-nightly.
|
|
69
|
-
"@aztec/epoch-cache": "1.0.0-nightly.
|
|
70
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
71
|
-
"@aztec/foundation": "1.0.0-nightly.
|
|
72
|
-
"@aztec/kv-store": "1.0.0-nightly.
|
|
73
|
-
"@aztec/l1-artifacts": "1.0.0-nightly.
|
|
74
|
-
"@aztec/merkle-tree": "1.0.0-nightly.
|
|
75
|
-
"@aztec/node-lib": "1.0.0-nightly.
|
|
76
|
-
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.
|
|
77
|
-
"@aztec/p2p": "1.0.0-nightly.
|
|
78
|
-
"@aztec/protocol-contracts": "1.0.0-nightly.
|
|
79
|
-
"@aztec/prover-client": "1.0.0-nightly.
|
|
80
|
-
"@aztec/sequencer-client": "1.0.0-nightly.
|
|
81
|
-
"@aztec/simulator": "1.0.0-nightly.
|
|
82
|
-
"@aztec/slasher": "1.0.0-nightly.
|
|
83
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
84
|
-
"@aztec/telemetry-client": "1.0.0-nightly.
|
|
85
|
-
"@aztec/validator-client": "1.0.0-nightly.
|
|
86
|
-
"@aztec/world-state": "1.0.0-nightly.
|
|
65
|
+
"@aztec/archiver": "1.0.0-nightly.20250613",
|
|
66
|
+
"@aztec/bb-prover": "1.0.0-nightly.20250613",
|
|
67
|
+
"@aztec/blob-sink": "1.0.0-nightly.20250613",
|
|
68
|
+
"@aztec/constants": "1.0.0-nightly.20250613",
|
|
69
|
+
"@aztec/epoch-cache": "1.0.0-nightly.20250613",
|
|
70
|
+
"@aztec/ethereum": "1.0.0-nightly.20250613",
|
|
71
|
+
"@aztec/foundation": "1.0.0-nightly.20250613",
|
|
72
|
+
"@aztec/kv-store": "1.0.0-nightly.20250613",
|
|
73
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250613",
|
|
74
|
+
"@aztec/merkle-tree": "1.0.0-nightly.20250613",
|
|
75
|
+
"@aztec/node-lib": "1.0.0-nightly.20250613",
|
|
76
|
+
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250613",
|
|
77
|
+
"@aztec/p2p": "1.0.0-nightly.20250613",
|
|
78
|
+
"@aztec/protocol-contracts": "1.0.0-nightly.20250613",
|
|
79
|
+
"@aztec/prover-client": "1.0.0-nightly.20250613",
|
|
80
|
+
"@aztec/sequencer-client": "1.0.0-nightly.20250613",
|
|
81
|
+
"@aztec/simulator": "1.0.0-nightly.20250613",
|
|
82
|
+
"@aztec/slasher": "1.0.0-nightly.20250613",
|
|
83
|
+
"@aztec/stdlib": "1.0.0-nightly.20250613",
|
|
84
|
+
"@aztec/telemetry-client": "1.0.0-nightly.20250613",
|
|
85
|
+
"@aztec/validator-client": "1.0.0-nightly.20250613",
|
|
86
|
+
"@aztec/world-state": "1.0.0-nightly.20250613",
|
|
87
87
|
"koa": "^2.16.1",
|
|
88
88
|
"koa-router": "^12.0.0",
|
|
89
89
|
"tslib": "^2.4.0",
|
package/src/aztec-node/server.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Archiver, createArchiver } from '@aztec/archiver';
|
|
|
2
2
|
import { BBCircuitVerifier, QueuedIVCVerifier, TestCircuitVerifier } from '@aztec/bb-prover';
|
|
3
3
|
import { type BlobSinkClientInterface, createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
ARCHIVE_HEIGHT,
|
|
6
6
|
INITIAL_L2_BLOCK_NUM,
|
|
7
7
|
type L1_TO_L2_MSG_TREE_HEIGHT,
|
|
8
8
|
type NOTE_HASH_TREE_HEIGHT,
|
|
@@ -27,7 +27,7 @@ import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
|
27
27
|
import { SerialQueue } from '@aztec/foundation/queue';
|
|
28
28
|
import { count } from '@aztec/foundation/string';
|
|
29
29
|
import { DateProvider, Timer } from '@aztec/foundation/timer';
|
|
30
|
-
import { SiblingPath } from '@aztec/foundation/trees';
|
|
30
|
+
import { MembershipWitness, SiblingPath } from '@aztec/foundation/trees';
|
|
31
31
|
import { trySnapshotSync, uploadSnapshot } from '@aztec/node-lib/actions';
|
|
32
32
|
import { type P2P, TxCollector, createP2PClient, getDefaultAllowedSetupFunctions } from '@aztec/p2p';
|
|
33
33
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
@@ -160,7 +160,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
160
160
|
* @returns - A fully synced Aztec Node for use in development/testing.
|
|
161
161
|
*/
|
|
162
162
|
public static async createAndSync(
|
|
163
|
-
|
|
163
|
+
inputConfig: AztecNodeConfig,
|
|
164
164
|
deps: {
|
|
165
165
|
telemetry?: TelemetryClient;
|
|
166
166
|
logger?: Logger;
|
|
@@ -172,6 +172,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
172
172
|
prefilledPublicData?: PublicDataTreeLeaf[];
|
|
173
173
|
} = {},
|
|
174
174
|
): Promise<AztecNodeService> {
|
|
175
|
+
const config = { ...inputConfig }; // Copy the config so we dont mutate the input object
|
|
175
176
|
const log = deps.logger ?? createLogger('node');
|
|
176
177
|
const packageVersion = getPackageVersion() ?? '';
|
|
177
178
|
const telemetry = deps.telemetry ?? getTelemetryClient();
|
|
@@ -519,11 +520,12 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
519
520
|
/**
|
|
520
521
|
* Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
|
|
521
522
|
* @param tags - The tags to filter the logs by.
|
|
523
|
+
* @param logsPerTag - The maximum number of logs to return for each tag. By default no limit is set
|
|
522
524
|
* @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
|
|
523
525
|
* that tag.
|
|
524
526
|
*/
|
|
525
|
-
public getLogsByTags(tags: Fr[]): Promise<TxScopedL2Log[][]> {
|
|
526
|
-
return this.logsSource.getLogsByTags(tags);
|
|
527
|
+
public getLogsByTags(tags: Fr[], logsPerTag?: number): Promise<TxScopedL2Log[][]> {
|
|
528
|
+
return this.logsSource.getLogsByTags(tags, logsPerTag);
|
|
527
529
|
}
|
|
528
530
|
|
|
529
531
|
/**
|
|
@@ -611,13 +613,15 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
611
613
|
|
|
612
614
|
/**
|
|
613
615
|
* Method to retrieve pending txs.
|
|
616
|
+
* @param limit - The number of items to returns
|
|
617
|
+
* @param after - The last known pending tx. Used for pagination
|
|
614
618
|
* @returns - The pending txs.
|
|
615
619
|
*/
|
|
616
|
-
public getPendingTxs() {
|
|
617
|
-
return this.p2pClient!.getPendingTxs();
|
|
620
|
+
public getPendingTxs(limit?: number, after?: TxHash): Promise<Tx[]> {
|
|
621
|
+
return this.p2pClient!.getPendingTxs(limit, after);
|
|
618
622
|
}
|
|
619
623
|
|
|
620
|
-
public getPendingTxCount() {
|
|
624
|
+
public getPendingTxCount(): Promise<number> {
|
|
621
625
|
return this.p2pClient!.getPendingTxCount();
|
|
622
626
|
}
|
|
623
627
|
|
|
@@ -626,7 +630,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
626
630
|
* @param txHash - The transaction hash to return.
|
|
627
631
|
* @returns - The tx if it exists.
|
|
628
632
|
*/
|
|
629
|
-
public getTxByHash(txHash: TxHash) {
|
|
633
|
+
public getTxByHash(txHash: TxHash): Promise<Tx | undefined> {
|
|
630
634
|
return Promise.resolve(this.p2pClient!.getTxByHashFromPool(txHash));
|
|
631
635
|
}
|
|
632
636
|
|
|
@@ -635,7 +639,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
635
639
|
* @param txHash - The transaction hash to return.
|
|
636
640
|
* @returns - The txs if it exists.
|
|
637
641
|
*/
|
|
638
|
-
public async getTxsByHash(txHashes: TxHash[]) {
|
|
642
|
+
public async getTxsByHash(txHashes: TxHash[]): Promise<Tx[]> {
|
|
639
643
|
return compactArray(await Promise.all(txHashes.map(txHash => this.getTxByHash(txHash))));
|
|
640
644
|
}
|
|
641
645
|
|
|
@@ -738,6 +742,33 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
738
742
|
return committedDb.getSiblingPath(MerkleTreeId.NOTE_HASH_TREE, leafIndex);
|
|
739
743
|
}
|
|
740
744
|
|
|
745
|
+
public async getArchiveMembershipWitness(
|
|
746
|
+
blockNumber: L2BlockNumber,
|
|
747
|
+
archive: Fr,
|
|
748
|
+
): Promise<MembershipWitness<typeof ARCHIVE_HEIGHT> | undefined> {
|
|
749
|
+
const committedDb = await this.#getWorldState(blockNumber);
|
|
750
|
+
const [index] = await committedDb.findLeafIndices(MerkleTreeId.ARCHIVE, [archive]);
|
|
751
|
+
if (index === undefined) {
|
|
752
|
+
return undefined;
|
|
753
|
+
}
|
|
754
|
+
return MembershipWitness.fromSiblingPath(index, await committedDb.getSiblingPath(MerkleTreeId.ARCHIVE, index));
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
public async getNoteHashMembershipWitness(
|
|
758
|
+
blockNumber: L2BlockNumber,
|
|
759
|
+
noteHash: Fr,
|
|
760
|
+
): Promise<MembershipWitness<typeof NOTE_HASH_TREE_HEIGHT> | undefined> {
|
|
761
|
+
const committedDb = await this.#getWorldState(blockNumber);
|
|
762
|
+
const [index] = await committedDb.findLeafIndices(MerkleTreeId.NOTE_HASH_TREE, [noteHash]);
|
|
763
|
+
if (index === undefined) {
|
|
764
|
+
return undefined;
|
|
765
|
+
}
|
|
766
|
+
return MembershipWitness.fromSiblingPath(
|
|
767
|
+
index,
|
|
768
|
+
await committedDb.getSiblingPath(MerkleTreeId.NOTE_HASH_TREE, index),
|
|
769
|
+
);
|
|
770
|
+
}
|
|
771
|
+
|
|
741
772
|
/**
|
|
742
773
|
* Returns the index and a sibling path for a leaf in the committed l1 to l2 data tree.
|
|
743
774
|
* @param blockNumber - The block number at which to get the data.
|
|
@@ -958,7 +989,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
958
989
|
const feeRecipient = this.sequencer?.feeRecipient || AztecAddress.ZERO;
|
|
959
990
|
|
|
960
991
|
const newGlobalVariables = await this.globalVariableBuilder.buildGlobalVariables(
|
|
961
|
-
|
|
992
|
+
blockNumber,
|
|
962
993
|
coinbase,
|
|
963
994
|
feeRecipient,
|
|
964
995
|
);
|
|
@@ -1045,8 +1076,8 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
1045
1076
|
});
|
|
1046
1077
|
}
|
|
1047
1078
|
|
|
1048
|
-
public registerContractFunctionSignatures(
|
|
1049
|
-
return this.contractDataSource.registerContractFunctionSignatures(
|
|
1079
|
+
public registerContractFunctionSignatures(signatures: string[]): Promise<void> {
|
|
1080
|
+
return this.contractDataSource.registerContractFunctionSignatures(signatures);
|
|
1050
1081
|
}
|
|
1051
1082
|
|
|
1052
1083
|
public flushTxs(): Promise<void> {
|