@aztec/txe 0.0.1-commit.54489865 → 0.0.1-commit.5914bae
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/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +88 -54
- package/dest/oracle/interfaces.d.ts +29 -28
- package/dest/oracle/interfaces.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_public_context.d.ts +13 -13
- package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_public_context.js +12 -12
- package/dest/oracle/txe_oracle_top_level_context.d.ts +28 -23
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +144 -58
- package/dest/rpc_translator.d.ts +121 -83
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +399 -164
- package/dest/state_machine/archiver.d.ts +3 -3
- package/dest/state_machine/archiver.d.ts.map +1 -1
- package/dest/state_machine/archiver.js +7 -7
- package/dest/state_machine/dummy_p2p_client.d.ts +16 -12
- package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
- package/dest/state_machine/dummy_p2p_client.js +28 -16
- package/dest/state_machine/index.d.ts +7 -5
- package/dest/state_machine/index.d.ts.map +1 -1
- package/dest/state_machine/index.js +19 -10
- package/dest/state_machine/mock_epoch_cache.d.ts +3 -1
- package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
- package/dest/state_machine/mock_epoch_cache.js +4 -0
- package/dest/state_machine/synchronizer.d.ts +5 -5
- package/dest/state_machine/synchronizer.d.ts.map +1 -1
- package/dest/state_machine/synchronizer.js +3 -3
- package/dest/txe_session.d.ts +10 -6
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +97 -26
- package/dest/util/encoding.d.ts +40 -41
- package/dest/util/encoding.d.ts.map +1 -1
- package/dest/util/txe_public_contract_data_source.d.ts +2 -3
- package/dest/util/txe_public_contract_data_source.d.ts.map +1 -1
- package/dest/util/txe_public_contract_data_source.js +5 -22
- package/dest/utils/block_creation.d.ts +1 -1
- package/dest/utils/block_creation.d.ts.map +1 -1
- package/dest/utils/block_creation.js +3 -1
- package/package.json +15 -15
- package/src/index.ts +89 -52
- package/src/oracle/interfaces.ts +32 -31
- package/src/oracle/txe_oracle_public_context.ts +12 -12
- package/src/oracle/txe_oracle_top_level_context.ts +167 -110
- package/src/rpc_translator.ts +463 -181
- package/src/state_machine/archiver.ts +7 -5
- package/src/state_machine/dummy_p2p_client.ts +40 -22
- package/src/state_machine/index.ts +29 -9
- package/src/state_machine/mock_epoch_cache.ts +5 -0
- package/src/state_machine/synchronizer.ts +4 -4
- package/src/txe_session.ts +109 -85
- package/src/util/txe_public_contract_data_source.ts +10 -36
- package/src/utils/block_creation.ts +3 -1
- package/dest/util/txe_contract_store.d.ts +0 -12
- package/dest/util/txe_contract_store.d.ts.map +0 -1
- package/dest/util/txe_contract_store.js +0 -22
- package/src/util/txe_contract_store.ts +0 -36
package/dest/txe_session.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
3
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
4
|
import { KeyStore } from '@aztec/key-store';
|
|
5
5
|
import { openTmpStore } from '@aztec/kv-store/lmdb-v2';
|
|
6
|
-
import { AddressStore, CapsuleStore, JobCoordinator, NoteService, NoteStore, PrivateEventStore, RecipientTaggingStore, SenderAddressBookStore, SenderTaggingStore } from '@aztec/pxe/server';
|
|
6
|
+
import { AddressStore, AnchorBlockStore, CapsuleService, CapsuleStore, ContractSyncService, JobCoordinator, NoteService, NoteStore, PrivateEventStore, RecipientTaggingStore, SenderAddressBookStore, SenderTaggingStore } from '@aztec/pxe/server';
|
|
7
7
|
import { ExecutionNoteCache, ExecutionTaggingIndexCache, HashedValuesCache, Oracle, PrivateExecutionOracle, UtilityExecutionOracle } from '@aztec/pxe/simulator';
|
|
8
8
|
import { ExecutionError, WASMSimulator, createSimulationError, extractCallStack, resolveAssertionMessageFromError, toACVMWitness } from '@aztec/simulator/client';
|
|
9
9
|
import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
@@ -17,9 +17,9 @@ import { DEFAULT_ADDRESS } from './constants.js';
|
|
|
17
17
|
import { TXEOraclePublicContext } from './oracle/txe_oracle_public_context.js';
|
|
18
18
|
import { TXEOracleTopLevelContext } from './oracle/txe_oracle_top_level_context.js';
|
|
19
19
|
import { RPCTranslator } from './rpc_translator.js';
|
|
20
|
+
import { TXEArchiver } from './state_machine/archiver.js';
|
|
20
21
|
import { TXEStateMachine } from './state_machine/index.js';
|
|
21
22
|
import { TXEAccountStore } from './util/txe_account_store.js';
|
|
22
|
-
import { TXEContractStore } from './util/txe_contract_store.js';
|
|
23
23
|
import { getSingleTxBlockRequestHash, insertTxEffectIntoWorldTrees, makeTXEBlock } from './utils/block_creation.js';
|
|
24
24
|
import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
25
25
|
/**
|
|
@@ -44,9 +44,10 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
44
44
|
chainId;
|
|
45
45
|
version;
|
|
46
46
|
nextBlockTimestamp;
|
|
47
|
+
contractSyncService;
|
|
47
48
|
state;
|
|
48
49
|
authwits;
|
|
49
|
-
constructor(logger, stateMachine, oracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobCoordinator, currentJobId, chainId, version, nextBlockTimestamp){
|
|
50
|
+
constructor(logger, stateMachine, oracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobCoordinator, currentJobId, chainId, version, nextBlockTimestamp, contractSyncService){
|
|
50
51
|
this.logger = logger;
|
|
51
52
|
this.stateMachine = stateMachine;
|
|
52
53
|
this.oracleHandler = oracleHandler;
|
|
@@ -65,16 +66,16 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
65
66
|
this.chainId = chainId;
|
|
66
67
|
this.version = version;
|
|
67
68
|
this.nextBlockTimestamp = nextBlockTimestamp;
|
|
69
|
+
this.contractSyncService = contractSyncService;
|
|
68
70
|
this.state = {
|
|
69
71
|
name: 'TOP_LEVEL'
|
|
70
72
|
};
|
|
71
73
|
this.authwits = new Map();
|
|
72
74
|
}
|
|
73
|
-
static async init(
|
|
75
|
+
static async init(contractStore) {
|
|
74
76
|
const store = await openTmpStore('txe-session');
|
|
75
77
|
const addressStore = new AddressStore(store);
|
|
76
78
|
const privateEventStore = new PrivateEventStore(store);
|
|
77
|
-
const contractStore = new TXEContractStore(store);
|
|
78
79
|
const noteStore = new NoteStore(store);
|
|
79
80
|
const senderTaggingStore = new SenderTaggingStore(store);
|
|
80
81
|
const recipientTaggingStore = new RecipientTaggingStore(store);
|
|
@@ -91,19 +92,18 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
91
92
|
privateEventStore,
|
|
92
93
|
noteStore
|
|
93
94
|
]);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
await contractStore.addContractInstance(instance);
|
|
98
|
-
}
|
|
99
|
-
const stateMachine = await TXEStateMachine.create(store);
|
|
95
|
+
const archiver = new TXEArchiver(store);
|
|
96
|
+
const anchorBlockStore = new AnchorBlockStore(store);
|
|
97
|
+
const stateMachine = await TXEStateMachine.create(archiver, anchorBlockStore, contractStore, noteStore);
|
|
100
98
|
const nextBlockTimestamp = BigInt(Math.floor(new Date().getTime() / 1000));
|
|
101
99
|
const version = new Fr(await stateMachine.node.getVersion());
|
|
102
100
|
const chainId = new Fr(await stateMachine.node.getChainId());
|
|
103
101
|
const initialJobId = jobCoordinator.beginJob();
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
const logger = createLogger('txe:session');
|
|
103
|
+
const contractSyncService = new ContractSyncService(stateMachine.node, contractStore, noteStore, logger);
|
|
104
|
+
const topLevelOracleHandler = new TXEOracleTopLevelContext(stateMachine, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, nextBlockTimestamp, version, chainId, new Map(), contractSyncService);
|
|
105
|
+
await topLevelOracleHandler.advanceBlocksBy(1);
|
|
106
|
+
return new TXESession(logger, stateMachine, topLevelOracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobCoordinator, initialJobId, version, chainId, nextBlockTimestamp, contractSyncService);
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Processes an oracle function invoked by the Noir test associated to this session.
|
|
@@ -126,6 +126,14 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
+
getCurrentJob() {
|
|
130
|
+
return this.currentJobId;
|
|
131
|
+
}
|
|
132
|
+
/** Commits the current job and begins a new one. Returns the new job ID. */ async cycleJob() {
|
|
133
|
+
await this.jobCoordinator.commitJob(this.currentJobId);
|
|
134
|
+
this.currentJobId = this.jobCoordinator.beginJob();
|
|
135
|
+
return this.currentJobId;
|
|
136
|
+
}
|
|
129
137
|
async enterTopLevelState() {
|
|
130
138
|
switch(this.state.name){
|
|
131
139
|
case 'PRIVATE':
|
|
@@ -153,9 +161,8 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
153
161
|
}
|
|
154
162
|
}
|
|
155
163
|
// Commit all staged stores from the job that was just completed, then begin a new job
|
|
156
|
-
await this.
|
|
157
|
-
this.
|
|
158
|
-
this.oracleHandler = new TXEOracleTopLevelContext(this.stateMachine, this.contractStore, this.noteStore, this.keyStore, this.addressStore, this.accountStore, this.senderTaggingStore, this.recipientTaggingStore, this.senderAddressBookStore, this.capsuleStore, this.privateEventStore, this.currentJobId, this.nextBlockTimestamp, this.version, this.chainId, this.authwits);
|
|
164
|
+
await this.cycleJob();
|
|
165
|
+
this.oracleHandler = new TXEOracleTopLevelContext(this.stateMachine, this.contractStore, this.noteStore, this.keyStore, this.addressStore, this.accountStore, this.senderTaggingStore, this.recipientTaggingStore, this.senderAddressBookStore, this.capsuleStore, this.privateEventStore, this.nextBlockTimestamp, this.version, this.chainId, this.authwits, this.contractSyncService);
|
|
159
166
|
this.state = {
|
|
160
167
|
name: 'TOP_LEVEL'
|
|
161
168
|
};
|
|
@@ -163,11 +170,11 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
163
170
|
}
|
|
164
171
|
async enterPrivateState(contractAddress = DEFAULT_ADDRESS, anchorBlockNumber) {
|
|
165
172
|
this.exitTopLevelState();
|
|
166
|
-
await new NoteService(this.noteStore, this.stateMachine.node, this.stateMachine.anchorBlockStore, this.currentJobId).syncNoteNullifiers(contractAddress);
|
|
167
173
|
// Private execution has two associated block numbers: the anchor block (i.e. the historical block that is used to
|
|
168
174
|
// build the proof), and the *next* block, i.e. the one we'll create once the execution ends, and which will contain
|
|
169
175
|
// a single transaction with the effects of what was done in the test.
|
|
170
176
|
const anchorBlock = await this.stateMachine.node.getBlockHeader(anchorBlockNumber ?? 'latest');
|
|
177
|
+
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlock, this.currentJobId).syncNoteNullifiers(contractAddress, await this.keyStore.getAccounts());
|
|
171
178
|
const latestBlock = await this.stateMachine.node.getBlockHeader('latest');
|
|
172
179
|
const nextBlockGlobalVariables = makeGlobalVariables(undefined, {
|
|
173
180
|
blockNumber: BlockNumber(latestBlock.globalVariables.blockNumber + 1),
|
|
@@ -180,7 +187,33 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
180
187
|
const noteCache = new ExecutionNoteCache(protocolNullifier);
|
|
181
188
|
const taggingIndexCache = new ExecutionTaggingIndexCache();
|
|
182
189
|
const utilityExecutor = this.utilityExecutorForContractSync(anchorBlock);
|
|
183
|
-
this.oracleHandler = new PrivateExecutionOracle(
|
|
190
|
+
this.oracleHandler = new PrivateExecutionOracle({
|
|
191
|
+
argsHash: Fr.ZERO,
|
|
192
|
+
txContext: new TxContext(this.chainId, this.version, GasSettings.empty()),
|
|
193
|
+
callContext: new CallContext(AztecAddress.ZERO, contractAddress, FunctionSelector.empty(), false),
|
|
194
|
+
anchorBlockHeader: anchorBlock,
|
|
195
|
+
utilityExecutor,
|
|
196
|
+
authWitnesses: [],
|
|
197
|
+
capsules: [],
|
|
198
|
+
executionCache: new HashedValuesCache(),
|
|
199
|
+
noteCache,
|
|
200
|
+
taggingIndexCache,
|
|
201
|
+
contractStore: this.contractStore,
|
|
202
|
+
noteStore: this.noteStore,
|
|
203
|
+
keyStore: this.keyStore,
|
|
204
|
+
addressStore: this.addressStore,
|
|
205
|
+
aztecNode: this.stateMachine.node,
|
|
206
|
+
senderTaggingStore: this.senderTaggingStore,
|
|
207
|
+
recipientTaggingStore: this.recipientTaggingStore,
|
|
208
|
+
senderAddressBookStore: this.senderAddressBookStore,
|
|
209
|
+
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
210
|
+
privateEventStore: this.privateEventStore,
|
|
211
|
+
contractSyncService: this.stateMachine.contractSyncService,
|
|
212
|
+
l2TipsStore: this.stateMachine.node,
|
|
213
|
+
jobId: this.currentJobId,
|
|
214
|
+
scopes: await this.keyStore.getAccounts(),
|
|
215
|
+
messageContextService: this.stateMachine.messageContextService
|
|
216
|
+
});
|
|
184
217
|
// We store the note and tagging index caches fed into the PrivateExecutionOracle (along with some other auxiliary
|
|
185
218
|
// data) in order to refer to it later, mimicking the way this object is used by the ContractFunctionSimulator. The
|
|
186
219
|
// difference resides in that the simulator has all information needed in order to run the simulation, while ours
|
|
@@ -214,14 +247,33 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
214
247
|
}
|
|
215
248
|
async enterUtilityState(contractAddress = DEFAULT_ADDRESS) {
|
|
216
249
|
this.exitTopLevelState();
|
|
250
|
+
const anchorBlockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
|
|
217
251
|
// There is no automatic message discovery and contract-driven syncing process in inlined private or utility
|
|
218
252
|
// contexts, which means that known nullifiers are also not searched for, since it is during the tagging sync that
|
|
219
253
|
// we perform this. We therefore search for known nullifiers now, as otherwise notes that were nullified would not
|
|
220
254
|
// be removed from the database.
|
|
221
255
|
// TODO(#12553): make the synchronizer sync here instead and remove this
|
|
222
|
-
await new NoteService(this.noteStore, this.stateMachine.node,
|
|
223
|
-
|
|
224
|
-
|
|
256
|
+
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlockHeader, this.currentJobId).syncNoteNullifiers(contractAddress, await this.keyStore.getAccounts());
|
|
257
|
+
this.oracleHandler = new UtilityExecutionOracle({
|
|
258
|
+
contractAddress,
|
|
259
|
+
authWitnesses: [],
|
|
260
|
+
capsules: [],
|
|
261
|
+
anchorBlockHeader,
|
|
262
|
+
contractStore: this.contractStore,
|
|
263
|
+
noteStore: this.noteStore,
|
|
264
|
+
keyStore: this.keyStore,
|
|
265
|
+
addressStore: this.addressStore,
|
|
266
|
+
aztecNode: this.stateMachine.node,
|
|
267
|
+
recipientTaggingStore: this.recipientTaggingStore,
|
|
268
|
+
senderAddressBookStore: this.senderAddressBookStore,
|
|
269
|
+
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
270
|
+
privateEventStore: this.privateEventStore,
|
|
271
|
+
messageContextService: this.stateMachine.messageContextService,
|
|
272
|
+
contractSyncService: this.contractSyncService,
|
|
273
|
+
l2TipsStore: this.stateMachine.node,
|
|
274
|
+
jobId: this.currentJobId,
|
|
275
|
+
scopes: await this.keyStore.getAccounts()
|
|
276
|
+
});
|
|
225
277
|
this.state = {
|
|
226
278
|
name: 'UTILITY'
|
|
227
279
|
};
|
|
@@ -233,8 +285,8 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
233
285
|
}
|
|
234
286
|
// Note that while all public and private contexts do is build a single block that we then process when exiting
|
|
235
287
|
// those, the top level context performs a large number of actions not captured in the following 'close' call. Among
|
|
236
|
-
// others, it will create empty blocks (via `
|
|
237
|
-
// `
|
|
288
|
+
// others, it will create empty blocks (via `advanceBlocksBy` and `deploy`), create blocks with transactions via
|
|
289
|
+
// `privateCallNewFlow` and `publicCallNewFlow`, add accounts to PXE via `addAccount`, etc. This is a
|
|
238
290
|
// slight inconsistency in the working model of this class, but is not too bad.
|
|
239
291
|
// TODO: it's quite unfortunate that we need to capture the authwits created to later pass them again when the top
|
|
240
292
|
// level context is re-created. This is because authwits create a temporary utility context that'd otherwise reset
|
|
@@ -278,13 +330,32 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
278
330
|
}
|
|
279
331
|
}
|
|
280
332
|
utilityExecutorForContractSync(anchorBlock) {
|
|
281
|
-
return async (call)=>{
|
|
333
|
+
return async (call, scopes)=>{
|
|
282
334
|
const entryPointArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(call.to, call.selector);
|
|
283
335
|
if (entryPointArtifact.functionType !== FunctionType.UTILITY) {
|
|
284
336
|
throw new Error(`Cannot run ${entryPointArtifact.functionType} function as utility`);
|
|
285
337
|
}
|
|
286
338
|
try {
|
|
287
|
-
const oracle = new UtilityExecutionOracle(
|
|
339
|
+
const oracle = new UtilityExecutionOracle({
|
|
340
|
+
contractAddress: call.to,
|
|
341
|
+
authWitnesses: [],
|
|
342
|
+
capsules: [],
|
|
343
|
+
anchorBlockHeader: anchorBlock,
|
|
344
|
+
contractStore: this.contractStore,
|
|
345
|
+
noteStore: this.noteStore,
|
|
346
|
+
keyStore: this.keyStore,
|
|
347
|
+
addressStore: this.addressStore,
|
|
348
|
+
aztecNode: this.stateMachine.node,
|
|
349
|
+
recipientTaggingStore: this.recipientTaggingStore,
|
|
350
|
+
senderAddressBookStore: this.senderAddressBookStore,
|
|
351
|
+
capsuleService: new CapsuleService(this.capsuleStore, scopes),
|
|
352
|
+
privateEventStore: this.privateEventStore,
|
|
353
|
+
messageContextService: this.stateMachine.messageContextService,
|
|
354
|
+
contractSyncService: this.contractSyncService,
|
|
355
|
+
l2TipsStore: this.stateMachine.node,
|
|
356
|
+
jobId: this.currentJobId,
|
|
357
|
+
scopes
|
|
358
|
+
});
|
|
288
359
|
await new WASMSimulator().executeUserCircuit(toACVMWitness(0, call.args), entryPointArtifact, new Oracle(oracle).toACIRCallback()).catch((err)=>{
|
|
289
360
|
err.message = resolveAssertionMessageFromError(err, entryPointArtifact);
|
|
290
361
|
throw new ExecutionError(err.message, {
|
package/dest/util/encoding.d.ts
CHANGED
|
@@ -258,16 +258,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
258
258
|
acir_locations: Record<string, number>;
|
|
259
259
|
brillig_locations: Record<string, Record<string, number>>;
|
|
260
260
|
}>;
|
|
261
|
-
files: z.
|
|
262
|
-
source: z.ZodString;
|
|
263
|
-
path: z.ZodString;
|
|
264
|
-
}, "strip", z.ZodTypeAny, {
|
|
265
|
-
source: string;
|
|
266
|
-
path: string;
|
|
267
|
-
}, {
|
|
268
|
-
source: string;
|
|
269
|
-
path: string;
|
|
270
|
-
}>>;
|
|
261
|
+
files: z.ZodType<import("@aztec/stdlib/abi").DebugFileMap, z.ZodTypeDef, import("@aztec/stdlib/abi").DebugFileMap>;
|
|
271
262
|
}, "strip", z.ZodTypeAny, {
|
|
272
263
|
debugSymbols: {
|
|
273
264
|
location_tree: {
|
|
@@ -285,10 +276,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
285
276
|
acir_locations: Record<string, number>;
|
|
286
277
|
brillig_locations: Record<string, Record<string, number>>;
|
|
287
278
|
};
|
|
288
|
-
files:
|
|
289
|
-
source: string;
|
|
290
|
-
path: string;
|
|
291
|
-
}>;
|
|
279
|
+
files: import("@aztec/stdlib/abi").DebugFileMap;
|
|
292
280
|
}, {
|
|
293
281
|
debugSymbols: {
|
|
294
282
|
location_tree: {
|
|
@@ -306,10 +294,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
306
294
|
acir_locations: Record<string, number>;
|
|
307
295
|
brillig_locations: Record<string, Record<string, number>>;
|
|
308
296
|
};
|
|
309
|
-
files:
|
|
310
|
-
source: string;
|
|
311
|
-
path: string;
|
|
312
|
-
}>;
|
|
297
|
+
files: import("@aztec/stdlib/abi").DebugFileMap;
|
|
313
298
|
}>>;
|
|
314
299
|
}, "strip", z.ZodTypeAny, {
|
|
315
300
|
bytecode: Buffer<ArrayBufferLike>;
|
|
@@ -332,10 +317,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
332
317
|
acir_locations: Record<string, number>;
|
|
333
318
|
brillig_locations: Record<string, Record<string, number>>;
|
|
334
319
|
};
|
|
335
|
-
files:
|
|
336
|
-
source: string;
|
|
337
|
-
path: string;
|
|
338
|
-
}>;
|
|
320
|
+
files: import("@aztec/stdlib/abi").DebugFileMap;
|
|
339
321
|
} | undefined;
|
|
340
322
|
}, {
|
|
341
323
|
bytecode?: any;
|
|
@@ -358,10 +340,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
358
340
|
acir_locations: Record<string, number>;
|
|
359
341
|
brillig_locations: Record<string, Record<string, number>>;
|
|
360
342
|
};
|
|
361
|
-
files:
|
|
362
|
-
source: string;
|
|
363
|
-
path: string;
|
|
364
|
-
}>;
|
|
343
|
+
files: import("@aztec/stdlib/abi").DebugFileMap;
|
|
365
344
|
} | undefined;
|
|
366
345
|
}>>, "many">;
|
|
367
346
|
nonDispatchPublicFunctions: z.ZodArray<z.ZodObject<{
|
|
@@ -474,16 +453,41 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
474
453
|
}, {
|
|
475
454
|
slot: string;
|
|
476
455
|
}>>;
|
|
477
|
-
fileMap: z.ZodRecord<z.ZodNumber, z.ZodObject<{
|
|
456
|
+
fileMap: z.ZodEffects<z.ZodRecord<z.ZodNumber, z.ZodObject<{
|
|
478
457
|
source: z.ZodString;
|
|
479
458
|
path: z.ZodString;
|
|
459
|
+
function_locations: z.ZodArray<z.ZodObject<{
|
|
460
|
+
start: z.ZodNumber;
|
|
461
|
+
name: z.ZodString;
|
|
462
|
+
}, "strip", z.ZodTypeAny, {
|
|
463
|
+
start: number;
|
|
464
|
+
name: string;
|
|
465
|
+
}, {
|
|
466
|
+
start: number;
|
|
467
|
+
name: string;
|
|
468
|
+
}>, "many">;
|
|
480
469
|
}, "strip", z.ZodTypeAny, {
|
|
481
470
|
source: string;
|
|
482
471
|
path: string;
|
|
472
|
+
function_locations: {
|
|
473
|
+
start: number;
|
|
474
|
+
name: string;
|
|
475
|
+
}[];
|
|
483
476
|
}, {
|
|
484
477
|
source: string;
|
|
485
478
|
path: string;
|
|
486
|
-
|
|
479
|
+
function_locations: {
|
|
480
|
+
start: number;
|
|
481
|
+
name: string;
|
|
482
|
+
}[];
|
|
483
|
+
}>>, Record<number, {
|
|
484
|
+
source: string;
|
|
485
|
+
path: string;
|
|
486
|
+
function_locations: {
|
|
487
|
+
start: number;
|
|
488
|
+
name: string;
|
|
489
|
+
}[];
|
|
490
|
+
}>, unknown>;
|
|
487
491
|
}, "strip", z.ZodTypeAny, {
|
|
488
492
|
name: string;
|
|
489
493
|
functions: ({
|
|
@@ -529,10 +533,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
529
533
|
acir_locations: Record<string, number>;
|
|
530
534
|
brillig_locations: Record<string, Record<string, number>>;
|
|
531
535
|
};
|
|
532
|
-
files:
|
|
533
|
-
source: string;
|
|
534
|
-
path: string;
|
|
535
|
-
}>;
|
|
536
|
+
files: import("@aztec/stdlib/abi").DebugFileMap;
|
|
536
537
|
} | undefined;
|
|
537
538
|
})[];
|
|
538
539
|
nonDispatchPublicFunctions: {
|
|
@@ -568,6 +569,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
568
569
|
fileMap: Record<number, {
|
|
569
570
|
source: string;
|
|
570
571
|
path: string;
|
|
572
|
+
function_locations: {
|
|
573
|
+
start: number;
|
|
574
|
+
name: string;
|
|
575
|
+
}[];
|
|
571
576
|
}>;
|
|
572
577
|
}, {
|
|
573
578
|
name: string;
|
|
@@ -614,10 +619,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
614
619
|
acir_locations: Record<string, number>;
|
|
615
620
|
brillig_locations: Record<string, Record<string, number>>;
|
|
616
621
|
};
|
|
617
|
-
files:
|
|
618
|
-
source: string;
|
|
619
|
-
path: string;
|
|
620
|
-
}>;
|
|
622
|
+
files: import("@aztec/stdlib/abi").DebugFileMap;
|
|
621
623
|
} | undefined;
|
|
622
624
|
})[];
|
|
623
625
|
nonDispatchPublicFunctions: {
|
|
@@ -650,10 +652,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
650
652
|
storageLayout: Record<string, {
|
|
651
653
|
slot: string;
|
|
652
654
|
}>;
|
|
653
|
-
fileMap
|
|
654
|
-
source: string;
|
|
655
|
-
path: string;
|
|
656
|
-
}>;
|
|
655
|
+
fileMap?: unknown;
|
|
657
656
|
}>, z.ZodIntersection<z.ZodObject<{
|
|
658
657
|
version: z.ZodLiteral<1>;
|
|
659
658
|
salt: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
@@ -717,4 +716,4 @@ export declare const ForeignCallResultSchema: z.ZodObject<{
|
|
|
717
716
|
}, {
|
|
718
717
|
values: (string | string[])[];
|
|
719
718
|
}>;
|
|
720
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
719
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jb2RpbmcuZC50cyIsInNvdXJjZVJvb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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC"}
|
|
@@ -3,9 +3,8 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
3
3
|
import type { ContractStore } from '@aztec/pxe/server';
|
|
4
4
|
import { type ContractArtifact, FunctionSelector } from '@aztec/stdlib/abi';
|
|
5
5
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
-
import {
|
|
6
|
+
import type { ContractClassPublic, ContractDataSource, ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
7
7
|
export declare class TXEPublicContractDataSource implements ContractDataSource {
|
|
8
|
-
#private;
|
|
9
8
|
private blockNumber;
|
|
10
9
|
private contractStore;
|
|
11
10
|
constructor(blockNumber: BlockNumber, contractStore: ContractStore);
|
|
@@ -18,4 +17,4 @@ export declare class TXEPublicContractDataSource implements ContractDataSource {
|
|
|
18
17
|
getDebugFunctionName(address: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
|
|
19
18
|
registerContractFunctionSignatures(_signatures: []): Promise<void>;
|
|
20
19
|
}
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX3B1YmxpY19jb250cmFjdF9kYXRhX3NvdXJjZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWwvdHhlX3B1YmxpY19jb250cmFjdF9kYXRhX3NvdXJjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0saUNBQWlDLENBQ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LENBQUMsQ0FHdEY7SUFFSyxvQkFBb0IsQ0FBQyxPQUFPLEVBQUUsWUFBWSxFQUFFLFFBQVEsRUFBRSxnQkFBZ0IsR0FBRyxPQUFPLENBQUMsTUFBTSxHQUFHLFNBQVMsQ0FBQyxDQUV6RztJQUVELGtDQUFrQyxDQUFDLFdBQVcsRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUVqRTtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"txe_public_contract_data_source.d.ts","sourceRoot":"","sources":["../../src/util/txe_public_contract_data_source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"txe_public_contract_data_source.d.ts","sourceRoot":"","sources":["../../src/util/txe_public_contract_data_source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAEnH,qBAAa,2BAA4B,YAAW,kBAAkB;IAElE,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,aAAa;IAFvB,YACU,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAClC;IAEJ,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAErC;IAEK,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAcvE;IAEK,qBAAqB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC,CAG3D;IAEK,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAGzF;IAED,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC,CAEnC;IAEK,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAGtF;IAEK,oBAAoB,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEzG;IAED,kCAAkC,CAAC,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;CACF"}
|
|
@@ -1,48 +1,31 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
-
import { FunctionType } from '@aztec/stdlib/abi';
|
|
3
|
-
import { computePrivateFunctionsRoot, computePublicBytecodeCommitment, getContractClassPrivateFunctionFromArtifact } from '@aztec/stdlib/contract';
|
|
4
1
|
export class TXEPublicContractDataSource {
|
|
5
2
|
blockNumber;
|
|
6
3
|
contractStore;
|
|
7
|
-
#privateFunctionsRoot;
|
|
8
4
|
constructor(blockNumber, contractStore){
|
|
9
5
|
this.blockNumber = blockNumber;
|
|
10
6
|
this.contractStore = contractStore;
|
|
11
|
-
this.#privateFunctionsRoot = new Map();
|
|
12
7
|
}
|
|
13
8
|
getBlockNumber() {
|
|
14
9
|
return Promise.resolve(this.blockNumber);
|
|
15
10
|
}
|
|
16
11
|
async getContractClass(id) {
|
|
17
|
-
const contractClass = await this.contractStore.
|
|
12
|
+
const contractClass = await this.contractStore.getContractClassWithPreimage(id);
|
|
18
13
|
if (!contractClass) {
|
|
19
14
|
return;
|
|
20
15
|
}
|
|
21
|
-
const artifact = await this.contractStore.getContractArtifact(id);
|
|
22
|
-
if (!artifact) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
let privateFunctionsRoot;
|
|
26
|
-
if (!this.#privateFunctionsRoot.has(id.toString())) {
|
|
27
|
-
const privateFunctions = await Promise.all(artifact.functions.filter((fn)=>fn.functionType === FunctionType.PRIVATE).map((fn)=>getContractClassPrivateFunctionFromArtifact(fn)));
|
|
28
|
-
privateFunctionsRoot = await computePrivateFunctionsRoot(privateFunctions);
|
|
29
|
-
this.#privateFunctionsRoot.set(id.toString(), privateFunctionsRoot.toBuffer());
|
|
30
|
-
} else {
|
|
31
|
-
privateFunctionsRoot = Fr.fromBuffer(this.#privateFunctionsRoot.get(id.toString()));
|
|
32
|
-
}
|
|
33
16
|
return {
|
|
34
|
-
id,
|
|
17
|
+
id: contractClass.id,
|
|
35
18
|
artifactHash: contractClass.artifactHash,
|
|
36
19
|
packedBytecode: contractClass.packedBytecode,
|
|
37
|
-
privateFunctionsRoot,
|
|
20
|
+
privateFunctionsRoot: contractClass.privateFunctionsRoot,
|
|
38
21
|
version: contractClass.version,
|
|
39
22
|
privateFunctions: [],
|
|
40
23
|
utilityFunctions: []
|
|
41
24
|
};
|
|
42
25
|
}
|
|
43
26
|
async getBytecodeCommitment(id) {
|
|
44
|
-
const contractClass = await this.contractStore.
|
|
45
|
-
return contractClass
|
|
27
|
+
const contractClass = await this.contractStore.getContractClassWithPreimage(id);
|
|
28
|
+
return contractClass?.publicBytecodeCommitment;
|
|
46
29
|
}
|
|
47
30
|
async getContract(address) {
|
|
48
31
|
const instance = await this.contractStore.getContractInstance(address);
|
|
@@ -25,4 +25,4 @@ export declare function makeTXEBlockHeader(worldTrees: MerkleTreeWriteOperations
|
|
|
25
25
|
* @returns The created L2Block with proper archive chaining
|
|
26
26
|
*/
|
|
27
27
|
export declare function makeTXEBlock(worldTrees: MerkleTreeWriteOperations, globalVariables: GlobalVariables, txEffects: TxEffect[]): Promise<L2Block>;
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2tfY3JlYXRpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9ibG9ja19jcmVhdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxPQUFPLEVBQUUsV0FBVyxFQUEyQyxNQUFNLGlDQUFpQyxDQUFDO0FBRXZHLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEVBQVEsT0FBTyxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDcEQsT0FBTyxFQUF3QyxLQUFLLHlCQUF5QixFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDM0csT0FBTyxFQUFFLFdBQVcsRUFBRSxlQUFlLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFMUU7Ozs7R0FJRztBQUNILHdCQUFnQiwyQkFBMkIsQ0FBQyxXQUFXLEVBQUUsV0FBVyxHQUFHLEVBQUUsQ0FFeEU7QUFFRCx3QkFBc0IsNEJBQTRCLENBQ2hELFFBQVEsRUFBRSxRQUFRLEVBQ2xCLFVBQVUsRUFBRSx5QkFBeUIsR0FDcEMsT0FBTyxDQUFDLElBQUksQ0FBQyxDQWtCZjtBQUVELHdCQUFzQixrQkFBa0IsQ0FDdEMsVUFBVSxFQUFFLHlCQUF5QixFQUNyQyxlQUFlLEVBQUUsZUFBZSxHQUMvQixPQUFPLENBQUMsV0FBVyxDQUFDLENBWXRCO0FBRUQ7Ozs7Ozs7Ozs7OztHQVlHO0FBQ0gsd0JBQXNCLFlBQVksQ0FDaEMsVUFBVSxFQUFFLHlCQUF5QixFQUNyQyxlQUFlLEVBQUUsZUFBZSxFQUNoQyxTQUFTLEVBQUUsUUFBUSxFQUFFLEdBQ3BCLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FpQmxCIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_creation.d.ts","sourceRoot":"","sources":["../../src/utils/block_creation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAA2C,MAAM,iCAAiC,CAAC;AAEvG,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAQ,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAwC,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE1E;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,WAAW,GAAG,EAAE,CAExE;AAED,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,yBAAyB,GACpC,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,yBAAyB,EACrC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAAC,WAAW,CAAC,CAYtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,yBAAyB,EACrC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,QAAQ,EAAE,GACpB,OAAO,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"block_creation.d.ts","sourceRoot":"","sources":["../../src/utils/block_creation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAA2C,MAAM,iCAAiC,CAAC;AAEvG,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAQ,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAwC,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE1E;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,WAAW,GAAG,EAAE,CAExE;AAED,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,yBAAyB,GACpC,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,yBAAyB,EACrC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAAC,WAAW,CAAC,CAYtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,yBAAyB,EACrC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,QAAQ,EAAE,GACpB,OAAO,CAAC,OAAO,CAAC,CAiBlB"}
|
|
@@ -49,7 +49,9 @@ export async function makeTXEBlockHeader(worldTrees, globalVariables) {
|
|
|
49
49
|
// Get the new archive state after updating
|
|
50
50
|
const newArchiveInfo = await worldTrees.getTreeInfo(MerkleTreeId.ARCHIVE);
|
|
51
51
|
const newArchive = new AppendOnlyTreeSnapshot(new Fr(newArchiveInfo.root), Number(newArchiveInfo.size));
|
|
52
|
-
// L2Block requires checkpointNumber and indexWithinCheckpoint
|
|
52
|
+
// L2Block requires checkpointNumber and indexWithinCheckpoint.
|
|
53
|
+
// TXE uses 1-block-per-checkpoint for testing simplicity, so we can use block number as checkpoint number.
|
|
54
|
+
// This uses the deprecated fromBlockNumber method intentionally for the TXE testing environment.
|
|
53
55
|
const checkpointNumber = CheckpointNumber.fromBlockNumber(globalVariables.blockNumber);
|
|
54
56
|
const indexWithinCheckpoint = IndexWithinCheckpoint(0);
|
|
55
57
|
return new L2Block(newArchive, header, new Body(txEffects), checkpointNumber, indexWithinCheckpoint);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/txe",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.5914bae",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"bin": "./dest/bin/index.js",
|
|
@@ -61,20 +61,20 @@
|
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
65
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
66
|
-
"@aztec/aztec-node": "0.0.1-commit.
|
|
67
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
68
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
69
|
-
"@aztec/constants": "0.0.1-commit.
|
|
70
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
71
|
-
"@aztec/key-store": "0.0.1-commit.
|
|
72
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
73
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
74
|
-
"@aztec/pxe": "0.0.1-commit.
|
|
75
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
76
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
77
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
64
|
+
"@aztec/accounts": "0.0.1-commit.5914bae",
|
|
65
|
+
"@aztec/archiver": "0.0.1-commit.5914bae",
|
|
66
|
+
"@aztec/aztec-node": "0.0.1-commit.5914bae",
|
|
67
|
+
"@aztec/aztec.js": "0.0.1-commit.5914bae",
|
|
68
|
+
"@aztec/bb-prover": "0.0.1-commit.5914bae",
|
|
69
|
+
"@aztec/constants": "0.0.1-commit.5914bae",
|
|
70
|
+
"@aztec/foundation": "0.0.1-commit.5914bae",
|
|
71
|
+
"@aztec/key-store": "0.0.1-commit.5914bae",
|
|
72
|
+
"@aztec/kv-store": "0.0.1-commit.5914bae",
|
|
73
|
+
"@aztec/protocol-contracts": "0.0.1-commit.5914bae",
|
|
74
|
+
"@aztec/pxe": "0.0.1-commit.5914bae",
|
|
75
|
+
"@aztec/simulator": "0.0.1-commit.5914bae",
|
|
76
|
+
"@aztec/stdlib": "0.0.1-commit.5914bae",
|
|
77
|
+
"@aztec/world-state": "0.0.1-commit.5914bae",
|
|
78
78
|
"zod": "^3.23.8"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|