@aztec/txe 0.0.1-commit.3f296a7d2 → 0.0.1-commit.3f5453c7b
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/oracle/txe_oracle_top_level_context.d.ts +7 -2
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +25 -15
- package/dest/rpc_translator.d.ts +53 -20
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +140 -39
- package/dest/state_machine/archiver.d.ts +1 -1
- package/dest/state_machine/archiver.d.ts.map +1 -1
- package/dest/state_machine/archiver.js +2 -1
- package/dest/state_machine/dummy_p2p_client.d.ts +3 -2
- package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
- package/dest/state_machine/dummy_p2p_client.js +5 -2
- package/dest/state_machine/global_variable_builder.d.ts +9 -4
- package/dest/state_machine/global_variable_builder.d.ts.map +1 -1
- package/dest/state_machine/global_variable_builder.js +9 -3
- package/dest/state_machine/index.d.ts +1 -1
- package/dest/state_machine/index.d.ts.map +1 -1
- package/dest/state_machine/index.js +2 -2
- package/dest/state_machine/mock_epoch_cache.d.ts +2 -1
- package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
- package/dest/state_machine/mock_epoch_cache.js +3 -0
- package/dest/txe_session.d.ts +1 -1
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +8 -8
- package/package.json +15 -15
- package/src/oracle/txe_oracle_top_level_context.ts +37 -21
- package/src/rpc_translator.ts +166 -35
- package/src/state_machine/archiver.ts +1 -0
- package/src/state_machine/dummy_p2p_client.ts +6 -2
- package/src/state_machine/global_variable_builder.ts +18 -3
- package/src/state_machine/index.ts +2 -1
- package/src/state_machine/mock_epoch_cache.ts +4 -0
- package/src/txe_session.ts +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"txe_session.d.ts","sourceRoot":"","sources":["../src/txe_session.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B;YA6BhB,eAAe;IAS7B,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,8BAA8B;CA8CvC"}
|
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, AnchorBlockStore, CapsuleStore, ContractSyncService, 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';
|
|
@@ -174,7 +174,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
174
174
|
// build the proof), and the *next* block, i.e. the one we'll create once the execution ends, and which will contain
|
|
175
175
|
// a single transaction with the effects of what was done in the test.
|
|
176
176
|
const anchorBlock = await this.stateMachine.node.getBlockHeader(anchorBlockNumber ?? 'latest');
|
|
177
|
-
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlock, this.currentJobId).syncNoteNullifiers(contractAddress,
|
|
177
|
+
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlock, this.currentJobId).syncNoteNullifiers(contractAddress, await this.keyStore.getAccounts());
|
|
178
178
|
const latestBlock = await this.stateMachine.node.getBlockHeader('latest');
|
|
179
179
|
const nextBlockGlobalVariables = makeGlobalVariables(undefined, {
|
|
180
180
|
blockNumber: BlockNumber(latestBlock.globalVariables.blockNumber + 1),
|
|
@@ -206,11 +206,11 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
206
206
|
senderTaggingStore: this.senderTaggingStore,
|
|
207
207
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
208
208
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
209
|
-
|
|
209
|
+
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
210
210
|
privateEventStore: this.privateEventStore,
|
|
211
211
|
contractSyncService: this.stateMachine.contractSyncService,
|
|
212
212
|
jobId: this.currentJobId,
|
|
213
|
-
scopes:
|
|
213
|
+
scopes: await this.keyStore.getAccounts(),
|
|
214
214
|
messageContextService: this.stateMachine.messageContextService
|
|
215
215
|
});
|
|
216
216
|
// We store the note and tagging index caches fed into the PrivateExecutionOracle (along with some other auxiliary
|
|
@@ -252,7 +252,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
252
252
|
// we perform this. We therefore search for known nullifiers now, as otherwise notes that were nullified would not
|
|
253
253
|
// be removed from the database.
|
|
254
254
|
// TODO(#12553): make the synchronizer sync here instead and remove this
|
|
255
|
-
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlockHeader, this.currentJobId).syncNoteNullifiers(contractAddress,
|
|
255
|
+
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlockHeader, this.currentJobId).syncNoteNullifiers(contractAddress, await this.keyStore.getAccounts());
|
|
256
256
|
this.oracleHandler = new UtilityExecutionOracle({
|
|
257
257
|
contractAddress,
|
|
258
258
|
authWitnesses: [],
|
|
@@ -265,12 +265,12 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
265
265
|
aztecNode: this.stateMachine.node,
|
|
266
266
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
267
267
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
268
|
-
|
|
268
|
+
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
269
269
|
privateEventStore: this.privateEventStore,
|
|
270
270
|
messageContextService: this.stateMachine.messageContextService,
|
|
271
271
|
contractSyncService: this.contractSyncService,
|
|
272
272
|
jobId: this.currentJobId,
|
|
273
|
-
scopes:
|
|
273
|
+
scopes: await this.keyStore.getAccounts()
|
|
274
274
|
});
|
|
275
275
|
this.state = {
|
|
276
276
|
name: 'UTILITY'
|
|
@@ -346,7 +346,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
346
346
|
aztecNode: this.stateMachine.node,
|
|
347
347
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
348
348
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
349
|
-
|
|
349
|
+
capsuleService: new CapsuleService(this.capsuleStore, scopes),
|
|
350
350
|
privateEventStore: this.privateEventStore,
|
|
351
351
|
messageContextService: this.stateMachine.messageContextService,
|
|
352
352
|
contractSyncService: this.contractSyncService,
|
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.3f5453c7b",
|
|
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.3f5453c7b",
|
|
65
|
+
"@aztec/archiver": "0.0.1-commit.3f5453c7b",
|
|
66
|
+
"@aztec/aztec-node": "0.0.1-commit.3f5453c7b",
|
|
67
|
+
"@aztec/aztec.js": "0.0.1-commit.3f5453c7b",
|
|
68
|
+
"@aztec/bb-prover": "0.0.1-commit.3f5453c7b",
|
|
69
|
+
"@aztec/constants": "0.0.1-commit.3f5453c7b",
|
|
70
|
+
"@aztec/foundation": "0.0.1-commit.3f5453c7b",
|
|
71
|
+
"@aztec/key-store": "0.0.1-commit.3f5453c7b",
|
|
72
|
+
"@aztec/kv-store": "0.0.1-commit.3f5453c7b",
|
|
73
|
+
"@aztec/protocol-contracts": "0.0.1-commit.3f5453c7b",
|
|
74
|
+
"@aztec/pxe": "0.0.1-commit.3f5453c7b",
|
|
75
|
+
"@aztec/simulator": "0.0.1-commit.3f5453c7b",
|
|
76
|
+
"@aztec/stdlib": "0.0.1-commit.3f5453c7b",
|
|
77
|
+
"@aztec/world-state": "0.0.1-commit.3f5453c7b",
|
|
78
78
|
"zod": "^3.23.8"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
DEFAULT_TEARDOWN_DA_GAS_LIMIT,
|
|
6
|
-
DEFAULT_TEARDOWN_L2_GAS_LIMIT,
|
|
3
|
+
MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT,
|
|
4
|
+
MAX_PROCESSABLE_L2_GAS,
|
|
7
5
|
NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP,
|
|
8
6
|
} from '@aztec/constants';
|
|
9
7
|
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
@@ -12,14 +10,14 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
12
10
|
import { LogLevels, type Logger, applyStringFormatting, createLogger } from '@aztec/foundation/log';
|
|
13
11
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
14
12
|
import type { KeyStore } from '@aztec/key-store';
|
|
15
|
-
import type { AccessScopes } from '@aztec/pxe/client/lazy';
|
|
16
13
|
import {
|
|
17
14
|
AddressStore,
|
|
15
|
+
CapsuleService,
|
|
18
16
|
CapsuleStore,
|
|
19
17
|
type ContractStore,
|
|
20
18
|
type ContractSyncService,
|
|
21
19
|
NoteStore,
|
|
22
|
-
|
|
20
|
+
ORACLE_VERSION_MAJOR,
|
|
23
21
|
PrivateEventStore,
|
|
24
22
|
RecipientTaggingStore,
|
|
25
23
|
SenderAddressBookStore,
|
|
@@ -57,7 +55,13 @@ import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
|
57
55
|
import { PublicSimulatorConfig } from '@aztec/stdlib/avm';
|
|
58
56
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
59
57
|
import { type ContractInstanceWithAddress, computePartialAddress } from '@aztec/stdlib/contract';
|
|
60
|
-
import {
|
|
58
|
+
import {
|
|
59
|
+
FALLBACK_TEARDOWN_DA_GAS_LIMIT,
|
|
60
|
+
FALLBACK_TEARDOWN_L2_GAS_LIMIT,
|
|
61
|
+
Gas,
|
|
62
|
+
GasFees,
|
|
63
|
+
GasSettings,
|
|
64
|
+
} from '@aztec/stdlib/gas';
|
|
61
65
|
import { computeCalldataHash, computeProtocolNullifier, siloNullifier } from '@aztec/stdlib/hash';
|
|
62
66
|
import {
|
|
63
67
|
PartialPrivateTailPublicInputsForPublic,
|
|
@@ -118,12 +122,24 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
118
122
|
this.logger.debug('Entering Top Level Context');
|
|
119
123
|
}
|
|
120
124
|
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
private contractOracleVersion: { major: number; minor: number } | undefined;
|
|
126
|
+
|
|
127
|
+
assertCompatibleOracleVersion(major: number, minor: number): void {
|
|
128
|
+
if (major !== ORACLE_VERSION_MAJOR) {
|
|
129
|
+
const hint =
|
|
130
|
+
major > ORACLE_VERSION_MAJOR
|
|
131
|
+
? 'The contract was compiled with a newer version of Aztec.nr than this aztec cli version supports. Upgrade your aztec cli version to a compatible version.'
|
|
132
|
+
: 'The contract was compiled with an older version of Aztec.nr than this aztec cli version supports. Recompile the contract with a compatible version of Aztec.nr.';
|
|
123
133
|
throw new Error(
|
|
124
|
-
`Incompatible
|
|
134
|
+
`Incompatible aztec cli version: ${hint} See https://docs.aztec.network/errors/8 (expected oracle major version ${ORACLE_VERSION_MAJOR}, got ${major})`,
|
|
125
135
|
);
|
|
126
136
|
}
|
|
137
|
+
this.contractOracleVersion = { major, minor };
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Prefixed with "nonOracleFunction" as it is not used as an oracle handler.
|
|
141
|
+
nonOracleFunctionGetContractOracleVersion(): { major: number; minor: number } | undefined {
|
|
142
|
+
return this.contractOracleVersion;
|
|
127
143
|
}
|
|
128
144
|
|
|
129
145
|
// This is typically only invoked in private contexts, but it is convenient to also have it in top-level for testing
|
|
@@ -324,7 +340,7 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
324
340
|
const effectiveScopes = from.isZero() ? [] : [from];
|
|
325
341
|
|
|
326
342
|
// Sync notes before executing private function to discover notes from previous transactions
|
|
327
|
-
const utilityExecutor = async (call: FunctionCall, execScopes:
|
|
343
|
+
const utilityExecutor = async (call: FunctionCall, execScopes: AztecAddress[]) => {
|
|
328
344
|
await this.executeUtilityCall(call, execScopes, jobId);
|
|
329
345
|
};
|
|
330
346
|
|
|
@@ -342,8 +358,8 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
342
358
|
|
|
343
359
|
const callContext = new CallContext(from, targetContractAddress, functionSelector, isStaticCall);
|
|
344
360
|
|
|
345
|
-
const gasLimits = new Gas(
|
|
346
|
-
const teardownGasLimits = new Gas(
|
|
361
|
+
const gasLimits = new Gas(MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT, MAX_PROCESSABLE_L2_GAS);
|
|
362
|
+
const teardownGasLimits = new Gas(FALLBACK_TEARDOWN_DA_GAS_LIMIT, FALLBACK_TEARDOWN_L2_GAS_LIMIT);
|
|
347
363
|
const gasSettings = new GasSettings(gasLimits, teardownGasLimits, GasFees.empty(), GasFees.empty());
|
|
348
364
|
|
|
349
365
|
const txContext = new TxContext(this.chainId, this.version, gasSettings);
|
|
@@ -378,7 +394,7 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
378
394
|
senderTaggingStore: this.senderTaggingStore,
|
|
379
395
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
380
396
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
381
|
-
|
|
397
|
+
capsuleService: new CapsuleService(this.capsuleStore, effectiveScopes),
|
|
382
398
|
privateEventStore: this.privateEventStore,
|
|
383
399
|
contractSyncService: this.stateMachine.contractSyncService,
|
|
384
400
|
jobId,
|
|
@@ -412,7 +428,7 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
412
428
|
);
|
|
413
429
|
const publicFunctionsCalldata = await Promise.all(
|
|
414
430
|
publicCallRequests.map(async r => {
|
|
415
|
-
const calldata = await privateExecutionOracle.
|
|
431
|
+
const calldata = await privateExecutionOracle.getHashPreimage(r.calldataHash);
|
|
416
432
|
return new HashedValues(calldata, r.calldataHash);
|
|
417
433
|
}),
|
|
418
434
|
);
|
|
@@ -538,9 +554,9 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
538
554
|
|
|
539
555
|
const blockNumber = await this.getNextBlockNumber();
|
|
540
556
|
|
|
541
|
-
const gasLimits = new Gas(
|
|
557
|
+
const gasLimits = new Gas(MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT, MAX_PROCESSABLE_L2_GAS);
|
|
542
558
|
|
|
543
|
-
const teardownGasLimits = new Gas(
|
|
559
|
+
const teardownGasLimits = new Gas(FALLBACK_TEARDOWN_DA_GAS_LIMIT, FALLBACK_TEARDOWN_L2_GAS_LIMIT);
|
|
544
560
|
|
|
545
561
|
const gasSettings = new GasSettings(gasLimits, teardownGasLimits, GasFees.empty(), GasFees.empty());
|
|
546
562
|
|
|
@@ -702,7 +718,7 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
702
718
|
},
|
|
703
719
|
blockHeader,
|
|
704
720
|
jobId,
|
|
705
|
-
|
|
721
|
+
await this.keyStore.getAccounts(),
|
|
706
722
|
);
|
|
707
723
|
|
|
708
724
|
const call = FunctionCall.from({
|
|
@@ -716,10 +732,10 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
716
732
|
returnTypes: [],
|
|
717
733
|
});
|
|
718
734
|
|
|
719
|
-
return this.executeUtilityCall(call,
|
|
735
|
+
return this.executeUtilityCall(call, await this.keyStore.getAccounts(), jobId);
|
|
720
736
|
}
|
|
721
737
|
|
|
722
|
-
private async executeUtilityCall(call: FunctionCall, scopes:
|
|
738
|
+
private async executeUtilityCall(call: FunctionCall, scopes: AztecAddress[], jobId: string): Promise<Fr[]> {
|
|
723
739
|
const entryPointArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(call.to, call.selector);
|
|
724
740
|
if (entryPointArtifact.functionType !== FunctionType.UTILITY) {
|
|
725
741
|
throw new Error(`Cannot run ${entryPointArtifact.functionType} function as utility`);
|
|
@@ -744,7 +760,7 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
744
760
|
aztecNode: this.stateMachine.node,
|
|
745
761
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
746
762
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
747
|
-
|
|
763
|
+
capsuleService: new CapsuleService(this.capsuleStore, scopes),
|
|
748
764
|
privateEventStore: this.privateEventStore,
|
|
749
765
|
messageContextService: this.stateMachine.messageContextService,
|
|
750
766
|
contractSyncService: this.contractSyncService,
|