@aztec/txe 0.0.1-commit.88e6f9396 → 0.0.1-commit.8c0b8ff
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 +28 -16
- 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/mock_epoch_cache.d.ts +3 -17
- package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
- package/dest/state_machine/mock_epoch_cache.js +2 -32
- package/dest/txe_session.d.ts +1 -1
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +11 -8
- package/dest/util/encoding.d.ts +18 -87
- package/dest/util/encoding.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/oracle/txe_oracle_top_level_context.ts +39 -21
- package/src/rpc_translator.ts +166 -35
- package/src/state_machine/mock_epoch_cache.ts +3 -42
- package/src/txe_session.ts +12 -9
package/dest/rpc_translator.js
CHANGED
|
@@ -161,9 +161,10 @@ export class RPCTranslator {
|
|
|
161
161
|
}
|
|
162
162
|
// PXE oracles
|
|
163
163
|
// eslint-disable-next-line camelcase
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
164
|
+
aztec_utl_assertCompatibleOracleVersionV2(foreignMajor, foreignMinor) {
|
|
165
|
+
const major = fromSingle(foreignMajor).toNumber();
|
|
166
|
+
const minor = fromSingle(foreignMinor).toNumber();
|
|
167
|
+
this.handlerAsMisc().assertCompatibleOracleVersion(major, minor);
|
|
167
168
|
return toForeignCallResult([]);
|
|
168
169
|
}
|
|
169
170
|
// eslint-disable-next-line camelcase
|
|
@@ -219,16 +220,16 @@ export class RPCTranslator {
|
|
|
219
220
|
]);
|
|
220
221
|
}
|
|
221
222
|
// eslint-disable-next-line camelcase
|
|
222
|
-
|
|
223
|
+
aztec_prv_setHashPreimage(foreignValues, foreignHash) {
|
|
223
224
|
const values = fromArray(foreignValues);
|
|
224
225
|
const hash = fromSingle(foreignHash);
|
|
225
|
-
this.handlerAsPrivate().
|
|
226
|
+
this.handlerAsPrivate().setHashPreimage(values, hash);
|
|
226
227
|
return toForeignCallResult([]);
|
|
227
228
|
}
|
|
228
229
|
// eslint-disable-next-line camelcase
|
|
229
|
-
async
|
|
230
|
+
async aztec_prv_getHashPreimage(foreignHash) {
|
|
230
231
|
const hash = fromSingle(foreignHash);
|
|
231
|
-
const returns = await this.handlerAsPrivate().
|
|
232
|
+
const returns = await this.handlerAsPrivate().getHashPreimage(hash);
|
|
232
233
|
return toForeignCallResult([
|
|
233
234
|
toArray(returns)
|
|
234
235
|
]);
|
|
@@ -244,12 +245,12 @@ export class RPCTranslator {
|
|
|
244
245
|
return toForeignCallResult([]);
|
|
245
246
|
}
|
|
246
247
|
// eslint-disable-next-line camelcase
|
|
247
|
-
async
|
|
248
|
+
async aztec_utl_getFromPublicStorage(foreignBlockHash, foreignContractAddress, foreignStartStorageSlot, foreignNumberOfElements) {
|
|
248
249
|
const blockHash = new BlockHash(fromSingle(foreignBlockHash));
|
|
249
250
|
const contractAddress = addressFromSingle(foreignContractAddress);
|
|
250
251
|
const startStorageSlot = fromSingle(foreignStartStorageSlot);
|
|
251
252
|
const numberOfElements = fromSingle(foreignNumberOfElements).toNumber();
|
|
252
|
-
const values = await this.handlerAsUtility().
|
|
253
|
+
const values = await this.handlerAsUtility().getFromPublicStorage(blockHash, contractAddress, startStorageSlot, numberOfElements);
|
|
253
254
|
return toForeignCallResult([
|
|
254
255
|
toArray(values)
|
|
255
256
|
]);
|
|
@@ -335,9 +336,9 @@ export class RPCTranslator {
|
|
|
335
336
|
]);
|
|
336
337
|
}
|
|
337
338
|
// eslint-disable-next-line camelcase
|
|
338
|
-
async
|
|
339
|
+
async aztec_utl_doesNullifierExist(foreignInnerNullifier) {
|
|
339
340
|
const innerNullifier = fromSingle(foreignInnerNullifier);
|
|
340
|
-
const exists = await this.handlerAsUtility().
|
|
341
|
+
const exists = await this.handlerAsUtility().doesNullifierExist(innerNullifier);
|
|
341
342
|
return toForeignCallResult([
|
|
342
343
|
toSingle(new Fr(exists))
|
|
343
344
|
]);
|
|
@@ -355,9 +356,9 @@ export class RPCTranslator {
|
|
|
355
356
|
].map(toSingle));
|
|
356
357
|
}
|
|
357
358
|
// eslint-disable-next-line camelcase
|
|
358
|
-
async
|
|
359
|
+
async aztec_utl_getPublicKeysAndPartialAddress(foreignAddress) {
|
|
359
360
|
const address = addressFromSingle(foreignAddress);
|
|
360
|
-
const result = await this.handlerAsUtility().
|
|
361
|
+
const result = await this.handlerAsUtility().getPublicKeysAndPartialAddress(address);
|
|
361
362
|
// We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
|
|
362
363
|
// with two fields: `some` (a boolean) and `value` (a field array in this case).
|
|
363
364
|
if (result === undefined) {
|
|
@@ -409,7 +410,7 @@ export class RPCTranslator {
|
|
|
409
410
|
]);
|
|
410
411
|
}
|
|
411
412
|
// eslint-disable-next-line camelcase
|
|
412
|
-
|
|
413
|
+
aztec_prv_assertValidPublicCalldata(_foreignCalldataHash) {
|
|
413
414
|
throw new Error('Enqueueing public calls is not supported in TestEnvironment::private_context');
|
|
414
415
|
}
|
|
415
416
|
// eslint-disable-next-line camelcase
|
|
@@ -417,9 +418,9 @@ export class RPCTranslator {
|
|
|
417
418
|
throw new Error('Enqueueing public calls is not supported in TestEnvironment::private_context');
|
|
418
419
|
}
|
|
419
420
|
// eslint-disable-next-line camelcase
|
|
420
|
-
async
|
|
421
|
+
async aztec_prv_isExecutionInRevertiblePhase(foreignSideEffectCounter) {
|
|
421
422
|
const sideEffectCounter = fromSingle(foreignSideEffectCounter).toNumber();
|
|
422
|
-
const isRevertible = await this.handlerAsPrivate().
|
|
423
|
+
const isRevertible = await this.handlerAsPrivate().isExecutionInRevertiblePhase(sideEffectCounter);
|
|
423
424
|
return toForeignCallResult([
|
|
424
425
|
toSingle(new Fr(isRevertible))
|
|
425
426
|
]);
|
|
@@ -469,51 +470,91 @@ export class RPCTranslator {
|
|
|
469
470
|
return toForeignCallResult(witness.toNoirRepresentation());
|
|
470
471
|
}
|
|
471
472
|
// eslint-disable-next-line camelcase
|
|
472
|
-
async
|
|
473
|
+
async aztec_utl_getPendingTaggedLogs(foreignPendingTaggedLogArrayBaseSlot, foreignScope) {
|
|
473
474
|
const pendingTaggedLogArrayBaseSlot = fromSingle(foreignPendingTaggedLogArrayBaseSlot);
|
|
474
|
-
|
|
475
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
476
|
+
await this.handlerAsUtility().getPendingTaggedLogs(pendingTaggedLogArrayBaseSlot, scope);
|
|
475
477
|
return toForeignCallResult([]);
|
|
476
478
|
}
|
|
477
479
|
// eslint-disable-next-line camelcase
|
|
478
|
-
async
|
|
480
|
+
async aztec_utl_getPendingTaggedLogs_v2(foreignScope) {
|
|
481
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
482
|
+
const slot = await this.handlerAsUtility().getPendingTaggedLogsV2(scope);
|
|
483
|
+
return toForeignCallResult([
|
|
484
|
+
toSingle(slot)
|
|
485
|
+
]);
|
|
486
|
+
}
|
|
487
|
+
// eslint-disable-next-line camelcase
|
|
488
|
+
async aztec_utl_validateAndStoreEnqueuedNotesAndEvents(foreignContractAddress, foreignNoteValidationRequestsArrayBaseSlot, foreignEventValidationRequestsArrayBaseSlot, foreignMaxNotePackedLen, foreignMaxEventSerializedLen, foreignScope) {
|
|
479
489
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
480
490
|
const noteValidationRequestsArrayBaseSlot = fromSingle(foreignNoteValidationRequestsArrayBaseSlot);
|
|
481
491
|
const eventValidationRequestsArrayBaseSlot = fromSingle(foreignEventValidationRequestsArrayBaseSlot);
|
|
482
492
|
const maxNotePackedLen = fromSingle(foreignMaxNotePackedLen).toNumber();
|
|
483
493
|
const maxEventSerializedLen = fromSingle(foreignMaxEventSerializedLen).toNumber();
|
|
484
|
-
|
|
494
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
495
|
+
await this.handlerAsUtility().validateAndStoreEnqueuedNotesAndEvents(contractAddress, noteValidationRequestsArrayBaseSlot, eventValidationRequestsArrayBaseSlot, maxNotePackedLen, maxEventSerializedLen, scope);
|
|
496
|
+
return toForeignCallResult([]);
|
|
497
|
+
}
|
|
498
|
+
// eslint-disable-next-line camelcase
|
|
499
|
+
async aztec_utl_validateAndStoreEnqueuedNotesAndEvents_v2(foreignNoteValidationRequestsArrayBaseSlot, foreignEventValidationRequestsArrayBaseSlot, foreignMaxNotePackedLen, foreignMaxEventSerializedLen, foreignScope) {
|
|
500
|
+
const noteValidationRequestsArrayBaseSlot = fromSingle(foreignNoteValidationRequestsArrayBaseSlot);
|
|
501
|
+
const eventValidationRequestsArrayBaseSlot = fromSingle(foreignEventValidationRequestsArrayBaseSlot);
|
|
502
|
+
const maxNotePackedLen = fromSingle(foreignMaxNotePackedLen).toNumber();
|
|
503
|
+
const maxEventSerializedLen = fromSingle(foreignMaxEventSerializedLen).toNumber();
|
|
504
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
505
|
+
await this.handlerAsUtility().validateAndStoreEnqueuedNotesAndEventsV2(noteValidationRequestsArrayBaseSlot, eventValidationRequestsArrayBaseSlot, maxNotePackedLen, maxEventSerializedLen, scope);
|
|
485
506
|
return toForeignCallResult([]);
|
|
486
507
|
}
|
|
487
508
|
// eslint-disable-next-line camelcase
|
|
488
|
-
async
|
|
509
|
+
async aztec_utl_getLogsByTag(foreignContractAddress, foreignLogRetrievalRequestsArrayBaseSlot, foreignLogRetrievalResponsesArrayBaseSlot, foreignScope) {
|
|
489
510
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
490
511
|
const logRetrievalRequestsArrayBaseSlot = fromSingle(foreignLogRetrievalRequestsArrayBaseSlot);
|
|
491
512
|
const logRetrievalResponsesArrayBaseSlot = fromSingle(foreignLogRetrievalResponsesArrayBaseSlot);
|
|
492
|
-
|
|
513
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
514
|
+
await this.handlerAsUtility().getLogsByTag(contractAddress, logRetrievalRequestsArrayBaseSlot, logRetrievalResponsesArrayBaseSlot, scope);
|
|
493
515
|
return toForeignCallResult([]);
|
|
494
516
|
}
|
|
495
517
|
// eslint-disable-next-line camelcase
|
|
496
|
-
async
|
|
518
|
+
async aztec_utl_getMessageContextsByTxHash(foreignContractAddress, foreignMessageContextRequestsArrayBaseSlot, foreignMessageContextResponsesArrayBaseSlot, foreignScope) {
|
|
497
519
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
498
520
|
const messageContextRequestsArrayBaseSlot = fromSingle(foreignMessageContextRequestsArrayBaseSlot);
|
|
499
521
|
const messageContextResponsesArrayBaseSlot = fromSingle(foreignMessageContextResponsesArrayBaseSlot);
|
|
500
|
-
|
|
522
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
523
|
+
await this.handlerAsUtility().getMessageContextsByTxHash(contractAddress, messageContextRequestsArrayBaseSlot, messageContextResponsesArrayBaseSlot, scope);
|
|
501
524
|
return toForeignCallResult([]);
|
|
502
525
|
}
|
|
503
526
|
// eslint-disable-next-line camelcase
|
|
504
|
-
async
|
|
527
|
+
async aztec_utl_getLogsByTag_v2(foreignRequestArrayBaseSlot) {
|
|
528
|
+
const requestArrayBaseSlot = fromSingle(foreignRequestArrayBaseSlot);
|
|
529
|
+
const responseSlot = await this.handlerAsUtility().getLogsByTagV2(requestArrayBaseSlot);
|
|
530
|
+
return toForeignCallResult([
|
|
531
|
+
toSingle(responseSlot)
|
|
532
|
+
]);
|
|
533
|
+
}
|
|
534
|
+
// eslint-disable-next-line camelcase
|
|
535
|
+
async aztec_utl_getMessageContextsByTxHash_v2(foreignRequestArrayBaseSlot) {
|
|
536
|
+
const requestArrayBaseSlot = fromSingle(foreignRequestArrayBaseSlot);
|
|
537
|
+
const responseSlot = await this.handlerAsUtility().getMessageContextsByTxHashV2(requestArrayBaseSlot);
|
|
538
|
+
return toForeignCallResult([
|
|
539
|
+
toSingle(responseSlot)
|
|
540
|
+
]);
|
|
541
|
+
}
|
|
542
|
+
// eslint-disable-next-line camelcase
|
|
543
|
+
aztec_utl_setCapsule(foreignContractAddress, foreignSlot, foreignCapsule, foreignScope) {
|
|
505
544
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
506
545
|
const slot = fromSingle(foreignSlot);
|
|
507
546
|
const capsule = fromArray(foreignCapsule);
|
|
508
|
-
|
|
547
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
548
|
+
this.handlerAsUtility().setCapsule(contractAddress, slot, capsule, scope);
|
|
509
549
|
return toForeignCallResult([]);
|
|
510
550
|
}
|
|
511
551
|
// eslint-disable-next-line camelcase
|
|
512
|
-
async
|
|
552
|
+
async aztec_utl_getCapsule(foreignContractAddress, foreignSlot, foreignTSize, foreignScope) {
|
|
513
553
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
514
554
|
const slot = fromSingle(foreignSlot);
|
|
515
555
|
const tSize = fromSingle(foreignTSize).toNumber();
|
|
516
|
-
const
|
|
556
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
557
|
+
const values = await this.handlerAsUtility().getCapsule(contractAddress, slot, scope);
|
|
517
558
|
// We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
|
|
518
559
|
// with two fields: `some` (a boolean) and `value` (a field array in this case).
|
|
519
560
|
if (values === null) {
|
|
@@ -531,19 +572,76 @@ export class RPCTranslator {
|
|
|
531
572
|
}
|
|
532
573
|
}
|
|
533
574
|
// eslint-disable-next-line camelcase
|
|
534
|
-
|
|
575
|
+
aztec_utl_deleteCapsule(foreignContractAddress, foreignSlot, foreignScope) {
|
|
535
576
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
536
577
|
const slot = fromSingle(foreignSlot);
|
|
537
|
-
|
|
578
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
579
|
+
this.handlerAsUtility().deleteCapsule(contractAddress, slot, scope);
|
|
538
580
|
return toForeignCallResult([]);
|
|
539
581
|
}
|
|
540
582
|
// eslint-disable-next-line camelcase
|
|
541
|
-
async aztec_utl_copyCapsule(foreignContractAddress, foreignSrcSlot, foreignDstSlot, foreignNumEntries) {
|
|
583
|
+
async aztec_utl_copyCapsule(foreignContractAddress, foreignSrcSlot, foreignDstSlot, foreignNumEntries, foreignScope) {
|
|
542
584
|
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
543
585
|
const srcSlot = fromSingle(foreignSrcSlot);
|
|
544
586
|
const dstSlot = fromSingle(foreignDstSlot);
|
|
545
587
|
const numEntries = fromSingle(foreignNumEntries).toNumber();
|
|
546
|
-
|
|
588
|
+
const scope = AztecAddress.fromField(fromSingle(foreignScope));
|
|
589
|
+
await this.handlerAsUtility().copyCapsule(contractAddress, srcSlot, dstSlot, numEntries, scope);
|
|
590
|
+
return toForeignCallResult([]);
|
|
591
|
+
}
|
|
592
|
+
// eslint-disable-next-line camelcase
|
|
593
|
+
aztec_utl_pushEphemeral(foreignSlot, foreignElements) {
|
|
594
|
+
const slot = fromSingle(foreignSlot);
|
|
595
|
+
const elements = fromArray(foreignElements);
|
|
596
|
+
const newLen = this.handlerAsUtility().pushEphemeral(slot, elements);
|
|
597
|
+
return toForeignCallResult([
|
|
598
|
+
toSingle(new Fr(newLen))
|
|
599
|
+
]);
|
|
600
|
+
}
|
|
601
|
+
// eslint-disable-next-line camelcase
|
|
602
|
+
aztec_utl_popEphemeral(foreignSlot) {
|
|
603
|
+
const slot = fromSingle(foreignSlot);
|
|
604
|
+
const element = this.handlerAsUtility().popEphemeral(slot);
|
|
605
|
+
return toForeignCallResult([
|
|
606
|
+
toArray(element)
|
|
607
|
+
]);
|
|
608
|
+
}
|
|
609
|
+
// eslint-disable-next-line camelcase
|
|
610
|
+
aztec_utl_getEphemeral(foreignSlot, foreignIndex) {
|
|
611
|
+
const slot = fromSingle(foreignSlot);
|
|
612
|
+
const index = fromSingle(foreignIndex).toNumber();
|
|
613
|
+
const element = this.handlerAsUtility().getEphemeral(slot, index);
|
|
614
|
+
return toForeignCallResult([
|
|
615
|
+
toArray(element)
|
|
616
|
+
]);
|
|
617
|
+
}
|
|
618
|
+
// eslint-disable-next-line camelcase
|
|
619
|
+
aztec_utl_setEphemeral(foreignSlot, foreignIndex, foreignElements) {
|
|
620
|
+
const slot = fromSingle(foreignSlot);
|
|
621
|
+
const index = fromSingle(foreignIndex).toNumber();
|
|
622
|
+
const elements = fromArray(foreignElements);
|
|
623
|
+
this.handlerAsUtility().setEphemeral(slot, index, elements);
|
|
624
|
+
return toForeignCallResult([]);
|
|
625
|
+
}
|
|
626
|
+
// eslint-disable-next-line camelcase
|
|
627
|
+
aztec_utl_getEphemeralLen(foreignSlot) {
|
|
628
|
+
const slot = fromSingle(foreignSlot);
|
|
629
|
+
const len = this.handlerAsUtility().getEphemeralLen(slot);
|
|
630
|
+
return toForeignCallResult([
|
|
631
|
+
toSingle(new Fr(len))
|
|
632
|
+
]);
|
|
633
|
+
}
|
|
634
|
+
// eslint-disable-next-line camelcase
|
|
635
|
+
aztec_utl_removeEphemeral(foreignSlot, foreignIndex) {
|
|
636
|
+
const slot = fromSingle(foreignSlot);
|
|
637
|
+
const index = fromSingle(foreignIndex).toNumber();
|
|
638
|
+
this.handlerAsUtility().removeEphemeral(slot, index);
|
|
639
|
+
return toForeignCallResult([]);
|
|
640
|
+
}
|
|
641
|
+
// eslint-disable-next-line camelcase
|
|
642
|
+
aztec_utl_clearEphemeral(foreignSlot) {
|
|
643
|
+
const slot = fromSingle(foreignSlot);
|
|
644
|
+
this.handlerAsUtility().clearEphemeral(slot);
|
|
547
645
|
return toForeignCallResult([]);
|
|
548
646
|
}
|
|
549
647
|
// TODO: I forgot to add a corresponding function here, when I introduced an oracle method to txe_oracle.ts.
|
|
@@ -551,13 +649,13 @@ export class RPCTranslator {
|
|
|
551
649
|
// to implement this function here. Isn't there a way to programmatically identify that this is missing, given the
|
|
552
650
|
// existence of a txe_oracle method?
|
|
553
651
|
// eslint-disable-next-line camelcase
|
|
554
|
-
async
|
|
652
|
+
async aztec_utl_decryptAes128(foreignCiphertextBVecStorage, foreignCiphertextLength, foreignIv, foreignSymKey) {
|
|
555
653
|
const ciphertext = fromUintBoundedVec(foreignCiphertextBVecStorage, foreignCiphertextLength, 8);
|
|
556
654
|
const iv = fromUintArray(foreignIv, 8);
|
|
557
655
|
const symKey = fromUintArray(foreignSymKey, 8);
|
|
558
656
|
// Noir Option<BoundedVec> is encoded as [is_some: Field, storage: Field[], length: Field].
|
|
559
657
|
try {
|
|
560
|
-
const plaintextBuffer = await this.handlerAsUtility().
|
|
658
|
+
const plaintextBuffer = await this.handlerAsUtility().decryptAes128(ciphertext, iv, symKey);
|
|
561
659
|
const [storage, length] = arrayToBoundedVec(bufferToU8Array(plaintextBuffer), foreignCiphertextBVecStorage.length);
|
|
562
660
|
return toForeignCallResult([
|
|
563
661
|
toSingle(new Fr(1)),
|
|
@@ -574,22 +672,25 @@ export class RPCTranslator {
|
|
|
574
672
|
}
|
|
575
673
|
}
|
|
576
674
|
// eslint-disable-next-line camelcase
|
|
577
|
-
async aztec_utl_getSharedSecret(foreignAddress, foreignEphPKField0, foreignEphPKField1, foreignEphPKField2) {
|
|
675
|
+
async aztec_utl_getSharedSecret(foreignAddress, foreignEphPKField0, foreignEphPKField1, foreignEphPKField2, foreignContractAddress) {
|
|
578
676
|
const address = AztecAddress.fromField(fromSingle(foreignAddress));
|
|
579
677
|
const ephPK = Point.fromFields([
|
|
580
678
|
fromSingle(foreignEphPKField0),
|
|
581
679
|
fromSingle(foreignEphPKField1),
|
|
582
680
|
fromSingle(foreignEphPKField2)
|
|
583
681
|
]);
|
|
584
|
-
const
|
|
585
|
-
|
|
682
|
+
const contractAddress = AztecAddress.fromField(fromSingle(foreignContractAddress));
|
|
683
|
+
const secret = await this.handlerAsUtility().getSharedSecret(address, ephPK, contractAddress);
|
|
684
|
+
return toForeignCallResult([
|
|
685
|
+
toSingle(secret)
|
|
686
|
+
]);
|
|
586
687
|
}
|
|
587
688
|
// eslint-disable-next-line camelcase
|
|
588
|
-
|
|
689
|
+
aztec_utl_setContractSyncCacheInvalid(foreignContractAddress, foreignScopes, foreignScopeCount) {
|
|
589
690
|
const contractAddress = addressFromSingle(foreignContractAddress);
|
|
590
691
|
const count = fromSingle(foreignScopeCount).toNumber();
|
|
591
692
|
const scopes = fromArray(foreignScopes).slice(0, count).map((f)=>new AztecAddress(f));
|
|
592
|
-
this.handlerAsUtility().
|
|
693
|
+
this.handlerAsUtility().setContractSyncCacheInvalid(contractAddress, scopes);
|
|
593
694
|
return Promise.resolve(toForeignCallResult([]));
|
|
594
695
|
}
|
|
595
696
|
// eslint-disable-next-line camelcase
|
|
@@ -7,37 +7,23 @@ import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
|
7
7
|
* Since in TXE we don't validate transactions, mock suffices here.
|
|
8
8
|
*/
|
|
9
9
|
export declare class MockEpochCache implements EpochCacheInterface {
|
|
10
|
-
getCommittee(
|
|
11
|
-
getSlotNow(): SlotNumber;
|
|
12
|
-
getTargetSlot(): SlotNumber;
|
|
13
|
-
getEpochNow(): EpochNumber;
|
|
14
|
-
getTargetEpoch(): EpochNumber;
|
|
10
|
+
getCommittee(): Promise<EpochCommitteeInfo>;
|
|
15
11
|
getEpochAndSlotNow(): EpochAndSlot & {
|
|
16
12
|
nowMs: bigint;
|
|
17
13
|
};
|
|
18
14
|
getEpochAndSlotInNextL1Slot(): EpochAndSlot & {
|
|
19
|
-
|
|
15
|
+
now: bigint;
|
|
20
16
|
};
|
|
21
|
-
getTargetEpochAndSlotInNextL1Slot(): EpochAndSlot & {
|
|
22
|
-
nowSeconds: bigint;
|
|
23
|
-
};
|
|
24
|
-
isProposerPipeliningEnabled(): boolean;
|
|
25
17
|
getProposerIndexEncoding(_epoch: EpochNumber, _slot: SlotNumber, _seed: bigint): `0x${string}`;
|
|
26
18
|
computeProposerIndex(_slot: SlotNumber, _epoch: EpochNumber, _seed: bigint, _size: bigint): bigint;
|
|
27
19
|
getCurrentAndNextSlot(): {
|
|
28
20
|
currentSlot: SlotNumber;
|
|
29
21
|
nextSlot: SlotNumber;
|
|
30
22
|
};
|
|
31
|
-
getTargetAndNextSlot(): {
|
|
32
|
-
targetSlot: SlotNumber;
|
|
33
|
-
nextSlot: SlotNumber;
|
|
34
|
-
};
|
|
35
23
|
getProposerAttesterAddressInSlot(_slot: SlotNumber): Promise<EthAddress | undefined>;
|
|
36
24
|
isInCommittee(_slot: SlotTag, _validator: EthAddress): Promise<boolean>;
|
|
37
25
|
getRegisteredValidators(): Promise<EthAddress[]>;
|
|
38
26
|
filterInCommittee(_slot: SlotTag, _validators: EthAddress[]): Promise<EthAddress[]>;
|
|
39
|
-
isEscapeHatchOpen(_epoch: EpochNumber): Promise<boolean>;
|
|
40
|
-
isEscapeHatchOpenAtSlot(_slot: SlotTag): Promise<boolean>;
|
|
41
27
|
getL1Constants(): L1RollupConstants;
|
|
42
28
|
}
|
|
43
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9ja19lcG9jaF9jYWNoZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3N0YXRlX21hY2hpbmUvbW9ja19lcG9jaF9jYWNoZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsbUJBQW1CLEVBQUUsa0JBQWtCLEVBQUUsT0FBTyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDekcsT0FBTyxFQUFFL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XRFO0lBRUQsdUJBQXVCLElBQUksT0FBTyxDQUFDLFVBQVUsRUFBRSxDQUFDLENBRS9DO0lBRUQsaUJBQWlCLENBQUMsS0FBSyxFQUFFLE9BQU8sRUFBRSxXQUFXLEVBQUUsVUFBVSxFQUFFLEdBQUcsT0FBTyxDQUFDLFVBQVUsRUFBRSxDQUFDLENBRWxGO0lBRUQsY0FBYyxJQUFJLGlCQUFpQixDQUVsQztDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock_epoch_cache.d.ts","sourceRoot":"","sources":["../../src/state_machine/mock_epoch_cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACzG,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAA0B,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAE7F;;;GAGG;AACH,qBAAa,cAAe,YAAW,mBAAmB;IACxD,YAAY,
|
|
1
|
+
{"version":3,"file":"mock_epoch_cache.d.ts","sourceRoot":"","sources":["../../src/state_machine/mock_epoch_cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACzG,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAA0B,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAE7F;;;GAGG;AACH,qBAAa,cAAe,YAAW,mBAAmB;IACxD,YAAY,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAO1C;IAED,kBAAkB,IAAI,YAAY,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAOrD;IAED,2BAA2B,IAAI,YAAY,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAO5D;IAED,wBAAwB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,CAE7F;IAED,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjG;IAED,qBAAqB,IAAI;QAAE,WAAW,EAAE,UAAU,CAAC;QAAC,QAAQ,EAAE,UAAU,CAAA;KAAE,CAKzE;IAED,gCAAgC,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAEnF;IAED,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAEtE;IAED,uBAAuB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAE/C;IAED,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAElF;IAED,cAAc,IAAI,iBAAiB,CAElC;CACF"}
|
|
@@ -4,7 +4,7 @@ import { EmptyL1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
|
4
4
|
* Mock implementation of the EpochCacheInterface used to satisfy dependencies of AztecNodeService.
|
|
5
5
|
* Since in TXE we don't validate transactions, mock suffices here.
|
|
6
6
|
*/ export class MockEpochCache {
|
|
7
|
-
getCommittee(
|
|
7
|
+
getCommittee() {
|
|
8
8
|
return Promise.resolve({
|
|
9
9
|
committee: undefined,
|
|
10
10
|
seed: 0n,
|
|
@@ -12,18 +12,6 @@ import { EmptyL1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
|
12
12
|
isEscapeHatchOpen: false
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
getSlotNow() {
|
|
16
|
-
return SlotNumber(0);
|
|
17
|
-
}
|
|
18
|
-
getTargetSlot() {
|
|
19
|
-
return SlotNumber(0);
|
|
20
|
-
}
|
|
21
|
-
getEpochNow() {
|
|
22
|
-
return EpochNumber.ZERO;
|
|
23
|
-
}
|
|
24
|
-
getTargetEpoch() {
|
|
25
|
-
return EpochNumber.ZERO;
|
|
26
|
-
}
|
|
27
15
|
getEpochAndSlotNow() {
|
|
28
16
|
return {
|
|
29
17
|
epoch: EpochNumber.ZERO,
|
|
@@ -37,15 +25,9 @@ import { EmptyL1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
|
37
25
|
epoch: EpochNumber.ZERO,
|
|
38
26
|
slot: SlotNumber(0),
|
|
39
27
|
ts: 0n,
|
|
40
|
-
|
|
28
|
+
now: 0n
|
|
41
29
|
};
|
|
42
30
|
}
|
|
43
|
-
getTargetEpochAndSlotInNextL1Slot() {
|
|
44
|
-
return this.getEpochAndSlotInNextL1Slot();
|
|
45
|
-
}
|
|
46
|
-
isProposerPipeliningEnabled() {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
31
|
getProposerIndexEncoding(_epoch, _slot, _seed) {
|
|
50
32
|
return '0x00';
|
|
51
33
|
}
|
|
@@ -58,12 +40,6 @@ import { EmptyL1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
|
58
40
|
nextSlot: SlotNumber(0)
|
|
59
41
|
};
|
|
60
42
|
}
|
|
61
|
-
getTargetAndNextSlot() {
|
|
62
|
-
return {
|
|
63
|
-
targetSlot: SlotNumber(0),
|
|
64
|
-
nextSlot: SlotNumber(0)
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
43
|
getProposerAttesterAddressInSlot(_slot) {
|
|
68
44
|
return Promise.resolve(undefined);
|
|
69
45
|
}
|
|
@@ -76,12 +52,6 @@ import { EmptyL1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
|
76
52
|
filterInCommittee(_slot, _validators) {
|
|
77
53
|
return Promise.resolve([]);
|
|
78
54
|
}
|
|
79
|
-
isEscapeHatchOpen(_epoch) {
|
|
80
|
-
return Promise.resolve(false);
|
|
81
|
-
}
|
|
82
|
-
isEscapeHatchOpenAtSlot(_slot) {
|
|
83
|
-
return Promise.resolve(false);
|
|
84
|
-
}
|
|
85
55
|
getL1Constants() {
|
|
86
56
|
return EmptyL1RollupConstants;
|
|
87
57
|
}
|
package/dest/txe_session.d.ts
CHANGED
|
@@ -76,4 +76,4 @@ export declare class TXESession implements TXESessionStateHandler {
|
|
|
76
76
|
private utilityExecutorForContractSync;
|
|
77
77
|
}
|
|
78
78
|
export {};
|
|
79
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
79
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX3Nlc3Npb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy90eGVfc2Vzc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDOUQsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBZ0IsTUFBTSx1QkFBdUIsQ0FBQztBQUNsRSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFNUMsT0FBTyxFQUNMLFlBQVksRUFHWixZQUFZLEVBQ1osYUFBYSxFQUNiLG1CQUFtQixFQUNuQixjQUFjLEVBRWQsU0FBUyxFQUNULGlCQUFpQixFQUNqQixxQkFBcUIsRUFDckIsc0JBQXNCLEVBQ3RCLGtCQUFrQixFQUNuQixNQUFNLG1CQUFtQixDQUFDO0FBQzNCLE9B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CQUFpQixDQUNyQixlQUFlLEdBQUUsWUFBOEIsRUFDL0MsaUJBQWlCLENBQUMsRUFBRSxXQUFXLEdBQzlCLE9BQU8sQ0FBQyxvQkFBb0IsQ0FBQyxDQWdFL0I7SUFFSyxnQkFBZ0IsQ0FBQyxlQUFlLENBQUMsRUFBRSxZQUFZLGlCQXNCcEQ7SUFFSyxpQkFBaUIsQ0FBQyxlQUFlLEdBQUUsWUFBOEIsaUJBd0N0RTtJQUVELE9BQU8sQ0FBQyxpQkFBaUI7WUFpQlgsZ0JBQWdCO1lBNkJoQixlQUFlO0lBUzdCLE9BQU8sQ0FBQyxrQkFBa0I7SUFNMUIsT0FBTyxDQUFDLDhCQUE4QjtDQStDdkMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"txe_session.d.ts","sourceRoot":"","sources":["../src/txe_session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"txe_session.d.ts","sourceRoot":"","sources":["../src/txe_session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EACL,YAAY,EAGZ,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,cAAc,EAEd,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B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,IAAI,CAAC,aAAa,EAAE,aAAa,uBA6E7C;IAED;;;;;OAKG;IACH,eAAe,CAAC,YAAY,EAAE,qBAAqB,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAuBxG;IAED,aAAa,IAAI,MAAM,CAEtB;IAED,4EAA4E;IACtE,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAIhC;IAEK,kBAAkB,kBA8CvB;IAEK,iBAAiB,CACrB,eAAe,GAAE,YAA8B,EAC/C,iBAAiB,CAAC,EAAE,WAAW,GAC9B,OAAO,CAAC,oBAAoB,CAAC,CAgE/B;IAEK,gBAAgB,CAAC,eAAe,CAAC,EAAE,YAAY,iBAsBpD;IAEK,iBAAiB,CAAC,eAAe,GAAE,YAA8B,iBAwCtE;IAED,OAAO,CAAC,iBAAiB;YAiBX,gBAAgB;YA6BhB,eAAe;IAS7B,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,8BAA8B;CA+CvC"}
|
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,12 @@ 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
|
+
l2TipsStore: this.stateMachine.node,
|
|
212
213
|
jobId: this.currentJobId,
|
|
213
|
-
scopes:
|
|
214
|
+
scopes: await this.keyStore.getAccounts(),
|
|
214
215
|
messageContextService: this.stateMachine.messageContextService
|
|
215
216
|
});
|
|
216
217
|
// We store the note and tagging index caches fed into the PrivateExecutionOracle (along with some other auxiliary
|
|
@@ -252,7 +253,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
252
253
|
// we perform this. We therefore search for known nullifiers now, as otherwise notes that were nullified would not
|
|
253
254
|
// be removed from the database.
|
|
254
255
|
// 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,
|
|
256
|
+
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlockHeader, this.currentJobId).syncNoteNullifiers(contractAddress, await this.keyStore.getAccounts());
|
|
256
257
|
this.oracleHandler = new UtilityExecutionOracle({
|
|
257
258
|
contractAddress,
|
|
258
259
|
authWitnesses: [],
|
|
@@ -265,12 +266,13 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
265
266
|
aztecNode: this.stateMachine.node,
|
|
266
267
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
267
268
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
268
|
-
|
|
269
|
+
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
269
270
|
privateEventStore: this.privateEventStore,
|
|
270
271
|
messageContextService: this.stateMachine.messageContextService,
|
|
271
272
|
contractSyncService: this.contractSyncService,
|
|
273
|
+
l2TipsStore: this.stateMachine.node,
|
|
272
274
|
jobId: this.currentJobId,
|
|
273
|
-
scopes:
|
|
275
|
+
scopes: await this.keyStore.getAccounts()
|
|
274
276
|
});
|
|
275
277
|
this.state = {
|
|
276
278
|
name: 'UTILITY'
|
|
@@ -346,10 +348,11 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
346
348
|
aztecNode: this.stateMachine.node,
|
|
347
349
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
348
350
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
349
|
-
|
|
351
|
+
capsuleService: new CapsuleService(this.capsuleStore, scopes),
|
|
350
352
|
privateEventStore: this.privateEventStore,
|
|
351
353
|
messageContextService: this.stateMachine.messageContextService,
|
|
352
354
|
contractSyncService: this.contractSyncService,
|
|
355
|
+
l2TipsStore: this.stateMachine.node,
|
|
353
356
|
jobId: this.currentJobId,
|
|
354
357
|
scopes
|
|
355
358
|
});
|