@aztec/stdlib 3.0.0-nightly.20251114 → 3.0.0-nightly.20251118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/avm/avm.d.ts +139 -45
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +58 -19
- package/dest/avm/avm_proving_request.d.ts +21 -21
- package/dest/avm/public_data_write.d.ts +1 -1
- package/dest/avm/public_data_write.d.ts.map +1 -1
- package/dest/avm/revert_code.d.ts +2 -1
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +8 -8
- package/dest/block/body.d.ts +3 -6
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +6 -25
- package/dest/block/index.d.ts +1 -0
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -0
- package/dest/block/l2_block.d.ts +5 -0
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +34 -4
- package/dest/block/l2_block_new.d.ts +97 -0
- package/dest/block/l2_block_new.d.ts.map +1 -0
- package/dest/block/l2_block_new.js +113 -0
- package/dest/checkpoint/checkpoint.d.ts +108 -0
- package/dest/checkpoint/checkpoint.d.ts.map +1 -0
- package/dest/checkpoint/checkpoint.js +39 -0
- package/dest/checkpoint/index.d.ts +1 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +1 -1
- package/dest/interfaces/proving-job.d.ts +21 -21
- package/dest/logs/private_log.d.ts +1 -1
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +2 -5
- package/dest/messaging/in_hash.d.ts +4 -0
- package/dest/messaging/in_hash.d.ts.map +1 -0
- package/dest/messaging/in_hash.js +15 -0
- package/dest/messaging/index.d.ts +2 -0
- package/dest/messaging/index.d.ts.map +1 -1
- package/dest/messaging/index.js +2 -0
- package/dest/messaging/out_hash.d.ts +5 -0
- package/dest/messaging/out_hash.d.ts.map +1 -0
- package/dest/messaging/out_hash.js +28 -0
- package/dest/rollup/checkpoint_constant_data.d.ts +16 -0
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.js +17 -0
- package/dest/tests/factories.d.ts +21 -25
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +24 -121
- package/dest/tests/mocks.d.ts +17 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +108 -4
- package/dest/tx/partial_state_reference.d.ts +3 -0
- package/dest/tx/partial_state_reference.d.ts.map +1 -1
- package/dest/tx/partial_state_reference.js +10 -0
- package/dest/tx/state_reference.d.ts +3 -0
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/state_reference.js +9 -0
- package/dest/tx/tx_effect.d.ts +9 -6
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +53 -57
- package/dest/vks/verification_key.d.ts +9 -0
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/verification_key.js +20 -0
- package/package.json +8 -8
- package/src/avm/avm.ts +66 -28
- package/src/avm/public_data_write.ts +1 -1
- package/src/avm/revert_code.ts +9 -8
- package/src/block/body.ts +7 -32
- package/src/block/index.ts +1 -0
- package/src/block/l2_block.ts +33 -2
- package/src/block/l2_block_new.ts +143 -0
- package/src/checkpoint/checkpoint.ts +46 -0
- package/src/checkpoint/index.ts +1 -1
- package/src/logs/private_log.ts +2 -3
- package/src/messaging/in_hash.ts +15 -0
- package/src/messaging/index.ts +2 -0
- package/src/messaging/out_hash.ts +36 -0
- package/src/rollup/checkpoint_constant_data.ts +20 -0
- package/src/tests/factories.ts +109 -211
- package/src/tests/mocks.ts +196 -4
- package/src/tx/partial_state_reference.ts +9 -0
- package/src/tx/state_reference.ts +9 -0
- package/src/tx/tx_effect.ts +61 -67
- package/src/vks/verification_key.ts +25 -0
- package/dest/checkpoint/checkpoint_body.d.ts +0 -4
- package/dest/checkpoint/checkpoint_body.d.ts.map +0 -1
- package/dest/checkpoint/checkpoint_body.js +0 -9
- package/src/checkpoint/checkpoint_body.ts +0 -10
package/dest/avm/avm.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DEFAULT_MAX_DEBUG_LOG_MEMORY_READS } from '@aztec/constants';
|
|
1
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
3
|
import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
4
|
import { z } from 'zod';
|
|
@@ -499,11 +500,11 @@ export class AvmRevertCheckpointHint {
|
|
|
499
500
|
return new AvmRevertCheckpointHint(obj.actionCounter, obj.oldCheckpointId, obj.newCheckpointId, TreeSnapshots.fromPlainObject(obj.stateBefore), TreeSnapshots.fromPlainObject(obj.stateAfter));
|
|
500
501
|
}
|
|
501
502
|
}
|
|
502
|
-
export class
|
|
503
|
+
export class AvmContractDbCreateCheckpointHint extends AvmCheckpointActionNoStateChangeHint {
|
|
503
504
|
}
|
|
504
|
-
export class
|
|
505
|
+
export class AvmContractDbCommitCheckpointHint extends AvmCheckpointActionNoStateChangeHint {
|
|
505
506
|
}
|
|
506
|
-
export class
|
|
507
|
+
export class AvmContractDbRevertCheckpointHint extends AvmCheckpointActionNoStateChangeHint {
|
|
507
508
|
}
|
|
508
509
|
////////////////////////////////////////////////////////////////////////////
|
|
509
510
|
// Hints (other)
|
|
@@ -620,9 +621,9 @@ export class AvmExecutionHints {
|
|
|
620
621
|
contractClasses;
|
|
621
622
|
bytecodeCommitments;
|
|
622
623
|
debugFunctionNames;
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
624
|
+
contractDbCreateCheckpointHints;
|
|
625
|
+
contractDbCommitCheckpointHints;
|
|
626
|
+
contractDbRevertCheckpointHints;
|
|
626
627
|
startingTreeRoots;
|
|
627
628
|
getSiblingPathHints;
|
|
628
629
|
getPreviousValueIndexHints;
|
|
@@ -637,7 +638,7 @@ export class AvmExecutionHints {
|
|
|
637
638
|
revertCheckpointHints;
|
|
638
639
|
constructor(globalVariables, tx, // Protocol contracts.
|
|
639
640
|
protocolContracts, // Contract hints.
|
|
640
|
-
contractInstances = [], contractClasses = [], bytecodeCommitments = [], debugFunctionNames = [],
|
|
641
|
+
contractInstances = [], contractClasses = [], bytecodeCommitments = [], debugFunctionNames = [], contractDbCreateCheckpointHints = [], contractDbCommitCheckpointHints = [], contractDbRevertCheckpointHints = [], // Merkle DB hints.
|
|
641
642
|
startingTreeRoots = TreeSnapshots.empty(), getSiblingPathHints = [], getPreviousValueIndexHints = [], getLeafPreimageHintsPublicDataTree = [], getLeafPreimageHintsNullifierTree = [], getLeafValueHints = [], sequentialInsertHintsPublicDataTree = [], sequentialInsertHintsNullifierTree = [], appendLeavesHints = [], createCheckpointHints = [], commitCheckpointHints = [], revertCheckpointHints = []){
|
|
642
643
|
this.globalVariables = globalVariables;
|
|
643
644
|
this.tx = tx;
|
|
@@ -646,9 +647,9 @@ export class AvmExecutionHints {
|
|
|
646
647
|
this.contractClasses = contractClasses;
|
|
647
648
|
this.bytecodeCommitments = bytecodeCommitments;
|
|
648
649
|
this.debugFunctionNames = debugFunctionNames;
|
|
649
|
-
this.
|
|
650
|
-
this.
|
|
651
|
-
this.
|
|
650
|
+
this.contractDbCreateCheckpointHints = contractDbCreateCheckpointHints;
|
|
651
|
+
this.contractDbCommitCheckpointHints = contractDbCommitCheckpointHints;
|
|
652
|
+
this.contractDbRevertCheckpointHints = contractDbRevertCheckpointHints;
|
|
652
653
|
this.startingTreeRoots = startingTreeRoots;
|
|
653
654
|
this.getSiblingPathHints = getSiblingPathHints;
|
|
654
655
|
this.getPreviousValueIndexHints = getPreviousValueIndexHints;
|
|
@@ -672,7 +673,7 @@ export class AvmExecutionHints {
|
|
|
672
673
|
if (obj instanceof AvmExecutionHints) {
|
|
673
674
|
return obj;
|
|
674
675
|
}
|
|
675
|
-
return new AvmExecutionHints(GlobalVariables.fromPlainObject(obj.globalVariables), AvmTxHint.fromPlainObject(obj.tx), ProtocolContracts.fromPlainObject(obj.protocolContracts), obj.contractInstances?.map((i)=>AvmContractInstanceHint.fromPlainObject(i)) || [], obj.contractClasses?.map((c)=>AvmContractClassHint.fromPlainObject(c)) || [], obj.bytecodeCommitments?.map((b)=>AvmBytecodeCommitmentHint.fromPlainObject(b)) || [], obj.debugFunctionNames?.map((d)=>AvmDebugFunctionNameHint.fromPlainObject(d)) || [], obj.
|
|
676
|
+
return new AvmExecutionHints(GlobalVariables.fromPlainObject(obj.globalVariables), AvmTxHint.fromPlainObject(obj.tx), ProtocolContracts.fromPlainObject(obj.protocolContracts), obj.contractInstances?.map((i)=>AvmContractInstanceHint.fromPlainObject(i)) || [], obj.contractClasses?.map((c)=>AvmContractClassHint.fromPlainObject(c)) || [], obj.bytecodeCommitments?.map((b)=>AvmBytecodeCommitmentHint.fromPlainObject(b)) || [], obj.debugFunctionNames?.map((d)=>AvmDebugFunctionNameHint.fromPlainObject(d)) || [], obj.contractDbCreateCheckpointHints?.map((h)=>AvmContractDbCreateCheckpointHint.fromPlainObject(h)) || [], obj.contractDbCommitCheckpointHints?.map((h)=>AvmContractDbCommitCheckpointHint.fromPlainObject(h)) || [], obj.contractDbRevertCheckpointHints?.map((h)=>AvmContractDbRevertCheckpointHint.fromPlainObject(h)) || [], obj.startingTreeRoots ? TreeSnapshots.fromPlainObject(obj.startingTreeRoots) : TreeSnapshots.empty(), obj.getSiblingPathHints?.map((h)=>AvmGetSiblingPathHint.fromPlainObject(h)) || [], obj.getPreviousValueIndexHints?.map((h)=>AvmGetPreviousValueIndexHint.fromPlainObject(h)) || [], obj.getLeafPreimageHintsPublicDataTree?.map((h)=>AvmGetLeafPreimageHintPublicDataTree.fromPlainObject(h)) || [], obj.getLeafPreimageHintsNullifierTree?.map((h)=>AvmGetLeafPreimageHintNullifierTree.fromPlainObject(h)) || [], obj.getLeafValueHints?.map((h)=>AvmGetLeafValueHint.fromPlainObject(h)) || [], obj.sequentialInsertHintsPublicDataTree?.map((h)=>AvmSequentialInsertHintPublicDataTree.fromPlainObject(h)) || [], obj.sequentialInsertHintsNullifierTree?.map((h)=>AvmSequentialInsertHintNullifierTree.fromPlainObject(h)) || [], obj.appendLeavesHints?.map((h)=>AvmAppendLeavesHint.fromPlainObject(h)) || [], obj.createCheckpointHints?.map((h)=>AvmCreateCheckpointHint.fromPlainObject(h)) || [], obj.commitCheckpointHints?.map((h)=>AvmCommitCheckpointHint.fromPlainObject(h)) || [], obj.revertCheckpointHints?.map((h)=>AvmRevertCheckpointHint.fromPlainObject(h)) || []);
|
|
676
677
|
}
|
|
677
678
|
static empty() {
|
|
678
679
|
return new AvmExecutionHints(GlobalVariables.empty(), AvmTxHint.empty(), ProtocolContracts.empty());
|
|
@@ -686,9 +687,9 @@ export class AvmExecutionHints {
|
|
|
686
687
|
contractClasses: AvmContractClassHint.schema.array(),
|
|
687
688
|
bytecodeCommitments: AvmBytecodeCommitmentHint.schema.array(),
|
|
688
689
|
debugFunctionNames: AvmDebugFunctionNameHint.schema.array(),
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
690
|
+
contractDbCreateCheckpointHints: AvmContractDbCreateCheckpointHint.schema.array(),
|
|
691
|
+
contractDbCommitCheckpointHints: AvmContractDbCommitCheckpointHint.schema.array(),
|
|
692
|
+
contractDbRevertCheckpointHints: AvmContractDbRevertCheckpointHint.schema.array(),
|
|
692
693
|
startingTreeRoots: TreeSnapshots.schema,
|
|
693
694
|
getSiblingPathHints: AvmGetSiblingPathHint.schema.array(),
|
|
694
695
|
getPreviousValueIndexHints: AvmGetPreviousValueIndexHint.schema.array(),
|
|
@@ -701,7 +702,7 @@ export class AvmExecutionHints {
|
|
|
701
702
|
createCheckpointHints: AvmCreateCheckpointHint.schema.array(),
|
|
702
703
|
commitCheckpointHints: AvmCommitCheckpointHint.schema.array(),
|
|
703
704
|
revertCheckpointHints: AvmRevertCheckpointHint.schema.array()
|
|
704
|
-
}).transform(({ globalVariables, tx, protocolContracts, contractInstances, contractClasses, bytecodeCommitments, debugFunctionNames,
|
|
705
|
+
}).transform(({ globalVariables, tx, protocolContracts, contractInstances, contractClasses, bytecodeCommitments, debugFunctionNames, contractDbCreateCheckpointHints, contractDbCommitCheckpointHints, contractDbRevertCheckpointHints, startingTreeRoots, getSiblingPathHints, getPreviousValueIndexHints, getLeafPreimageHintsPublicDataTree, getLeafPreimageHintsNullifierTree, getLeafValueHints, sequentialInsertHintsPublicDataTree, sequentialInsertHintsNullifierTree, appendLeavesHints, createCheckpointHints, commitCheckpointHints, revertCheckpointHints })=>new AvmExecutionHints(globalVariables, tx, protocolContracts, contractInstances, contractClasses, bytecodeCommitments, debugFunctionNames, contractDbCreateCheckpointHints, contractDbCommitCheckpointHints, contractDbRevertCheckpointHints, startingTreeRoots, getSiblingPathHints, getPreviousValueIndexHints, getLeafPreimageHintsPublicDataTree, getLeafPreimageHintsNullifierTree, getLeafValueHints, sequentialInsertHintsPublicDataTree, sequentialInsertHintsNullifierTree, appendLeavesHints, createCheckpointHints, commitCheckpointHints, revertCheckpointHints));
|
|
705
706
|
}
|
|
706
707
|
}
|
|
707
708
|
export class AvmCircuitInputs {
|
|
@@ -743,7 +744,7 @@ export class PublicTxResult {
|
|
|
743
744
|
hints;
|
|
744
745
|
publicInputs;
|
|
745
746
|
constructor(// Simulation result.
|
|
746
|
-
gasUsed, revertCode, revertReason, // These are only guaranteed to be present
|
|
747
|
+
gasUsed, revertCode, revertReason, // These are only guaranteed to be present if the simulator is configured to collect them.
|
|
747
748
|
processedPhases, logs, // For the proving request.
|
|
748
749
|
hints, publicInputs){
|
|
749
750
|
this.gasUsed = gasUsed;
|
|
@@ -779,27 +780,65 @@ export class PublicTxResult {
|
|
|
779
780
|
return new PublicTxResult(GasUsed.fromPlainObject(obj.gasUsed), RevertCode.fromPlainObject(obj.revertCode), /*revertReason=*/ undefined, /*processedPhases=*/ [], obj.logs?.map(DebugLog.fromPlainObject), obj.hints ? AvmExecutionHints.fromPlainObject(obj.hints) : undefined, AvmCircuitPublicInputs.fromPlainObject(obj.publicInputs));
|
|
780
781
|
}
|
|
781
782
|
}
|
|
783
|
+
export class PublicSimulatorConfig {
|
|
784
|
+
proverId;
|
|
785
|
+
skipFeeEnforcement;
|
|
786
|
+
collectCallMetadata;
|
|
787
|
+
collectHints;
|
|
788
|
+
collectDebugLogs;
|
|
789
|
+
maxDebugLogMemoryReads;
|
|
790
|
+
collectStatistics;
|
|
791
|
+
constructor(proverId, skipFeeEnforcement, collectCallMetadata, collectHints, collectDebugLogs, maxDebugLogMemoryReads, collectStatistics){
|
|
792
|
+
this.proverId = proverId;
|
|
793
|
+
this.skipFeeEnforcement = skipFeeEnforcement;
|
|
794
|
+
this.collectCallMetadata = collectCallMetadata;
|
|
795
|
+
this.collectHints = collectHints;
|
|
796
|
+
this.collectDebugLogs = collectDebugLogs;
|
|
797
|
+
this.maxDebugLogMemoryReads = maxDebugLogMemoryReads;
|
|
798
|
+
this.collectStatistics = collectStatistics;
|
|
799
|
+
}
|
|
800
|
+
static from(obj) {
|
|
801
|
+
return new PublicSimulatorConfig(obj.proverId ?? Fr.ZERO, obj.skipFeeEnforcement ?? false, obj.collectCallMetadata ?? false, obj.collectHints ?? false, obj.collectDebugLogs ?? false, obj.maxDebugLogMemoryReads ?? DEFAULT_MAX_DEBUG_LOG_MEMORY_READS, obj.collectStatistics ?? false);
|
|
802
|
+
}
|
|
803
|
+
static empty() {
|
|
804
|
+
return PublicSimulatorConfig.from({});
|
|
805
|
+
}
|
|
806
|
+
static get schema() {
|
|
807
|
+
return z.object({
|
|
808
|
+
proverId: Fr.schema,
|
|
809
|
+
skipFeeEnforcement: z.boolean(),
|
|
810
|
+
collectCallMetadata: z.boolean(),
|
|
811
|
+
collectHints: z.boolean(),
|
|
812
|
+
collectDebugLogs: z.boolean(),
|
|
813
|
+
maxDebugLogMemoryReads: z.number(),
|
|
814
|
+
collectStatistics: z.boolean()
|
|
815
|
+
}).transform(PublicSimulatorConfig.from);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
782
818
|
export class AvmFastSimulationInputs {
|
|
783
819
|
wsRevision;
|
|
820
|
+
config;
|
|
784
821
|
tx;
|
|
785
822
|
globalVariables;
|
|
786
823
|
protocolContracts;
|
|
787
|
-
constructor(wsRevision, tx, globalVariables, protocolContracts){
|
|
824
|
+
constructor(wsRevision, config, tx, globalVariables, protocolContracts){
|
|
788
825
|
this.wsRevision = wsRevision;
|
|
826
|
+
this.config = config;
|
|
789
827
|
this.tx = tx;
|
|
790
828
|
this.globalVariables = globalVariables;
|
|
791
829
|
this.protocolContracts = protocolContracts;
|
|
792
830
|
}
|
|
793
831
|
static empty() {
|
|
794
|
-
return new AvmFastSimulationInputs(WorldStateRevision.empty(), AvmTxHint.empty(), GlobalVariables.empty(), ProtocolContracts.empty());
|
|
832
|
+
return new AvmFastSimulationInputs(WorldStateRevision.empty(), PublicSimulatorConfig.empty(), AvmTxHint.empty(), GlobalVariables.empty(), ProtocolContracts.empty());
|
|
795
833
|
}
|
|
796
834
|
static get schema() {
|
|
797
835
|
return z.object({
|
|
798
836
|
wsRevision: WorldStateRevision.schema,
|
|
837
|
+
config: PublicSimulatorConfig.schema,
|
|
799
838
|
tx: AvmTxHint.schema,
|
|
800
839
|
globalVariables: GlobalVariables.schema,
|
|
801
840
|
protocolContracts: ProtocolContracts.schema
|
|
802
|
-
}).transform(({ wsRevision, tx, globalVariables, protocolContracts })=>new AvmFastSimulationInputs(wsRevision, tx, globalVariables, protocolContracts));
|
|
841
|
+
}).transform(({ wsRevision, config, tx, globalVariables, protocolContracts })=>new AvmFastSimulationInputs(wsRevision, config, tx, globalVariables, protocolContracts));
|
|
803
842
|
}
|
|
804
843
|
serializeWithMessagePack() {
|
|
805
844
|
return serializeWithMessagePack(this);
|
|
@@ -743,7 +743,7 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
|
|
|
743
743
|
selector?: any;
|
|
744
744
|
address?: any;
|
|
745
745
|
}>, "many">;
|
|
746
|
-
|
|
746
|
+
contractDbCreateCheckpointHints: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
747
747
|
actionCounter: z.ZodNumber;
|
|
748
748
|
oldCheckpointId: z.ZodNumber;
|
|
749
749
|
newCheckpointId: z.ZodNumber;
|
|
@@ -764,7 +764,7 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
|
|
|
764
764
|
oldCheckpointId: number;
|
|
765
765
|
newCheckpointId: number;
|
|
766
766
|
}>, "many">;
|
|
767
|
-
|
|
767
|
+
contractDbCommitCheckpointHints: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
768
768
|
actionCounter: z.ZodNumber;
|
|
769
769
|
oldCheckpointId: z.ZodNumber;
|
|
770
770
|
newCheckpointId: z.ZodNumber;
|
|
@@ -785,7 +785,7 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
|
|
|
785
785
|
oldCheckpointId: number;
|
|
786
786
|
newCheckpointId: number;
|
|
787
787
|
}>, "many">;
|
|
788
|
-
|
|
788
|
+
contractDbRevertCheckpointHints: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
789
789
|
actionCounter: z.ZodNumber;
|
|
790
790
|
oldCheckpointId: z.ZodNumber;
|
|
791
791
|
newCheckpointId: z.ZodNumber;
|
|
@@ -2378,17 +2378,17 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
|
|
|
2378
2378
|
contractClasses: import("./avm.js").AvmContractClassHint[];
|
|
2379
2379
|
bytecodeCommitments: import("./avm.js").AvmBytecodeCommitmentHint[];
|
|
2380
2380
|
debugFunctionNames: import("./avm.js").AvmDebugFunctionNameHint[];
|
|
2381
|
-
|
|
2381
|
+
contractDbCreateCheckpointHints: {
|
|
2382
2382
|
readonly actionCounter: number;
|
|
2383
2383
|
readonly oldCheckpointId: number;
|
|
2384
2384
|
readonly newCheckpointId: number;
|
|
2385
2385
|
}[];
|
|
2386
|
-
|
|
2386
|
+
contractDbCommitCheckpointHints: {
|
|
2387
2387
|
readonly actionCounter: number;
|
|
2388
2388
|
readonly oldCheckpointId: number;
|
|
2389
2389
|
readonly newCheckpointId: number;
|
|
2390
2390
|
}[];
|
|
2391
|
-
|
|
2391
|
+
contractDbRevertCheckpointHints: {
|
|
2392
2392
|
readonly actionCounter: number;
|
|
2393
2393
|
readonly oldCheckpointId: number;
|
|
2394
2394
|
readonly newCheckpointId: number;
|
|
@@ -2581,17 +2581,17 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
|
|
|
2581
2581
|
selector?: any;
|
|
2582
2582
|
address?: any;
|
|
2583
2583
|
}[];
|
|
2584
|
-
|
|
2584
|
+
contractDbCreateCheckpointHints: {
|
|
2585
2585
|
actionCounter: number;
|
|
2586
2586
|
oldCheckpointId: number;
|
|
2587
2587
|
newCheckpointId: number;
|
|
2588
2588
|
}[];
|
|
2589
|
-
|
|
2589
|
+
contractDbCommitCheckpointHints: {
|
|
2590
2590
|
actionCounter: number;
|
|
2591
2591
|
oldCheckpointId: number;
|
|
2592
2592
|
newCheckpointId: number;
|
|
2593
2593
|
}[];
|
|
2594
|
-
|
|
2594
|
+
contractDbRevertCheckpointHints: {
|
|
2595
2595
|
actionCounter: number;
|
|
2596
2596
|
oldCheckpointId: number;
|
|
2597
2597
|
newCheckpointId: number;
|
|
@@ -2983,17 +2983,17 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
|
|
|
2983
2983
|
selector?: any;
|
|
2984
2984
|
address?: any;
|
|
2985
2985
|
}[];
|
|
2986
|
-
|
|
2986
|
+
contractDbCreateCheckpointHints: {
|
|
2987
2987
|
actionCounter: number;
|
|
2988
2988
|
oldCheckpointId: number;
|
|
2989
2989
|
newCheckpointId: number;
|
|
2990
2990
|
}[];
|
|
2991
|
-
|
|
2991
|
+
contractDbCommitCheckpointHints: {
|
|
2992
2992
|
actionCounter: number;
|
|
2993
2993
|
oldCheckpointId: number;
|
|
2994
2994
|
newCheckpointId: number;
|
|
2995
2995
|
}[];
|
|
2996
|
-
|
|
2996
|
+
contractDbRevertCheckpointHints: {
|
|
2997
2997
|
actionCounter: number;
|
|
2998
2998
|
oldCheckpointId: number;
|
|
2999
2999
|
newCheckpointId: number;
|
|
@@ -4632,17 +4632,17 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
|
|
|
4632
4632
|
selector?: any;
|
|
4633
4633
|
address?: any;
|
|
4634
4634
|
}[];
|
|
4635
|
-
|
|
4635
|
+
contractDbCreateCheckpointHints: {
|
|
4636
4636
|
actionCounter: number;
|
|
4637
4637
|
oldCheckpointId: number;
|
|
4638
4638
|
newCheckpointId: number;
|
|
4639
4639
|
}[];
|
|
4640
|
-
|
|
4640
|
+
contractDbCommitCheckpointHints: {
|
|
4641
4641
|
actionCounter: number;
|
|
4642
4642
|
oldCheckpointId: number;
|
|
4643
4643
|
newCheckpointId: number;
|
|
4644
4644
|
}[];
|
|
4645
|
-
|
|
4645
|
+
contractDbRevertCheckpointHints: {
|
|
4646
4646
|
actionCounter: number;
|
|
4647
4647
|
oldCheckpointId: number;
|
|
4648
4648
|
newCheckpointId: number;
|
|
@@ -5201,17 +5201,17 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
|
|
|
5201
5201
|
selector?: any;
|
|
5202
5202
|
address?: any;
|
|
5203
5203
|
}[];
|
|
5204
|
-
|
|
5204
|
+
contractDbCreateCheckpointHints: {
|
|
5205
5205
|
actionCounter: number;
|
|
5206
5206
|
oldCheckpointId: number;
|
|
5207
5207
|
newCheckpointId: number;
|
|
5208
5208
|
}[];
|
|
5209
|
-
|
|
5209
|
+
contractDbCommitCheckpointHints: {
|
|
5210
5210
|
actionCounter: number;
|
|
5211
5211
|
oldCheckpointId: number;
|
|
5212
5212
|
newCheckpointId: number;
|
|
5213
5213
|
}[];
|
|
5214
|
-
|
|
5214
|
+
contractDbRevertCheckpointHints: {
|
|
5215
5215
|
actionCounter: number;
|
|
5216
5216
|
oldCheckpointId: number;
|
|
5217
5217
|
newCheckpointId: number;
|
|
@@ -5776,17 +5776,17 @@ export declare const AvmProvingRequestSchema: z.ZodObject<{
|
|
|
5776
5776
|
selector?: any;
|
|
5777
5777
|
address?: any;
|
|
5778
5778
|
}[];
|
|
5779
|
-
|
|
5779
|
+
contractDbCreateCheckpointHints: {
|
|
5780
5780
|
actionCounter: number;
|
|
5781
5781
|
oldCheckpointId: number;
|
|
5782
5782
|
newCheckpointId: number;
|
|
5783
5783
|
}[];
|
|
5784
|
-
|
|
5784
|
+
contractDbCommitCheckpointHints: {
|
|
5785
5785
|
actionCounter: number;
|
|
5786
5786
|
oldCheckpointId: number;
|
|
5787
5787
|
newCheckpointId: number;
|
|
5788
5788
|
}[];
|
|
5789
|
-
|
|
5789
|
+
contractDbRevertCheckpointHints: {
|
|
5790
5790
|
actionCounter: number;
|
|
5791
5791
|
oldCheckpointId: number;
|
|
5792
5792
|
newCheckpointId: number;
|
|
@@ -42,7 +42,7 @@ export declare class PublicDataWrite {
|
|
|
42
42
|
static fromFields(fields: Fr[] | FieldReader): PublicDataWrite;
|
|
43
43
|
toFields(): Fr[];
|
|
44
44
|
static fromBlobFields(fields: Fr[] | FieldReader): PublicDataWrite;
|
|
45
|
-
toBlobFields(): Fr
|
|
45
|
+
toBlobFields(): [Fr, Fr];
|
|
46
46
|
static fromBuffer(buffer: Buffer | BufferReader): PublicDataWrite;
|
|
47
47
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
48
48
|
static fromString(str: string): PublicDataWrite;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_data_write.d.ts","sourceRoot":"","sources":["../../src/avm/public_data_write.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAwC,MAAM,6BAA6B,CAAC;AAE9G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,qBAAa,eAAe;IAIxB;;OAEG;aACa,QAAQ,EAAE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,CAAC,eAAe,CAAC;IAIlD,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,GAAG,eAAe;IAK9D,QAAQ,IAAI,EAAE,EAAE;IAUhB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW;IAKhD,YAAY,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC;IAIxB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAK/C,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,QAAQ;IAIR,MAAM,CAAC,KAAK;IAIZ;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,eAAe;IAIjD,MAAM,CAAC,MAAM;IAIb,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO;IAI9C,OAAO;IAIP,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO;CAGxC"}
|
|
@@ -44,7 +44,8 @@ export declare class RevertCode {
|
|
|
44
44
|
toBuffer(): Buffer;
|
|
45
45
|
toField(): Fr;
|
|
46
46
|
getSerializedLength(): number;
|
|
47
|
-
static
|
|
47
|
+
static fromNumber(code: number): RevertCode;
|
|
48
|
+
static fromField(field: Fr): RevertCode;
|
|
48
49
|
static fromFields(fields: Fr[] | FieldReader): RevertCode;
|
|
49
50
|
static fromBuffer(buffer: Buffer | BufferReader): RevertCode;
|
|
50
51
|
private static readonly NUM_OPTIONS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revert_code.d.ts","sourceRoot":"","sources":["../../src/avm/revert_code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,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ACxC,MAAM,CAAC,MAAM,IAAI,UAAU;IAI3B,CAAC,OAAO,CAAC,MAAM,CAAC;CAGjB"}
|
package/dest/avm/revert_code.js
CHANGED
|
@@ -93,11 +93,14 @@ function isRevertCodeEnum(value) {
|
|
|
93
93
|
getSerializedLength() {
|
|
94
94
|
return this.toBuffer().length;
|
|
95
95
|
}
|
|
96
|
-
static
|
|
97
|
-
if (!isRevertCodeEnum(
|
|
98
|
-
throw new Error(`Invalid RevertCode: ${
|
|
96
|
+
static fromNumber(code) {
|
|
97
|
+
if (!isRevertCodeEnum(code)) {
|
|
98
|
+
throw new Error(`Invalid RevertCode: ${code}`);
|
|
99
99
|
}
|
|
100
|
-
return new RevertCode(
|
|
100
|
+
return new RevertCode(code);
|
|
101
|
+
}
|
|
102
|
+
static fromField(field) {
|
|
103
|
+
return RevertCode.fromNumber(field.toNumber());
|
|
101
104
|
}
|
|
102
105
|
static fromFields(fields) {
|
|
103
106
|
const reader = FieldReader.asReader(fields);
|
|
@@ -106,10 +109,7 @@ function isRevertCodeEnum(value) {
|
|
|
106
109
|
static fromBuffer(buffer) {
|
|
107
110
|
const reader = BufferReader.asReader(buffer);
|
|
108
111
|
const code = reader.readBytes(RevertCode.PACKED_SIZE_IN_BYTES).readUInt8(0);
|
|
109
|
-
|
|
110
|
-
throw new Error(`Invalid RevertCode: ${code}`);
|
|
111
|
-
}
|
|
112
|
-
return new RevertCode(code);
|
|
112
|
+
return RevertCode.fromNumber(code);
|
|
113
113
|
}
|
|
114
114
|
static NUM_OPTIONS = 4;
|
|
115
115
|
static random() {
|
package/dest/block/body.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
1
|
+
import type { TxBlobData } from '@aztec/blob-lib/encoding';
|
|
3
2
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
4
3
|
import { inspect } from 'util';
|
|
5
4
|
import type { ZodFor } from '../schemas/index.js';
|
|
6
5
|
import { TxEffect } from '../tx/tx_effect.js';
|
|
7
|
-
export { createBlockEndMarker };
|
|
8
|
-
export declare function getBlockBlobFields(txEffects: TxEffect[]): Fr[];
|
|
9
6
|
export declare class Body {
|
|
10
7
|
txEffects: TxEffect[];
|
|
11
8
|
constructor(txEffects: TxEffect[]);
|
|
@@ -24,11 +21,11 @@ export declare class Body {
|
|
|
24
21
|
/**
|
|
25
22
|
* Returns a flat packed array of fields of all tx effects - used for blobs.
|
|
26
23
|
*/
|
|
27
|
-
|
|
24
|
+
toTxBlobData(): TxBlobData[];
|
|
28
25
|
/**
|
|
29
26
|
* Decodes a block from blob fields.
|
|
30
27
|
*/
|
|
31
|
-
static
|
|
28
|
+
static fromTxBlobData(txBlobData: TxBlobData[]): Body;
|
|
32
29
|
[inspect.custom](): string;
|
|
33
30
|
static random(txsPerBlock?: number, numPublicCallsPerTx?: number, numPublicLogsPerCall?: number, maxEffects?: number | undefined): Promise<Body>;
|
|
34
31
|
static empty(): Body;
|
package/dest/block/body.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../src/block/body.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../src/block/body.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,qBAAa,IAAI;IACI,SAAS,EAAE,QAAQ,EAAE;gBAArB,SAAS,EAAE,QAAQ,EAAE;IAExC,MAAM,CAAC,KAAK,EAAE,IAAI;IAMlB,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,CAMhC;IAED;;;OAGG;IACH,QAAQ;IAIR;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY;IAM5C;;OAEG;IACH,YAAY,IAAI,UAAU,EAAE;IAI5B;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,IAAI;IAKrD,CAAC,OAAO,CAAC,MAAM,CAAC;WAMH,MAAM,CACjB,WAAW,SAAI,EACf,mBAAmB,SAAI,EACvB,oBAAoB,SAAI,EACxB,UAAU,GAAE,MAAM,GAAG,SAAqB;IAS5C,MAAM,CAAC,KAAK;CAGb"}
|
package/dest/block/body.js
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import { createBlockEndMarker, getNumTxsFromBlockEndMarker, isBlockEndMarker } from '@aztec/blob-lib/encoding';
|
|
2
1
|
import { timesParallel } from '@aztec/foundation/collection';
|
|
3
|
-
import { BufferReader,
|
|
2
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
3
|
import { inspect } from 'util';
|
|
5
4
|
import { z } from 'zod';
|
|
6
5
|
import { TxEffect } from '../tx/tx_effect.js';
|
|
7
|
-
export { createBlockEndMarker };
|
|
8
|
-
export function getBlockBlobFields(txEffects) {
|
|
9
|
-
const blobFields = txEffects.flatMap((txEffect)=>txEffect.toBlobFields());
|
|
10
|
-
blobFields.push(createBlockEndMarker(txEffects.length));
|
|
11
|
-
return blobFields;
|
|
12
|
-
}
|
|
13
6
|
export class Body {
|
|
14
7
|
txEffects;
|
|
15
8
|
constructor(txEffects){
|
|
@@ -38,26 +31,14 @@ export class Body {
|
|
|
38
31
|
}
|
|
39
32
|
/**
|
|
40
33
|
* Returns a flat packed array of fields of all tx effects - used for blobs.
|
|
41
|
-
*/
|
|
42
|
-
return
|
|
34
|
+
*/ toTxBlobData() {
|
|
35
|
+
return this.txEffects.map((txEffect)=>txEffect.toTxBlobData());
|
|
43
36
|
}
|
|
44
37
|
/**
|
|
45
38
|
* Decodes a block from blob fields.
|
|
46
|
-
*/ static
|
|
47
|
-
const txEffects =
|
|
48
|
-
|
|
49
|
-
while(!reader.isFinished()){
|
|
50
|
-
txEffects.push(TxEffect.fromBlobFields(reader));
|
|
51
|
-
}
|
|
52
|
-
// If the fields are from a proven block, or are constructed by calling `toBlobFields`, the following errors should never throw.
|
|
53
|
-
if (!isBlockEndMarker(fields[fields.length - 1])) {
|
|
54
|
-
throw new Error('Block end marker not found');
|
|
55
|
-
}
|
|
56
|
-
const numTxs = getNumTxsFromBlockEndMarker(fields[fields.length - 1]);
|
|
57
|
-
if (numTxs !== txEffects.length) {
|
|
58
|
-
throw new Error(`Expected ${numTxs} txs, but got ${txEffects.length}`);
|
|
59
|
-
}
|
|
60
|
-
return new this(txEffects);
|
|
39
|
+
*/ static fromTxBlobData(txBlobData) {
|
|
40
|
+
const txEffects = txBlobData.map((data)=>TxEffect.fromTxBlobData(data));
|
|
41
|
+
return new Body(txEffects);
|
|
61
42
|
}
|
|
62
43
|
[inspect.custom]() {
|
|
63
44
|
return `Body {
|
package/dest/block/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/block/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/block/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
|
package/dest/block/index.js
CHANGED
package/dest/block/l2_block.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type BlockBlobData } from '@aztec/blob-lib/encoding';
|
|
1
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
3
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
4
|
import { z } from 'zod';
|
|
@@ -8,6 +9,8 @@ import { L2BlockHeader } from './l2_block_header.js';
|
|
|
8
9
|
import type { L2BlockInfo } from './l2_block_info.js';
|
|
9
10
|
/**
|
|
10
11
|
* The data that makes up the rollup proof, with encoder decoder functions.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated Use `L2BlockNew` instead.
|
|
11
14
|
*/
|
|
12
15
|
export declare class L2Block {
|
|
13
16
|
/** Snapshot of archive tree after the block is applied. */
|
|
@@ -116,6 +119,8 @@ export declare class L2Block {
|
|
|
116
119
|
* TODO(#17027): Remove this method from L2Block and create a dedicated Checkpoint class.
|
|
117
120
|
*/
|
|
118
121
|
getCheckpointBlobFields(): Fr[];
|
|
122
|
+
toBlobFields(isFirstBlock: boolean): Fr[];
|
|
123
|
+
toBlockBlobData(isFirstBlock: boolean): BlockBlobData;
|
|
119
124
|
/**
|
|
120
125
|
* Returns stats used for logging.
|
|
121
126
|
* @returns Stats on tx count, number, and log size and count.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l2_block.d.ts","sourceRoot":"","sources":["../../src/block/l2_block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAG9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"l2_block.d.ts","sourceRoot":"","sources":["../../src/block/l2_block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAG9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;GAIG;AACH,qBAAa,OAAO;IAEhB,2DAA2D;IACpD,OAAO,EAAE,sBAAsB;IACtC,uBAAuB;IAChB,MAAM,EAAE,aAAa;IAC5B,qBAAqB;IACd,IAAI,EAAE,IAAI;IACjB,OAAO,CAAC,SAAS;;IANjB,2DAA2D;IACpD,OAAO,EAAE,sBAAsB;IACtC,uBAAuB;IAChB,MAAM,EAAE,aAAa;IAC5B,qBAAqB;IACd,IAAI,EAAE,IAAI,EACT,SAAS,GAAE,EAAE,GAAG,SAAqB;IAG/C,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAQhB;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY;IAS5C;;;OAGG;IACH,QAAQ;IAIR;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIvC;;;OAGG;IACH,QAAQ,IAAI,MAAM;IAIlB;;;;;;;;OAQG;WACU,MAAM,CACjB,UAAU,EAAE,MAAM,EAClB,WAAW,SAAI,EACf,mBAAmB,SAAI,EACvB,oBAAoB,SAAI,EACxB,MAAM,GAAE,EAAE,GAAG,SAAqB,EAClC,UAAU,GAAE,MAAM,GAAG,SAAqB,EAC1C,UAAU,GAAE,MAAM,GAAG,SAAqB,GACzC,OAAO,CAAC,OAAO,CAAC;IAUnB;;;OAGG;IACH,MAAM,CAAC,KAAK,IAAI,OAAO;IAIvB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;;OAGG;IACU,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC;IAOhC;;;;OAIG;IACI,mBAAmB;IAKnB,cAAc,IAAI,WAAW;IAIpC;;;;OAIG;IACI,uBAAuB;IAKvB,YAAY,CAAC,YAAY,EAAE,OAAO,GAAG,EAAE,EAAE;IAKzC,eAAe,CAAC,YAAY,EAAE,OAAO,GAAG,aAAa;IAuB5D;;;OAGG;IACH,QAAQ;;;;;;;;;IAuBR,WAAW,IAAI,WAAW;IAY1B,MAAM,CAAC,KAAK,EAAE,OAAO;CAGtB"}
|
package/dest/block/l2_block.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import { encodeBlockBlobData } from '@aztec/blob-lib/encoding';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
1
3
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
2
4
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
3
5
|
import { z } from 'zod';
|
|
4
|
-
import { getCheckpointBlobFields } from '../checkpoint/checkpoint_body.js';
|
|
5
6
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
6
7
|
import { Body } from './body.js';
|
|
7
8
|
import { makeAppendOnlyTreeSnapshot, makeL2BlockHeader } from './l2_block_code_to_purge.js';
|
|
8
9
|
import { L2BlockHeader } from './l2_block_header.js';
|
|
9
10
|
/**
|
|
10
11
|
* The data that makes up the rollup proof, with encoder decoder functions.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated Use `L2BlockNew` instead.
|
|
11
14
|
*/ export class L2Block {
|
|
12
15
|
archive;
|
|
13
16
|
header;
|
|
@@ -107,9 +110,36 @@ import { L2BlockHeader } from './l2_block_header.js';
|
|
|
107
110
|
* This only works when there's one block per checkpoint.
|
|
108
111
|
* TODO(#17027): Remove this method from L2Block and create a dedicated Checkpoint class.
|
|
109
112
|
*/ getCheckpointBlobFields() {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
const blockBlobData = this.toBlobFields(true);
|
|
114
|
+
return [
|
|
115
|
+
new Fr(blockBlobData.length + 1)
|
|
116
|
+
].concat(blockBlobData);
|
|
117
|
+
}
|
|
118
|
+
toBlobFields(isFirstBlock) {
|
|
119
|
+
const blockBlobData = this.toBlockBlobData(isFirstBlock);
|
|
120
|
+
return encodeBlockBlobData(blockBlobData);
|
|
121
|
+
}
|
|
122
|
+
toBlockBlobData(isFirstBlock) {
|
|
123
|
+
return {
|
|
124
|
+
blockEndMarker: {
|
|
125
|
+
numTxs: this.body.txEffects.length,
|
|
126
|
+
timestamp: this.header.globalVariables.timestamp,
|
|
127
|
+
blockNumber: this.number
|
|
128
|
+
},
|
|
129
|
+
blockEndStateField: {
|
|
130
|
+
l1ToL2MessageNextAvailableLeafIndex: this.header.state.l1ToL2MessageTree.nextAvailableLeafIndex,
|
|
131
|
+
noteHashNextAvailableLeafIndex: this.header.state.partial.noteHashTree.nextAvailableLeafIndex,
|
|
132
|
+
nullifierNextAvailableLeafIndex: this.header.state.partial.nullifierTree.nextAvailableLeafIndex,
|
|
133
|
+
publicDataNextAvailableLeafIndex: this.header.state.partial.publicDataTree.nextAvailableLeafIndex,
|
|
134
|
+
totalManaUsed: this.header.totalManaUsed.toBigInt()
|
|
135
|
+
},
|
|
136
|
+
lastArchiveRoot: this.header.lastArchive.root,
|
|
137
|
+
noteHashRoot: this.header.state.partial.noteHashTree.root,
|
|
138
|
+
nullifierRoot: this.header.state.partial.nullifierTree.root,
|
|
139
|
+
publicDataRoot: this.header.state.partial.publicDataTree.root,
|
|
140
|
+
l1ToL2MessageRoot: isFirstBlock ? this.header.state.l1ToL2MessageTree.root : undefined,
|
|
141
|
+
txs: this.body.toTxBlobData()
|
|
142
|
+
};
|
|
113
143
|
}
|
|
114
144
|
/**
|
|
115
145
|
* Returns stats used for logging.
|