@aztec/txe 0.0.1-commit.1142ef1 → 0.0.1-commit.11bf3dd6e
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/constants.d.ts +1 -2
- package/dest/constants.d.ts.map +1 -1
- package/dest/constants.js +0 -1
- 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 +16 -16
- package/dest/oracle/txe_oracle_top_level_context.d.ts +28 -22
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +165 -71
- package/dest/rpc_translator.d.ts +125 -81
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +426 -179
- package/dest/state_machine/archiver.d.ts +20 -69
- package/dest/state_machine/archiver.d.ts.map +1 -1
- package/dest/state_machine/archiver.js +36 -179
- package/dest/state_machine/dummy_p2p_client.d.ts +18 -13
- package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
- package/dest/state_machine/dummy_p2p_client.js +33 -18
- 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 +7 -5
- package/dest/state_machine/index.d.ts.map +1 -1
- package/dest/state_machine/index.js +40 -13
- package/dest/state_machine/mock_epoch_cache.d.ts +25 -8
- package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
- package/dest/state_machine/mock_epoch_cache.js +46 -9
- package/dest/state_machine/synchronizer.d.ts +6 -6
- package/dest/state_machine/synchronizer.d.ts.map +1 -1
- package/dest/state_machine/synchronizer.js +3 -3
- package/dest/txe_session.d.ts +12 -6
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +115 -28
- package/dest/util/encoding.d.ts +88 -18
- package/dest/util/encoding.d.ts.map +1 -1
- package/dest/util/encoding.js +4 -0
- 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 +6 -25
- package/dest/utils/block_creation.d.ts +4 -4
- package/dest/utils/block_creation.d.ts.map +1 -1
- package/dest/utils/block_creation.js +18 -4
- package/dest/utils/tx_effect_creation.d.ts +2 -3
- package/dest/utils/tx_effect_creation.d.ts.map +1 -1
- package/dest/utils/tx_effect_creation.js +3 -6
- package/package.json +16 -16
- package/src/constants.ts +0 -1
- package/src/index.ts +89 -52
- package/src/oracle/interfaces.ts +32 -31
- package/src/oracle/txe_oracle_public_context.ts +16 -18
- package/src/oracle/txe_oracle_top_level_context.ts +208 -123
- package/src/rpc_translator.ts +493 -204
- package/src/state_machine/archiver.ts +38 -234
- package/src/state_machine/dummy_p2p_client.ts +46 -24
- package/src/state_machine/global_variable_builder.ts +18 -3
- package/src/state_machine/index.ts +56 -12
- package/src/state_machine/mock_epoch_cache.ts +57 -14
- package/src/state_machine/synchronizer.ts +5 -5
- package/src/txe_session.ts +132 -88
- package/src/util/encoding.ts +5 -0
- package/src/util/txe_public_contract_data_source.ts +10 -38
- package/src/utils/block_creation.ts +19 -16
- package/src/utils/tx_effect_creation.ts +3 -11
- 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, 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';
|
|
@@ -13,13 +13,13 @@ import { computeProtocolNullifier } from '@aztec/stdlib/hash';
|
|
|
13
13
|
import { makeGlobalVariables } from '@aztec/stdlib/testing';
|
|
14
14
|
import { CallContext, TxContext } from '@aztec/stdlib/tx';
|
|
15
15
|
import { z } from 'zod';
|
|
16
|
-
import { DEFAULT_ADDRESS
|
|
16
|
+
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
|
/**
|
|
@@ -39,12 +39,15 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
39
39
|
senderAddressBookStore;
|
|
40
40
|
capsuleStore;
|
|
41
41
|
privateEventStore;
|
|
42
|
+
jobCoordinator;
|
|
43
|
+
currentJobId;
|
|
42
44
|
chainId;
|
|
43
45
|
version;
|
|
44
46
|
nextBlockTimestamp;
|
|
47
|
+
contractSyncService;
|
|
45
48
|
state;
|
|
46
49
|
authwits;
|
|
47
|
-
constructor(logger, stateMachine, oracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, chainId, version, nextBlockTimestamp){
|
|
50
|
+
constructor(logger, stateMachine, oracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobCoordinator, currentJobId, chainId, version, nextBlockTimestamp, contractSyncService){
|
|
48
51
|
this.logger = logger;
|
|
49
52
|
this.stateMachine = stateMachine;
|
|
50
53
|
this.oracleHandler = oracleHandler;
|
|
@@ -58,38 +61,49 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
58
61
|
this.senderAddressBookStore = senderAddressBookStore;
|
|
59
62
|
this.capsuleStore = capsuleStore;
|
|
60
63
|
this.privateEventStore = privateEventStore;
|
|
64
|
+
this.jobCoordinator = jobCoordinator;
|
|
65
|
+
this.currentJobId = currentJobId;
|
|
61
66
|
this.chainId = chainId;
|
|
62
67
|
this.version = version;
|
|
63
68
|
this.nextBlockTimestamp = nextBlockTimestamp;
|
|
69
|
+
this.contractSyncService = contractSyncService;
|
|
64
70
|
this.state = {
|
|
65
71
|
name: 'TOP_LEVEL'
|
|
66
72
|
};
|
|
67
73
|
this.authwits = new Map();
|
|
68
74
|
}
|
|
69
|
-
static async init(
|
|
75
|
+
static async init(contractStore) {
|
|
70
76
|
const store = await openTmpStore('txe-session');
|
|
71
77
|
const addressStore = new AddressStore(store);
|
|
72
78
|
const privateEventStore = new PrivateEventStore(store);
|
|
73
|
-
const
|
|
74
|
-
const noteStore = await NoteStore.create(store);
|
|
79
|
+
const noteStore = new NoteStore(store);
|
|
75
80
|
const senderTaggingStore = new SenderTaggingStore(store);
|
|
76
81
|
const recipientTaggingStore = new RecipientTaggingStore(store);
|
|
77
82
|
const senderAddressBookStore = new SenderAddressBookStore(store);
|
|
78
83
|
const capsuleStore = new CapsuleStore(store);
|
|
79
84
|
const keyStore = new KeyStore(store);
|
|
80
85
|
const accountStore = new TXEAccountStore(store);
|
|
81
|
-
//
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
// Create job coordinator and register staged stores
|
|
87
|
+
const jobCoordinator = new JobCoordinator(store);
|
|
88
|
+
jobCoordinator.registerStores([
|
|
89
|
+
capsuleStore,
|
|
90
|
+
senderTaggingStore,
|
|
91
|
+
recipientTaggingStore,
|
|
92
|
+
privateEventStore,
|
|
93
|
+
noteStore
|
|
94
|
+
]);
|
|
95
|
+
const archiver = new TXEArchiver(store);
|
|
96
|
+
const anchorBlockStore = new AnchorBlockStore(store);
|
|
97
|
+
const stateMachine = await TXEStateMachine.create(archiver, anchorBlockStore, contractStore, noteStore);
|
|
87
98
|
const nextBlockTimestamp = BigInt(Math.floor(new Date().getTime() / 1000));
|
|
88
99
|
const version = new Fr(await stateMachine.node.getVersion());
|
|
89
100
|
const chainId = new Fr(await stateMachine.node.getChainId());
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
101
|
+
const initialJobId = jobCoordinator.beginJob();
|
|
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);
|
|
93
107
|
}
|
|
94
108
|
/**
|
|
95
109
|
* Processes an oracle function invoked by the Noir test associated to this session.
|
|
@@ -112,6 +126,14 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
112
126
|
}
|
|
113
127
|
}
|
|
114
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
|
+
}
|
|
115
137
|
async enterTopLevelState() {
|
|
116
138
|
switch(this.state.name){
|
|
117
139
|
case 'PRIVATE':
|
|
@@ -138,7 +160,9 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
138
160
|
this.state;
|
|
139
161
|
}
|
|
140
162
|
}
|
|
141
|
-
|
|
163
|
+
// Commit all staged stores from the job that was just completed, then begin a new job
|
|
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);
|
|
142
166
|
this.state = {
|
|
143
167
|
name: 'TOP_LEVEL'
|
|
144
168
|
};
|
|
@@ -146,11 +170,11 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
146
170
|
}
|
|
147
171
|
async enterPrivateState(contractAddress = DEFAULT_ADDRESS, anchorBlockNumber) {
|
|
148
172
|
this.exitTopLevelState();
|
|
149
|
-
await new NoteService(this.noteStore, this.stateMachine.node, this.stateMachine.anchorBlockStore).syncNoteNullifiers(contractAddress);
|
|
150
173
|
// Private execution has two associated block numbers: the anchor block (i.e. the historical block that is used to
|
|
151
174
|
// build the proof), and the *next* block, i.e. the one we'll create once the execution ends, and which will contain
|
|
152
175
|
// a single transaction with the effects of what was done in the test.
|
|
153
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());
|
|
154
178
|
const latestBlock = await this.stateMachine.node.getBlockHeader('latest');
|
|
155
179
|
const nextBlockGlobalVariables = makeGlobalVariables(undefined, {
|
|
156
180
|
blockNumber: BlockNumber(latestBlock.globalVariables.blockNumber + 1),
|
|
@@ -163,7 +187,33 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
163
187
|
const noteCache = new ExecutionNoteCache(protocolNullifier);
|
|
164
188
|
const taggingIndexCache = new ExecutionTaggingIndexCache();
|
|
165
189
|
const utilityExecutor = this.utilityExecutorForContractSync(anchorBlock);
|
|
166
|
-
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
|
+
});
|
|
167
217
|
// We store the note and tagging index caches fed into the PrivateExecutionOracle (along with some other auxiliary
|
|
168
218
|
// data) in order to refer to it later, mimicking the way this object is used by the ContractFunctionSimulator. The
|
|
169
219
|
// difference resides in that the simulator has all information needed in order to run the simulation, while ours
|
|
@@ -172,7 +222,6 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
172
222
|
this.state = {
|
|
173
223
|
name: 'PRIVATE',
|
|
174
224
|
nextBlockGlobalVariables,
|
|
175
|
-
protocolNullifier,
|
|
176
225
|
noteCache,
|
|
177
226
|
taggingIndexCache
|
|
178
227
|
};
|
|
@@ -198,14 +247,33 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
198
247
|
}
|
|
199
248
|
async enterUtilityState(contractAddress = DEFAULT_ADDRESS) {
|
|
200
249
|
this.exitTopLevelState();
|
|
250
|
+
const anchorBlockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
|
|
201
251
|
// There is no automatic message discovery and contract-driven syncing process in inlined private or utility
|
|
202
252
|
// contexts, which means that known nullifiers are also not searched for, since it is during the tagging sync that
|
|
203
253
|
// we perform this. We therefore search for known nullifiers now, as otherwise notes that were nullified would not
|
|
204
254
|
// be removed from the database.
|
|
205
255
|
// TODO(#12553): make the synchronizer sync here instead and remove this
|
|
206
|
-
await new NoteService(this.noteStore, this.stateMachine.node, this.
|
|
207
|
-
|
|
208
|
-
|
|
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
|
+
});
|
|
209
277
|
this.state = {
|
|
210
278
|
name: 'UTILITY'
|
|
211
279
|
};
|
|
@@ -217,8 +285,8 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
217
285
|
}
|
|
218
286
|
// Note that while all public and private contexts do is build a single block that we then process when exiting
|
|
219
287
|
// those, the top level context performs a large number of actions not captured in the following 'close' call. Among
|
|
220
|
-
// others, it will create empty blocks (via `
|
|
221
|
-
// `
|
|
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
|
|
222
290
|
// slight inconsistency in the working model of this class, but is not too bad.
|
|
223
291
|
// TODO: it's quite unfortunate that we need to capture the authwits created to later pass them again when the top
|
|
224
292
|
// level context is re-created. This is because authwits create a temporary utility context that'd otherwise reset
|
|
@@ -235,7 +303,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
235
303
|
});
|
|
236
304
|
// We rely on the note cache to determine the effects of the transaction. This is incomplete as it doesn't private
|
|
237
305
|
// logs (other effects like enqueued public calls don't need to be considered since those are not allowed).
|
|
238
|
-
const txEffect = await makeTxEffect(this.state.noteCache, this.state.
|
|
306
|
+
const txEffect = await makeTxEffect(this.state.noteCache, this.state.nextBlockGlobalVariables.blockNumber);
|
|
239
307
|
// We build a block holding just this transaction
|
|
240
308
|
const forkedWorldTrees = await this.stateMachine.synchronizer.nativeWorldStateService.fork();
|
|
241
309
|
await insertTxEffectIntoWorldTrees(txEffect, forkedWorldTrees);
|
|
@@ -262,13 +330,32 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
262
330
|
}
|
|
263
331
|
}
|
|
264
332
|
utilityExecutorForContractSync(anchorBlock) {
|
|
265
|
-
return async (call)=>{
|
|
333
|
+
return async (call, scopes)=>{
|
|
266
334
|
const entryPointArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(call.to, call.selector);
|
|
267
335
|
if (entryPointArtifact.functionType !== FunctionType.UTILITY) {
|
|
268
336
|
throw new Error(`Cannot run ${entryPointArtifact.functionType} function as utility`);
|
|
269
337
|
}
|
|
270
338
|
try {
|
|
271
|
-
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
|
+
});
|
|
272
359
|
await new WASMSimulator().executeUserCircuit(toACVMWitness(0, call.args), entryPointArtifact, new Oracle(oracle).toACIRCallback()).catch((err)=>{
|
|
273
360
|
err.message = resolveAssertionMessageFromError(err, entryPointArtifact);
|
|
274
361
|
throw new ExecutionError(err.message, {
|
package/dest/util/encoding.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
2
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
import { type ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
5
6
|
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
export type ForeignCallSingle = string;
|
|
@@ -12,6 +13,7 @@ export type ForeignCallResult = {
|
|
|
12
13
|
};
|
|
13
14
|
export declare function fromSingle(obj: ForeignCallSingle): Fr;
|
|
14
15
|
export declare function addressFromSingle(obj: ForeignCallSingle): AztecAddress;
|
|
16
|
+
export declare function blockHashFromSingle(obj: ForeignCallSingle): BlockHash;
|
|
15
17
|
export declare function fromArray(obj: ForeignCallArray): Fr[];
|
|
16
18
|
/**
|
|
17
19
|
* Converts an array of Noir unsigned integers to a single tightly-packed buffer.
|
|
@@ -150,7 +152,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
150
152
|
error_kind: "custom";
|
|
151
153
|
} & import("@aztec/stdlib/abi").AbiType) | undefined>;
|
|
152
154
|
}>, z.ZodObject<{
|
|
153
|
-
bytecode: import("
|
|
155
|
+
bytecode: import("@aztec/foundation/schemas").ZodFor<Buffer<ArrayBufferLike>>;
|
|
154
156
|
verificationKey: z.ZodOptional<z.ZodString>;
|
|
155
157
|
debugSymbols: z.ZodString;
|
|
156
158
|
debug: z.ZodOptional<z.ZodObject<{
|
|
@@ -261,12 +263,30 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
261
263
|
files: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
262
264
|
source: z.ZodString;
|
|
263
265
|
path: z.ZodString;
|
|
266
|
+
function_locations: z.ZodArray<z.ZodObject<{
|
|
267
|
+
start: z.ZodNumber;
|
|
268
|
+
name: z.ZodString;
|
|
269
|
+
}, "strip", z.ZodTypeAny, {
|
|
270
|
+
start: number;
|
|
271
|
+
name: string;
|
|
272
|
+
}, {
|
|
273
|
+
start: number;
|
|
274
|
+
name: string;
|
|
275
|
+
}>, "many">;
|
|
264
276
|
}, "strip", z.ZodTypeAny, {
|
|
265
277
|
source: string;
|
|
266
278
|
path: string;
|
|
279
|
+
function_locations: {
|
|
280
|
+
start: number;
|
|
281
|
+
name: string;
|
|
282
|
+
}[];
|
|
267
283
|
}, {
|
|
268
284
|
source: string;
|
|
269
285
|
path: string;
|
|
286
|
+
function_locations: {
|
|
287
|
+
start: number;
|
|
288
|
+
name: string;
|
|
289
|
+
}[];
|
|
270
290
|
}>>;
|
|
271
291
|
}, "strip", z.ZodTypeAny, {
|
|
272
292
|
debugSymbols: {
|
|
@@ -288,6 +308,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
288
308
|
files: Record<string, {
|
|
289
309
|
source: string;
|
|
290
310
|
path: string;
|
|
311
|
+
function_locations: {
|
|
312
|
+
start: number;
|
|
313
|
+
name: string;
|
|
314
|
+
}[];
|
|
291
315
|
}>;
|
|
292
316
|
}, {
|
|
293
317
|
debugSymbols: {
|
|
@@ -309,6 +333,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
309
333
|
files: Record<string, {
|
|
310
334
|
source: string;
|
|
311
335
|
path: string;
|
|
336
|
+
function_locations: {
|
|
337
|
+
start: number;
|
|
338
|
+
name: string;
|
|
339
|
+
}[];
|
|
312
340
|
}>;
|
|
313
341
|
}>>;
|
|
314
342
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -335,6 +363,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
335
363
|
files: Record<string, {
|
|
336
364
|
source: string;
|
|
337
365
|
path: string;
|
|
366
|
+
function_locations: {
|
|
367
|
+
start: number;
|
|
368
|
+
name: string;
|
|
369
|
+
}[];
|
|
338
370
|
}>;
|
|
339
371
|
} | undefined;
|
|
340
372
|
}, {
|
|
@@ -361,6 +393,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
361
393
|
files: Record<string, {
|
|
362
394
|
source: string;
|
|
363
395
|
path: string;
|
|
396
|
+
function_locations: {
|
|
397
|
+
start: number;
|
|
398
|
+
name: string;
|
|
399
|
+
}[];
|
|
364
400
|
}>;
|
|
365
401
|
} | undefined;
|
|
366
402
|
}>>, "many">;
|
|
@@ -477,12 +513,30 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
477
513
|
fileMap: z.ZodRecord<z.ZodNumber, z.ZodObject<{
|
|
478
514
|
source: z.ZodString;
|
|
479
515
|
path: z.ZodString;
|
|
516
|
+
function_locations: z.ZodArray<z.ZodObject<{
|
|
517
|
+
start: z.ZodNumber;
|
|
518
|
+
name: z.ZodString;
|
|
519
|
+
}, "strip", z.ZodTypeAny, {
|
|
520
|
+
start: number;
|
|
521
|
+
name: string;
|
|
522
|
+
}, {
|
|
523
|
+
start: number;
|
|
524
|
+
name: string;
|
|
525
|
+
}>, "many">;
|
|
480
526
|
}, "strip", z.ZodTypeAny, {
|
|
481
527
|
source: string;
|
|
482
528
|
path: string;
|
|
529
|
+
function_locations: {
|
|
530
|
+
start: number;
|
|
531
|
+
name: string;
|
|
532
|
+
}[];
|
|
483
533
|
}, {
|
|
484
534
|
source: string;
|
|
485
535
|
path: string;
|
|
536
|
+
function_locations: {
|
|
537
|
+
start: number;
|
|
538
|
+
name: string;
|
|
539
|
+
}[];
|
|
486
540
|
}>>;
|
|
487
541
|
}, "strip", z.ZodTypeAny, {
|
|
488
542
|
name: string;
|
|
@@ -532,6 +586,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
532
586
|
files: Record<string, {
|
|
533
587
|
source: string;
|
|
534
588
|
path: string;
|
|
589
|
+
function_locations: {
|
|
590
|
+
start: number;
|
|
591
|
+
name: string;
|
|
592
|
+
}[];
|
|
535
593
|
}>;
|
|
536
594
|
} | undefined;
|
|
537
595
|
})[];
|
|
@@ -568,6 +626,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
568
626
|
fileMap: Record<number, {
|
|
569
627
|
source: string;
|
|
570
628
|
path: string;
|
|
629
|
+
function_locations: {
|
|
630
|
+
start: number;
|
|
631
|
+
name: string;
|
|
632
|
+
}[];
|
|
571
633
|
}>;
|
|
572
634
|
}, {
|
|
573
635
|
name: string;
|
|
@@ -617,6 +679,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
617
679
|
files: Record<string, {
|
|
618
680
|
source: string;
|
|
619
681
|
path: string;
|
|
682
|
+
function_locations: {
|
|
683
|
+
start: number;
|
|
684
|
+
name: string;
|
|
685
|
+
}[];
|
|
620
686
|
}>;
|
|
621
687
|
} | undefined;
|
|
622
688
|
})[];
|
|
@@ -653,30 +719,34 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
653
719
|
fileMap: Record<number, {
|
|
654
720
|
source: string;
|
|
655
721
|
path: string;
|
|
722
|
+
function_locations: {
|
|
723
|
+
start: number;
|
|
724
|
+
name: string;
|
|
725
|
+
}[];
|
|
656
726
|
}>;
|
|
657
727
|
}>, z.ZodIntersection<z.ZodObject<{
|
|
658
728
|
version: z.ZodLiteral<1>;
|
|
659
|
-
salt: import("
|
|
660
|
-
deployer: import("
|
|
661
|
-
currentContractClassId: import("
|
|
662
|
-
originalContractClassId: import("
|
|
663
|
-
initializationHash: import("
|
|
729
|
+
salt: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
730
|
+
deployer: import("@aztec/foundation/schemas").ZodFor<AztecAddress>;
|
|
731
|
+
currentContractClassId: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
732
|
+
originalContractClassId: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
733
|
+
initializationHash: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
664
734
|
publicKeys: z.ZodEffects<z.ZodObject<{
|
|
665
|
-
masterNullifierPublicKey: z.ZodType<import("
|
|
666
|
-
masterIncomingViewingPublicKey: z.ZodType<import("
|
|
667
|
-
masterOutgoingViewingPublicKey: z.ZodType<import("
|
|
668
|
-
masterTaggingPublicKey: z.ZodType<import("
|
|
735
|
+
masterNullifierPublicKey: z.ZodType<import("@aztec/foundation/schemas").Point, any, string>;
|
|
736
|
+
masterIncomingViewingPublicKey: z.ZodType<import("@aztec/foundation/schemas").Point, any, string>;
|
|
737
|
+
masterOutgoingViewingPublicKey: z.ZodType<import("@aztec/foundation/schemas").Point, any, string>;
|
|
738
|
+
masterTaggingPublicKey: z.ZodType<import("@aztec/foundation/schemas").Point, any, string>;
|
|
669
739
|
}, "strip", z.ZodTypeAny, {
|
|
670
|
-
masterNullifierPublicKey: import("
|
|
671
|
-
masterIncomingViewingPublicKey: import("
|
|
672
|
-
masterOutgoingViewingPublicKey: import("
|
|
673
|
-
masterTaggingPublicKey: import("
|
|
740
|
+
masterNullifierPublicKey: import("@aztec/foundation/schemas").Point;
|
|
741
|
+
masterIncomingViewingPublicKey: import("@aztec/foundation/schemas").Point;
|
|
742
|
+
masterOutgoingViewingPublicKey: import("@aztec/foundation/schemas").Point;
|
|
743
|
+
masterTaggingPublicKey: import("@aztec/foundation/schemas").Point;
|
|
674
744
|
}, {
|
|
675
745
|
masterNullifierPublicKey: string;
|
|
676
746
|
masterIncomingViewingPublicKey: string;
|
|
677
747
|
masterOutgoingViewingPublicKey: string;
|
|
678
748
|
masterTaggingPublicKey: string;
|
|
679
|
-
}>, import("
|
|
749
|
+
}>, import("@aztec/stdlib/keys").PublicKeys, {
|
|
680
750
|
masterNullifierPublicKey: string;
|
|
681
751
|
masterIncomingViewingPublicKey: string;
|
|
682
752
|
masterOutgoingViewingPublicKey: string;
|
|
@@ -689,7 +759,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
689
759
|
currentContractClassId: Fr;
|
|
690
760
|
originalContractClassId: Fr;
|
|
691
761
|
initializationHash: Fr;
|
|
692
|
-
publicKeys: import("
|
|
762
|
+
publicKeys: import("@aztec/stdlib/keys").PublicKeys;
|
|
693
763
|
}, {
|
|
694
764
|
version: 1;
|
|
695
765
|
salt?: any;
|
|
@@ -704,7 +774,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
704
774
|
masterTaggingPublicKey: string;
|
|
705
775
|
};
|
|
706
776
|
}>, z.ZodObject<{
|
|
707
|
-
address: import("
|
|
777
|
+
address: import("@aztec/foundation/schemas").ZodFor<AztecAddress>;
|
|
708
778
|
}, "strip", z.ZodTypeAny, {
|
|
709
779
|
address: AztecAddress;
|
|
710
780
|
}, {
|
|
@@ -717,4 +787,4 @@ export declare const ForeignCallResultSchema: z.ZodObject<{
|
|
|
717
787
|
}, {
|
|
718
788
|
values: (string | string[])[];
|
|
719
789
|
}>;
|
|
720
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
790
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jb2RpbmcuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2VuY29kaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUVoRSxPQUFPLEVBQUUsS0FBSyxnQkFBZ0IsRUFBMEIsTUFBTSxtQkFBbUIsQ0FBQztBQUNsRixPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDM0QsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ2hELE9BQU8sRUFBRSxLQUFLLDJCQUEyQixFQUFxQyxNQUFNLHdCQUF3QixDQUFDO0FBRTdHLE9BQU8sRUFBRSxDQUFDLEVBQUUsTUFBTSxLQUFLLENBQUM7QUFFeEIsTUFBTSxNQUFNLGlCQUFpQixHQUFHLE1BQU0sQ0FBQztBQUV2QyxNQUFNLE1BQU0sZ0JBQWdCLEdBQUcsTUFBTSxFQUFFLENBQUM7QUFFeEMsTUFBTSxNQUFNLGVBQWUsR0FBRyxDQUFDLGlCQUFpQixHQUFHLGdCQUFnQixHQUFHLGdCQUFnQixHQUFHLDJCQUEyQixDQUFDLEVBQUUsQ0FBQztBQUV4SCxNQ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;EAEhF;AAED,eAAO,MAAM,uBAAuB,aAAa,CAAC;AAElD,eAAO,MAAM,sBAAsB,iCAAsB,CAAC;AAE1D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC"}
|
package/dest/util/encoding.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
2
2
|
import { hexToBuffer } from '@aztec/foundation/string';
|
|
3
3
|
import { ContractArtifactSchema } from '@aztec/stdlib/abi';
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
5
6
|
import { ContractInstanceWithAddressSchema } from '@aztec/stdlib/contract';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
export function fromSingle(obj) {
|
|
@@ -10,6 +11,9 @@ export function fromSingle(obj) {
|
|
|
10
11
|
export function addressFromSingle(obj) {
|
|
11
12
|
return new AztecAddress(fromSingle(obj));
|
|
12
13
|
}
|
|
14
|
+
export function blockHashFromSingle(obj) {
|
|
15
|
+
return new BlockHash(fromSingle(obj));
|
|
16
|
+
}
|
|
13
17
|
export function fromArray(obj) {
|
|
14
18
|
return obj.map((str)=>Fr.fromBuffer(hexToBuffer(str)));
|
|
15
19
|
}
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX3B1YmxpY19jb250cmFjdF9kYXRhX3NvdXJjZ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QywyQkFBMkIsR0FBRyxTQUFTLENBQUMsQ0FHekY7SUFFRCxtQkFBbUIsSUFBSSxPQUFPLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FFbkM7SUFFSyxtQkFBbUIsQ0FBQyxPQUFPLEVBQUUsWUFBWSxHQUFHLE9BQU8sQ0FBQyxnQkFBZ0IsR0FBRyxTQUFTLENBQUMsQ0FHdEY7SUFFSyxvQkFBb0IsQ0FBQyxPQUFPLEVBQUUsWUFBWSxFQUFFLFFBQVEsRUFBRSxnQkFBZ0IsR0FBRyxPQUFPLENBQUMsTUFBTSxHQUFHLFNBQVMsQ0FBQyxDQUV6RztJQUVELGtDQUFrQyxDQUFDLFdBQVcsRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUVqRTtDQUNGIn0=
|
|
@@ -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;AACh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