@aztec/stdlib 0.84.0 → 0.85.0
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/avm/avm.d.ts +2474 -284
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +116 -17
- package/dest/avm/avm_proving_request.d.ts +1071 -23
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/block/in_block.d.ts.map +1 -1
- package/dest/block/index.d.ts +1 -1
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -1
- package/dest/block/l2_block_source.d.ts +8 -5
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +9 -0
- package/dest/block/l2_block_stream/index.d.ts +4 -0
- package/dest/block/l2_block_stream/index.d.ts.map +1 -0
- package/dest/block/l2_block_stream/index.js +3 -0
- package/dest/block/l2_block_stream/interfaces.d.ts +26 -0
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -0
- package/dest/block/l2_block_stream/interfaces.js +1 -0
- package/dest/block/{l2_block_downloader → l2_block_stream}/l2_block_stream.d.ts +4 -24
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -0
- package/dest/block/{l2_block_downloader → l2_block_stream}/l2_block_stream.js +29 -10
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +18 -0
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -0
- package/dest/block/l2_block_stream/l2_tips_memory_store.js +70 -0
- package/dest/block/test/index.d.ts +2 -0
- package/dest/block/test/index.d.ts.map +1 -0
- package/dest/block/test/index.js +1 -0
- package/dest/block/test/l2_tips_store_test_suite.d.ts +3 -0
- package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -0
- package/dest/block/test/l2_tips_store_test_suite.js +107 -0
- package/dest/database-version/version_manager.d.ts +21 -5
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +25 -15
- package/dest/epoch-helpers/index.d.ts +9 -0
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +15 -2
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +4 -4
- package/dest/interfaces/aztec-node.d.ts +5 -6
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +2 -3
- package/dest/interfaces/proving-job.d.ts +1071 -23
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/pxe.d.ts +5 -7
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +2 -7
- package/dest/interfaces/world_state.d.ts +3 -2
- package/dest/interfaces/world_state.d.ts.map +1 -1
- package/dest/logs/log_with_tx_data.d.ts +3 -2
- package/dest/logs/log_with_tx_data.d.ts.map +1 -1
- package/dest/logs/log_with_tx_data.js +3 -2
- package/dest/logs/pending_tagged_log.d.ts +4 -2
- package/dest/logs/pending_tagged_log.d.ts.map +1 -1
- package/dest/logs/pending_tagged_log.js +6 -3
- package/dest/messaging/l1_to_l2_message_source.d.ts +5 -0
- package/dest/messaging/l1_to_l2_message_source.d.ts.map +1 -1
- package/dest/proofs/proof.d.ts +4 -1
- package/dest/proofs/proof.d.ts.map +1 -1
- package/dest/proofs/proof.js +9 -17
- package/dest/tests/factories.d.ts +5 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +23 -7
- package/dest/tests/mocks.d.ts +3 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +3 -2
- package/dest/tx/index.d.ts +2 -0
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +2 -0
- package/dest/tx/indexed_tx_effect.d.ts +24 -0
- package/dest/tx/indexed_tx_effect.d.ts.map +1 -0
- package/dest/tx/indexed_tx_effect.js +14 -0
- package/dest/tx/tx_hash.d.ts.map +1 -1
- package/dest/tx/tx_hash.js +1 -4
- package/dest/tx/validator/error_texts.d.ts +20 -0
- package/dest/tx/validator/error_texts.d.ts.map +1 -0
- package/dest/tx/validator/error_texts.js +27 -0
- package/package.json +8 -6
- package/src/avm/avm.ts +188 -29
- package/src/block/in_block.ts +1 -0
- package/src/block/index.ts +1 -1
- package/src/block/l2_block_source.ts +15 -5
- package/src/block/l2_block_stream/index.ts +3 -0
- package/src/block/l2_block_stream/interfaces.ts +33 -0
- package/src/block/{l2_block_downloader → l2_block_stream}/l2_block_stream.ts +34 -44
- package/src/block/l2_block_stream/l2_tips_memory_store.ts +75 -0
- package/src/block/test/index.ts +1 -0
- package/src/block/test/l2_tips_store_test_suite.ts +87 -0
- package/src/database-version/version_manager.ts +56 -17
- package/src/epoch-helpers/index.ts +19 -0
- package/src/interfaces/archiver.ts +3 -3
- package/src/interfaces/aztec-node.ts +7 -6
- package/src/interfaces/pxe.ts +15 -11
- package/src/interfaces/world_state.ts +3 -2
- package/src/logs/log_with_tx_data.ts +4 -3
- package/src/logs/pending_tagged_log.ts +5 -2
- package/src/messaging/l1_to_l2_message_source.ts +7 -0
- package/src/proofs/proof.ts +9 -19
- package/src/tests/factories.ts +54 -4
- package/src/tests/mocks.ts +6 -1
- package/src/tx/index.ts +2 -0
- package/src/tx/indexed_tx_effect.ts +17 -0
- package/src/tx/tx_hash.ts +0 -4
- package/src/tx/validator/error_texts.ts +34 -0
- package/dest/block/l2_block_downloader/index.d.ts +0 -3
- package/dest/block/l2_block_downloader/index.d.ts.map +0 -1
- package/dest/block/l2_block_downloader/index.js +0 -2
- package/dest/block/l2_block_downloader/l2_block_downloader.d.ts +0 -58
- package/dest/block/l2_block_downloader/l2_block_downloader.d.ts.map +0 -1
- package/dest/block/l2_block_downloader/l2_block_downloader.js +0 -124
- package/dest/block/l2_block_downloader/l2_block_stream.d.ts.map +0 -1
- package/src/block/l2_block_downloader/index.ts +0 -2
- package/src/block/l2_block_downloader/l2_block_downloader.ts +0 -149
|
@@ -10,7 +10,7 @@ import { z } from 'zod';
|
|
|
10
10
|
*/ export class DatabaseVersion {
|
|
11
11
|
schemaVersion;
|
|
12
12
|
rollupAddress;
|
|
13
|
-
constructor(schemaVersion, rollupAddress){
|
|
13
|
+
constructor(/** The version of the data on disk. Used to perform upgrades */ schemaVersion, /** The rollup the data pertains to */ rollupAddress){
|
|
14
14
|
this.schemaVersion = schemaVersion;
|
|
15
15
|
this.rollupAddress = rollupAddress;
|
|
16
16
|
}
|
|
@@ -57,7 +57,7 @@ import { z } from 'zod';
|
|
|
57
57
|
return this.toString();
|
|
58
58
|
}
|
|
59
59
|
toString() {
|
|
60
|
-
return this.schemaVersion.
|
|
60
|
+
return `DatabaseVersion{schemaVersion=${this.schemaVersion},rollupAddress=${this.rollupAddress}"}`;
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Returns an empty instance
|
|
@@ -71,14 +71,14 @@ export const DATABASE_VERSION_FILE_NAME = 'db_version';
|
|
|
71
71
|
* This class will check the version of data in a directory and either
|
|
72
72
|
* reset or upgrade based on version compatibility.
|
|
73
73
|
*/ export class DatabaseVersionManager {
|
|
74
|
+
static VERSION_FILE = DATABASE_VERSION_FILE_NAME;
|
|
75
|
+
versionFile;
|
|
76
|
+
currentVersion;
|
|
74
77
|
dataDirectory;
|
|
75
78
|
onOpen;
|
|
76
79
|
onUpgrade;
|
|
77
80
|
fileSystem;
|
|
78
81
|
log;
|
|
79
|
-
static VERSION_FILE = DATABASE_VERSION_FILE_NAME;
|
|
80
|
-
versionFile;
|
|
81
|
-
currentVersion;
|
|
82
82
|
/**
|
|
83
83
|
* Create a new version manager
|
|
84
84
|
*
|
|
@@ -90,17 +90,17 @@ export const DATABASE_VERSION_FILE_NAME = 'db_version';
|
|
|
90
90
|
* @param fileSystem - An interface to access the filesystem
|
|
91
91
|
* @param log - Optional custom logger
|
|
92
92
|
* @param options - Configuration options
|
|
93
|
-
*/ constructor(schemaVersion, rollupAddress, dataDirectory, onOpen, onUpgrade, fileSystem = fs, log = createLogger(`foundation:version-manager`)){
|
|
93
|
+
*/ constructor({ schemaVersion, rollupAddress, dataDirectory, onOpen, onUpgrade, fileSystem = fs, log = createLogger(`foundation:version-manager`) }){
|
|
94
|
+
if (schemaVersion < 1) {
|
|
95
|
+
throw new TypeError(`Invalid schema version received: ${schemaVersion}`);
|
|
96
|
+
}
|
|
97
|
+
this.versionFile = join(dataDirectory, DatabaseVersionManager.VERSION_FILE);
|
|
98
|
+
this.currentVersion = new DatabaseVersion(schemaVersion, rollupAddress);
|
|
94
99
|
this.dataDirectory = dataDirectory;
|
|
95
100
|
this.onOpen = onOpen;
|
|
96
101
|
this.onUpgrade = onUpgrade;
|
|
97
102
|
this.fileSystem = fileSystem;
|
|
98
103
|
this.log = log;
|
|
99
|
-
if (schemaVersion < 1) {
|
|
100
|
-
throw new TypeError(`Invalid schema version received: ${schemaVersion}`);
|
|
101
|
-
}
|
|
102
|
-
this.versionFile = join(this.dataDirectory, DatabaseVersionManager.VERSION_FILE);
|
|
103
|
-
this.currentVersion = new DatabaseVersion(schemaVersion, rollupAddress);
|
|
104
104
|
}
|
|
105
105
|
static async writeVersion(version, dataDir, fileSystem = fs) {
|
|
106
106
|
await fileSystem.mkdir(dataDir, {
|
|
@@ -118,12 +118,16 @@ export const DATABASE_VERSION_FILE_NAME = 'db_version';
|
|
|
118
118
|
*/ async open() {
|
|
119
119
|
// const storedVersion = await DatabaseVersion.readVersion(this.versionFile);
|
|
120
120
|
let storedVersion;
|
|
121
|
+
// a flag to suppress logs about 'resetting the data dir' when starting from an empty state
|
|
122
|
+
let shouldLogDataReset = true;
|
|
121
123
|
try {
|
|
122
124
|
const versionBuf = await this.fileSystem.readFile(this.versionFile);
|
|
123
125
|
storedVersion = DatabaseVersion.fromBuffer(versionBuf);
|
|
124
126
|
} catch (err) {
|
|
125
127
|
if (err && err.code === 'ENOENT') {
|
|
126
128
|
storedVersion = DatabaseVersion.empty();
|
|
129
|
+
// only turn off these logs if the data dir didn't exist before
|
|
130
|
+
shouldLogDataReset = false;
|
|
127
131
|
} else {
|
|
128
132
|
this.log.warn(`Failed to read stored version information: ${err}. Defaulting to empty version`);
|
|
129
133
|
storedVersion = DatabaseVersion.empty();
|
|
@@ -142,13 +146,19 @@ export const DATABASE_VERSION_FILE_NAME = 'db_version';
|
|
|
142
146
|
needsReset = true;
|
|
143
147
|
}
|
|
144
148
|
} else if (cmp !== 0) {
|
|
145
|
-
|
|
149
|
+
if (shouldLogDataReset) {
|
|
150
|
+
this.log.info(`Can't upgrade from version ${storedVersion} to ${this.currentVersion}. Resetting database at ${this.dataDirectory}`);
|
|
151
|
+
}
|
|
146
152
|
needsReset = true;
|
|
147
153
|
}
|
|
148
154
|
} else {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
155
|
+
if (shouldLogDataReset) {
|
|
156
|
+
this.log.warn('Rollup address has changed, resetting data directory', {
|
|
157
|
+
versionFile: this.versionFile,
|
|
158
|
+
storedVersion,
|
|
159
|
+
currentVersion: this.currentVersion
|
|
160
|
+
});
|
|
161
|
+
}
|
|
152
162
|
needsReset = true;
|
|
153
163
|
}
|
|
154
164
|
// Handle reset if needed
|
|
@@ -5,6 +5,7 @@ export type L1RollupConstants = {
|
|
|
5
5
|
slotDuration: number;
|
|
6
6
|
epochDuration: number;
|
|
7
7
|
ethereumSlotDuration: number;
|
|
8
|
+
proofSubmissionWindow: number;
|
|
8
9
|
};
|
|
9
10
|
export declare const EmptyL1RollupConstants: L1RollupConstants;
|
|
10
11
|
export declare const L1RollupConstantsSchema: z.ZodObject<{
|
|
@@ -13,18 +14,21 @@ export declare const L1RollupConstantsSchema: z.ZodObject<{
|
|
|
13
14
|
slotDuration: z.ZodNumber;
|
|
14
15
|
epochDuration: z.ZodNumber;
|
|
15
16
|
ethereumSlotDuration: z.ZodNumber;
|
|
17
|
+
proofSubmissionWindow: z.ZodNumber;
|
|
16
18
|
}, "strip", z.ZodTypeAny, {
|
|
17
19
|
l1StartBlock: bigint;
|
|
18
20
|
l1GenesisTime: bigint;
|
|
19
21
|
slotDuration: number;
|
|
20
22
|
epochDuration: number;
|
|
21
23
|
ethereumSlotDuration: number;
|
|
24
|
+
proofSubmissionWindow: number;
|
|
22
25
|
}, {
|
|
23
26
|
l1StartBlock: string | number | bigint;
|
|
24
27
|
l1GenesisTime: string | number | bigint;
|
|
25
28
|
slotDuration: number;
|
|
26
29
|
epochDuration: number;
|
|
27
30
|
ethereumSlotDuration: number;
|
|
31
|
+
proofSubmissionWindow: number;
|
|
28
32
|
}>;
|
|
29
33
|
/** Returns the timestamp for a given L2 slot. */
|
|
30
34
|
export declare function getTimestampForSlot(slot: bigint, constants: Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration'>): bigint;
|
|
@@ -41,4 +45,9 @@ export declare function getSlotRangeForEpoch(epochNumber: bigint, constants: Pic
|
|
|
41
45
|
* Note that the endTimestamp is the start timestamp of the last L1 slot for the epoch.
|
|
42
46
|
*/
|
|
43
47
|
export declare function getTimestampRangeForEpoch(epochNumber: bigint, constants: Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration' | 'epochDuration' | 'ethereumSlotDuration'>): bigint[];
|
|
48
|
+
/**
|
|
49
|
+
* Returns the deadline timestamp (in seconds) for submitting a proof for a given epoch.
|
|
50
|
+
* Computed as the start of the given epoch plus the proof submission window.
|
|
51
|
+
*/
|
|
52
|
+
export declare function getProofSubmissionDeadlineTimestamp(epochNumber: bigint, constants: Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration' | 'epochDuration' | 'proofSubmissionWindow'>): bigint;
|
|
44
53
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/epoch-helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY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GAGG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,eAAe,GAAG,cAAc,GAAG,eAAe,GAAG,sBAAsB,CAAC,YAUhH;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,CACjD,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,eAAe,GAAG,cAAc,GAAG,eAAe,GAAG,uBAAuB,CAAC,UAQjH"}
|
|
@@ -5,14 +5,16 @@ export const EmptyL1RollupConstants = {
|
|
|
5
5
|
l1GenesisTime: 0n,
|
|
6
6
|
epochDuration: 1,
|
|
7
7
|
slotDuration: 1,
|
|
8
|
-
ethereumSlotDuration: 1
|
|
8
|
+
ethereumSlotDuration: 1,
|
|
9
|
+
proofSubmissionWindow: 2
|
|
9
10
|
};
|
|
10
11
|
export const L1RollupConstantsSchema = z.object({
|
|
11
12
|
l1StartBlock: schemas.BigInt,
|
|
12
13
|
l1GenesisTime: schemas.BigInt,
|
|
13
14
|
slotDuration: z.number(),
|
|
14
15
|
epochDuration: z.number(),
|
|
15
|
-
ethereumSlotDuration: z.number()
|
|
16
|
+
ethereumSlotDuration: z.number(),
|
|
17
|
+
proofSubmissionWindow: z.number()
|
|
16
18
|
});
|
|
17
19
|
/** Returns the timestamp for a given L2 slot. */ export function getTimestampForSlot(slot, constants) {
|
|
18
20
|
return constants.l1GenesisTime + slot * BigInt(constants.slotDuration);
|
|
@@ -44,3 +46,14 @@ export const L1RollupConstantsSchema = z.object({
|
|
|
44
46
|
constants.l1GenesisTime + endSlot * BigInt(constants.slotDuration) + BigInt((ethereumSlotsPerL2Slot - 1) * constants.ethereumSlotDuration)
|
|
45
47
|
];
|
|
46
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns the deadline timestamp (in seconds) for submitting a proof for a given epoch.
|
|
51
|
+
* Computed as the start of the given epoch plus the proof submission window.
|
|
52
|
+
*/ export function getProofSubmissionDeadlineTimestamp(epochNumber, constants) {
|
|
53
|
+
// See l1-contracts/src/core/libraries/rollup/EpochProofLib.sol:
|
|
54
|
+
// Slot deadline = startEpoch.toSlots() + Slot.wrap(rollupStore.config.proofSubmissionWindow);
|
|
55
|
+
const [startSlot] = getSlotRangeForEpoch(epochNumber, constants);
|
|
56
|
+
const deadlineSlot = startSlot + BigInt(constants.proofSubmissionWindow);
|
|
57
|
+
const deadlineTimestamp = getTimestampForSlot(deadlineSlot, constants);
|
|
58
|
+
return deadlineTimestamp;
|
|
59
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../../src/interfaces/archiver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../../src/interfaces/archiver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAK9D,OAAO,EAAE,KAAK,aAAa,EAAgB,MAAM,6BAA6B,CAAC;AAE/E,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAOnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,aAAa,GAAG,YAAY,GAAG,kBAAkB,GAAG,mBAAmB,EACvE,OAAO,GAAG,MAAM,CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,CA8CvD,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { inBlockSchemaFor } from '../block/in_block.js';
|
|
3
2
|
import { L2Block } from '../block/l2_block.js';
|
|
4
3
|
import { L2TipsSchema } from '../block/l2_block_source.js';
|
|
5
4
|
import { PublishedL2BlockSchema } from '../block/published_l2_block.js';
|
|
@@ -10,7 +9,7 @@ import { PrivateLog } from '../logs/private_log.js';
|
|
|
10
9
|
import { TxScopedL2Log } from '../logs/tx_scoped_l2_log.js';
|
|
11
10
|
import { optional, schemas } from '../schemas/schemas.js';
|
|
12
11
|
import { BlockHeader } from '../tx/block_header.js';
|
|
13
|
-
import {
|
|
12
|
+
import { indexedTxSchema } from '../tx/indexed_tx_effect.js';
|
|
14
13
|
import { TxHash } from '../tx/tx_hash.js';
|
|
15
14
|
import { TxReceipt } from '../tx/tx_receipt.js';
|
|
16
15
|
import { GetContractClassLogsResponseSchema, GetPublicLogsResponseSchema } from './get_logs_response.js';
|
|
@@ -26,7 +25,7 @@ export const ArchiverApiSchema = {
|
|
|
26
25
|
])).returns(BlockHeader.schema.optional()),
|
|
27
26
|
getBlocks: z.function().args(schemas.Integer, schemas.Integer, optional(z.boolean())).returns(z.array(L2Block.schema)),
|
|
28
27
|
getPublishedBlocks: z.function().args(schemas.Integer, schemas.Integer, optional(z.boolean())).returns(z.array(PublishedL2BlockSchema)),
|
|
29
|
-
getTxEffect: z.function().args(TxHash.schema).returns(
|
|
28
|
+
getTxEffect: z.function().args(TxHash.schema).returns(indexedTxSchema().optional()),
|
|
30
29
|
getSettledTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema.optional()),
|
|
31
30
|
getL2SlotNumber: z.function().args().returns(schemas.BigInt),
|
|
32
31
|
getL2EpochNumber: z.function().args().returns(schemas.BigInt),
|
|
@@ -46,5 +45,6 @@ export const ArchiverApiSchema = {
|
|
|
46
45
|
getL1ToL2Messages: z.function().args(schemas.BigInt).returns(z.array(schemas.Fr)),
|
|
47
46
|
getL1ToL2MessageIndex: z.function().args(schemas.Fr).returns(schemas.BigInt.optional()),
|
|
48
47
|
getDebugFunctionName: z.function().args(schemas.AztecAddress, schemas.FunctionSelector).returns(optional(z.string())),
|
|
49
|
-
getL1Constants: z.function().args().returns(L1RollupConstantsSchema)
|
|
48
|
+
getL1Constants: z.function().args().returns(L1RollupConstantsSchema),
|
|
49
|
+
syncImmediate: z.function().args().returns(z.void())
|
|
50
50
|
};
|
|
@@ -17,8 +17,7 @@ import { type ApiSchemaFor } from '../schemas/schemas.js';
|
|
|
17
17
|
import { MerkleTreeId } from '../trees/merkle_tree_id.js';
|
|
18
18
|
import { NullifierMembershipWitness } from '../trees/nullifier_membership_witness.js';
|
|
19
19
|
import { PublicDataWitness } from '../trees/public_data_witness.js';
|
|
20
|
-
import { BlockHeader, PublicSimulationOutput, Tx, TxHash, TxReceipt, type TxValidationResult } from '../tx/index.js';
|
|
21
|
-
import { TxEffect } from '../tx/tx_effect.js';
|
|
20
|
+
import { BlockHeader, type IndexedTxEffect, PublicSimulationOutput, Tx, TxHash, TxReceipt, type TxValidationResult } from '../tx/index.js';
|
|
22
21
|
import type { ValidatorsStats } from '../validators/types.js';
|
|
23
22
|
import { type ComponentsVersions } from '../versioning/index.js';
|
|
24
23
|
import { type GetContractClassLogsResponse, type GetPublicLogsResponse } from './get_logs_response.js';
|
|
@@ -237,11 +236,11 @@ export interface AztecNode extends ProverCoordination, Pick<L2BlockSource, 'getB
|
|
|
237
236
|
*/
|
|
238
237
|
getTxReceipt(txHash: TxHash): Promise<TxReceipt>;
|
|
239
238
|
/**
|
|
240
|
-
*
|
|
241
|
-
* @param txHash - The hash of
|
|
242
|
-
* @returns The requested tx effect.
|
|
239
|
+
* Gets a tx effect.
|
|
240
|
+
* @param txHash - The hash of the tx corresponding to the tx effect.
|
|
241
|
+
* @returns The requested tx effect with block info (or undefined if not found).
|
|
243
242
|
*/
|
|
244
|
-
getTxEffect(txHash: TxHash): Promise<
|
|
243
|
+
getTxEffect(txHash: TxHash): Promise<IndexedTxEffect | undefined>;
|
|
245
244
|
/**
|
|
246
245
|
* Method to retrieve pending txs.
|
|
247
246
|
* @returns The pending txs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":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;IACH,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEnH;;;OAGG;IACH,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAAC;IAEnE;;;OAGG;IACH,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAAC;IAErF;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAC9C;AAED,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,SAAS,CAgItD,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,OAAO,CAAC,kBAAkB,CAAM,EAC1C,KAAK,sBAAe,GACnB,SAAS,CAMX"}
|
|
@@ -17,8 +17,7 @@ import { optional, schemas } from '../schemas/schemas.js';
|
|
|
17
17
|
import { MerkleTreeId } from '../trees/merkle_tree_id.js';
|
|
18
18
|
import { NullifierMembershipWitness } from '../trees/nullifier_membership_witness.js';
|
|
19
19
|
import { PublicDataWitness } from '../trees/public_data_witness.js';
|
|
20
|
-
import { BlockHeader, PublicSimulationOutput, Tx, TxHash, TxReceipt, TxValidationResultSchema } from '../tx/index.js';
|
|
21
|
-
import { TxEffect } from '../tx/tx_effect.js';
|
|
20
|
+
import { BlockHeader, PublicSimulationOutput, Tx, TxHash, TxReceipt, TxValidationResultSchema, indexedTxSchema } from '../tx/index.js';
|
|
22
21
|
import { ValidatorsStatsSchema } from '../validators/schemas.js';
|
|
23
22
|
import { getVersioningResponseHandler } from '../versioning/index.js';
|
|
24
23
|
import { GetContractClassLogsResponseSchema, GetPublicLogsResponseSchema } from './get_logs_response.js';
|
|
@@ -63,7 +62,7 @@ export const AztecNodeApiSchema = {
|
|
|
63
62
|
getLogsByTags: z.function().args(z.array(schemas.Fr)).returns(z.array(z.array(TxScopedL2Log.schema))),
|
|
64
63
|
sendTx: z.function().args(Tx.schema).returns(z.void()),
|
|
65
64
|
getTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema),
|
|
66
|
-
getTxEffect: z.function().args(TxHash.schema).returns(
|
|
65
|
+
getTxEffect: z.function().args(TxHash.schema).returns(indexedTxSchema().optional()),
|
|
67
66
|
getPendingTxs: z.function().returns(z.array(Tx.schema)),
|
|
68
67
|
getPendingTxCount: z.function().returns(z.number()),
|
|
69
68
|
getTxByHash: z.function().args(TxHash.schema).returns(Tx.schema.optional()),
|