@aztec/stdlib 3.0.0-nightly.20251114 → 3.0.0-nightly.20251115

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.
Files changed (80) hide show
  1. package/dest/avm/avm.d.ts +102 -8
  2. package/dest/avm/avm.d.ts.map +1 -1
  3. package/dest/avm/avm.js +43 -4
  4. package/dest/avm/public_data_write.d.ts +1 -1
  5. package/dest/avm/public_data_write.d.ts.map +1 -1
  6. package/dest/avm/revert_code.d.ts +2 -1
  7. package/dest/avm/revert_code.d.ts.map +1 -1
  8. package/dest/avm/revert_code.js +8 -8
  9. package/dest/block/body.d.ts +3 -6
  10. package/dest/block/body.d.ts.map +1 -1
  11. package/dest/block/body.js +6 -25
  12. package/dest/block/index.d.ts +1 -0
  13. package/dest/block/index.d.ts.map +1 -1
  14. package/dest/block/index.js +1 -0
  15. package/dest/block/l2_block.d.ts +5 -0
  16. package/dest/block/l2_block.d.ts.map +1 -1
  17. package/dest/block/l2_block.js +34 -4
  18. package/dest/block/l2_block_new.d.ts +97 -0
  19. package/dest/block/l2_block_new.d.ts.map +1 -0
  20. package/dest/block/l2_block_new.js +113 -0
  21. package/dest/checkpoint/checkpoint.d.ts +108 -0
  22. package/dest/checkpoint/checkpoint.d.ts.map +1 -0
  23. package/dest/checkpoint/checkpoint.js +39 -0
  24. package/dest/checkpoint/index.d.ts +1 -1
  25. package/dest/checkpoint/index.d.ts.map +1 -1
  26. package/dest/checkpoint/index.js +1 -1
  27. package/dest/logs/private_log.d.ts +1 -1
  28. package/dest/logs/private_log.d.ts.map +1 -1
  29. package/dest/logs/private_log.js +2 -5
  30. package/dest/messaging/in_hash.d.ts +4 -0
  31. package/dest/messaging/in_hash.d.ts.map +1 -0
  32. package/dest/messaging/in_hash.js +15 -0
  33. package/dest/messaging/index.d.ts +2 -0
  34. package/dest/messaging/index.d.ts.map +1 -1
  35. package/dest/messaging/index.js +2 -0
  36. package/dest/messaging/out_hash.d.ts +5 -0
  37. package/dest/messaging/out_hash.d.ts.map +1 -0
  38. package/dest/messaging/out_hash.js +28 -0
  39. package/dest/rollup/checkpoint_constant_data.d.ts +16 -0
  40. package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
  41. package/dest/rollup/checkpoint_constant_data.js +17 -0
  42. package/dest/tests/factories.d.ts +17 -21
  43. package/dest/tests/factories.d.ts.map +1 -1
  44. package/dest/tests/factories.js +14 -111
  45. package/dest/tests/mocks.d.ts +17 -1
  46. package/dest/tests/mocks.d.ts.map +1 -1
  47. package/dest/tests/mocks.js +108 -4
  48. package/dest/tx/partial_state_reference.d.ts +3 -0
  49. package/dest/tx/partial_state_reference.d.ts.map +1 -1
  50. package/dest/tx/partial_state_reference.js +10 -0
  51. package/dest/tx/state_reference.d.ts +3 -0
  52. package/dest/tx/state_reference.d.ts.map +1 -1
  53. package/dest/tx/state_reference.js +9 -0
  54. package/dest/tx/tx_effect.d.ts +9 -6
  55. package/dest/tx/tx_effect.d.ts.map +1 -1
  56. package/dest/tx/tx_effect.js +53 -57
  57. package/package.json +8 -8
  58. package/src/avm/avm.ts +48 -10
  59. package/src/avm/public_data_write.ts +1 -1
  60. package/src/avm/revert_code.ts +9 -8
  61. package/src/block/body.ts +7 -32
  62. package/src/block/index.ts +1 -0
  63. package/src/block/l2_block.ts +33 -2
  64. package/src/block/l2_block_new.ts +143 -0
  65. package/src/checkpoint/checkpoint.ts +46 -0
  66. package/src/checkpoint/index.ts +1 -1
  67. package/src/logs/private_log.ts +2 -3
  68. package/src/messaging/in_hash.ts +15 -0
  69. package/src/messaging/index.ts +2 -0
  70. package/src/messaging/out_hash.ts +36 -0
  71. package/src/rollup/checkpoint_constant_data.ts +20 -0
  72. package/src/tests/factories.ts +91 -193
  73. package/src/tests/mocks.ts +196 -4
  74. package/src/tx/partial_state_reference.ts +9 -0
  75. package/src/tx/state_reference.ts +9 -0
  76. package/src/tx/tx_effect.ts +61 -67
  77. package/dest/checkpoint/checkpoint_body.d.ts +0 -4
  78. package/dest/checkpoint/checkpoint_body.d.ts.map +0 -1
  79. package/dest/checkpoint/checkpoint_body.js +0 -9
  80. package/src/checkpoint/checkpoint_body.ts +0 -10
@@ -0,0 +1,97 @@
1
+ import { type BlockBlobData } from '@aztec/blob-lib/encoding';
2
+ import { Fr } from '@aztec/foundation/fields';
3
+ import { BufferReader } from '@aztec/foundation/serialize';
4
+ import { z } from 'zod';
5
+ import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
6
+ import { BlockHeader } from '../tx/block_header.js';
7
+ import { Body } from './body.js';
8
+ import type { L2BlockInfo } from './l2_block_info.js';
9
+ /**
10
+ * An L2 block with a header and a body.
11
+ * TODO: Delete the existing `L2Block` class and rename this to `L2Block`.
12
+ */
13
+ export declare class L2BlockNew {
14
+ /** Snapshot of archive tree after the block is applied. */
15
+ archive: AppendOnlyTreeSnapshot;
16
+ /** Header of the block. */
17
+ header: BlockHeader;
18
+ /** L2 block body. */
19
+ body: Body;
20
+ private blockHash;
21
+ constructor(
22
+ /** Snapshot of archive tree after the block is applied. */
23
+ archive: AppendOnlyTreeSnapshot,
24
+ /** Header of the block. */
25
+ header: BlockHeader,
26
+ /** L2 block body. */
27
+ body: Body, blockHash?: Fr | undefined);
28
+ get number(): number;
29
+ get timestamp(): bigint;
30
+ static get schema(): z.ZodEffects<z.ZodObject<{
31
+ archive: z.ZodEffects<z.ZodObject<{
32
+ root: z.ZodType<Fr, any, string>;
33
+ nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ root: Fr;
36
+ nextAvailableLeafIndex: number;
37
+ }, {
38
+ root: string;
39
+ nextAvailableLeafIndex: string | number | bigint;
40
+ }>, AppendOnlyTreeSnapshot, {
41
+ root: string;
42
+ nextAvailableLeafIndex: string | number | bigint;
43
+ }>;
44
+ header: import("@aztec/foundation/schemas").ZodFor<BlockHeader>;
45
+ body: import("@aztec/foundation/schemas").ZodFor<Body>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ archive: AppendOnlyTreeSnapshot;
48
+ header: BlockHeader;
49
+ body: Body;
50
+ }, {
51
+ archive: {
52
+ root: string;
53
+ nextAvailableLeafIndex: string | number | bigint;
54
+ };
55
+ header?: any;
56
+ body?: any;
57
+ }>, L2BlockNew, {
58
+ archive: {
59
+ root: string;
60
+ nextAvailableLeafIndex: string | number | bigint;
61
+ };
62
+ header?: any;
63
+ body?: any;
64
+ }>;
65
+ /**
66
+ * Deserializes a block from a buffer
67
+ * @returns A deserialized L2 block.
68
+ */
69
+ static fromBuffer(buf: Buffer | BufferReader): L2BlockNew;
70
+ /**
71
+ * Serializes a block
72
+ * @returns A serialized L2 block as a Buffer.
73
+ */
74
+ toBuffer(): Buffer<ArrayBufferLike>;
75
+ /**
76
+ * Returns the block's hash (hash of block header).
77
+ * @returns The block's hash.
78
+ */
79
+ hash(): Promise<Fr>;
80
+ toBlobFields(isFirstBlock: boolean): Fr[];
81
+ toBlockBlobData(isFirstBlock: boolean): BlockBlobData;
82
+ /**
83
+ * Returns stats used for logging.
84
+ * @returns Stats on tx count, number, and log size and count.
85
+ */
86
+ getStats(): {
87
+ privateLogCount: number;
88
+ publicLogCount: number;
89
+ contractClassLogCount: number;
90
+ contractClassLogSize: number;
91
+ txCount: number;
92
+ blockNumber: number;
93
+ blockTimestamp: number;
94
+ };
95
+ toBlockInfo(): L2BlockInfo;
96
+ }
97
+ //# sourceMappingURL=l2_block_new.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"l2_block_new.d.ts","sourceRoot":"","sources":["../../src/block/l2_block_new.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;AAE9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,qBAAa,UAAU;IAEnB,2DAA2D;IACpD,OAAO,EAAE,sBAAsB;IACtC,2BAA2B;IACpB,MAAM,EAAE,WAAW;IAC1B,qBAAqB;IACd,IAAI,EAAE,IAAI;IACjB,OAAO,CAAC,SAAS;;IANjB,2DAA2D;IACpD,OAAO,EAAE,sBAAsB;IACtC,2BAA2B;IACpB,MAAM,EAAE,WAAW;IAC1B,qBAAqB;IACd,IAAI,EAAE,IAAI,EACT,SAAS,GAAE,EAAE,GAAG,SAAqB;IAG/C,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAQhB;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY;IAS5C;;;OAGG;IACH,QAAQ;IAIR;;;OAGG;IACU,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC;IAOzB,YAAY,CAAC,YAAY,EAAE,OAAO,GAAG,EAAE,EAAE;IAKzC,eAAe,CAAC,YAAY,EAAE,OAAO,GAAG,aAAa;IAuB5D;;;OAGG;IACH,QAAQ;;;;;;;;;IAuBR,WAAW,IAAI,WAAW;CAW3B"}
@@ -0,0 +1,113 @@
1
+ import { encodeBlockBlobData } from '@aztec/blob-lib/encoding';
2
+ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
3
+ import { z } from 'zod';
4
+ import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
5
+ import { BlockHeader } from '../tx/block_header.js';
6
+ import { Body } from './body.js';
7
+ /**
8
+ * An L2 block with a header and a body.
9
+ * TODO: Delete the existing `L2Block` class and rename this to `L2Block`.
10
+ */ export class L2BlockNew {
11
+ archive;
12
+ header;
13
+ body;
14
+ blockHash;
15
+ constructor(/** Snapshot of archive tree after the block is applied. */ archive, /** Header of the block. */ header, /** L2 block body. */ body, blockHash = undefined){
16
+ this.archive = archive;
17
+ this.header = header;
18
+ this.body = body;
19
+ this.blockHash = blockHash;
20
+ }
21
+ get number() {
22
+ return this.header.globalVariables.blockNumber;
23
+ }
24
+ get timestamp() {
25
+ return this.header.globalVariables.timestamp;
26
+ }
27
+ static get schema() {
28
+ return z.object({
29
+ archive: AppendOnlyTreeSnapshot.schema,
30
+ header: BlockHeader.schema,
31
+ body: Body.schema
32
+ }).transform(({ archive, header, body })=>new L2BlockNew(archive, header, body));
33
+ }
34
+ /**
35
+ * Deserializes a block from a buffer
36
+ * @returns A deserialized L2 block.
37
+ */ static fromBuffer(buf) {
38
+ const reader = BufferReader.asReader(buf);
39
+ const header = reader.readObject(BlockHeader);
40
+ const archive = reader.readObject(AppendOnlyTreeSnapshot);
41
+ const body = reader.readObject(Body);
42
+ return new L2BlockNew(archive, header, body);
43
+ }
44
+ /**
45
+ * Serializes a block
46
+ * @returns A serialized L2 block as a Buffer.
47
+ */ toBuffer() {
48
+ return serializeToBuffer(this.header, this.archive, this.body);
49
+ }
50
+ /**
51
+ * Returns the block's hash (hash of block header).
52
+ * @returns The block's hash.
53
+ */ async hash() {
54
+ if (this.blockHash === undefined) {
55
+ this.blockHash = await this.header.hash();
56
+ }
57
+ return this.blockHash;
58
+ }
59
+ toBlobFields(isFirstBlock) {
60
+ const blockBlobData = this.toBlockBlobData(isFirstBlock);
61
+ return encodeBlockBlobData(blockBlobData);
62
+ }
63
+ toBlockBlobData(isFirstBlock) {
64
+ return {
65
+ blockEndMarker: {
66
+ numTxs: this.body.txEffects.length,
67
+ timestamp: this.header.globalVariables.timestamp,
68
+ blockNumber: this.number
69
+ },
70
+ blockEndStateField: {
71
+ l1ToL2MessageNextAvailableLeafIndex: this.header.state.l1ToL2MessageTree.nextAvailableLeafIndex,
72
+ noteHashNextAvailableLeafIndex: this.header.state.partial.noteHashTree.nextAvailableLeafIndex,
73
+ nullifierNextAvailableLeafIndex: this.header.state.partial.nullifierTree.nextAvailableLeafIndex,
74
+ publicDataNextAvailableLeafIndex: this.header.state.partial.publicDataTree.nextAvailableLeafIndex,
75
+ totalManaUsed: this.header.totalManaUsed.toBigInt()
76
+ },
77
+ lastArchiveRoot: this.header.lastArchive.root,
78
+ noteHashRoot: this.header.state.partial.noteHashTree.root,
79
+ nullifierRoot: this.header.state.partial.nullifierTree.root,
80
+ publicDataRoot: this.header.state.partial.publicDataTree.root,
81
+ l1ToL2MessageRoot: isFirstBlock ? this.header.state.l1ToL2MessageTree.root : undefined,
82
+ txs: this.body.toTxBlobData()
83
+ };
84
+ }
85
+ /**
86
+ * Returns stats used for logging.
87
+ * @returns Stats on tx count, number, and log size and count.
88
+ */ getStats() {
89
+ const logsStats = {
90
+ privateLogCount: this.body.txEffects.reduce((logCount, txEffect)=>logCount + txEffect.privateLogs.length, 0),
91
+ publicLogCount: this.body.txEffects.reduce((logCount, txEffect)=>logCount + txEffect.publicLogs.length, 0),
92
+ contractClassLogCount: this.body.txEffects.reduce((logCount, txEffect)=>logCount + txEffect.contractClassLogs.length, 0),
93
+ contractClassLogSize: this.body.txEffects.reduce((totalLogSize, txEffect)=>totalLogSize + txEffect.contractClassLogs.reduce((acc, log)=>acc + log.emittedLength, 0), 0)
94
+ };
95
+ return {
96
+ txCount: this.body.txEffects.length,
97
+ blockNumber: this.number,
98
+ blockTimestamp: Number(this.header.globalVariables.timestamp),
99
+ ...logsStats
100
+ };
101
+ }
102
+ toBlockInfo() {
103
+ return {
104
+ blockHash: this.blockHash,
105
+ archive: this.archive.root,
106
+ lastArchive: this.header.lastArchive.root,
107
+ blockNumber: this.number,
108
+ slotNumber: Number(this.header.getSlot()),
109
+ txCount: this.body.txEffects.length,
110
+ timestamp: this.header.globalVariables.timestamp
111
+ };
112
+ }
113
+ }
@@ -0,0 +1,108 @@
1
+ import { Fr } from '@aztec/foundation/fields';
2
+ import { BufferReader } from '@aztec/foundation/serialize';
3
+ import { z } from 'zod';
4
+ import { L2BlockNew } from '../block/l2_block_new.js';
5
+ import { CheckpointHeader } from '../rollup/checkpoint_header.js';
6
+ import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
7
+ export declare class Checkpoint {
8
+ /** Snapshot of archive tree after the checkpoint is added. */
9
+ archive: AppendOnlyTreeSnapshot;
10
+ /** Header of the checkpoint. */
11
+ header: CheckpointHeader;
12
+ /** L2 blocks in the checkpoint. */
13
+ blocks: L2BlockNew[];
14
+ constructor(
15
+ /** Snapshot of archive tree after the checkpoint is added. */
16
+ archive: AppendOnlyTreeSnapshot,
17
+ /** Header of the checkpoint. */
18
+ header: CheckpointHeader,
19
+ /** L2 blocks in the checkpoint. */
20
+ blocks: L2BlockNew[]);
21
+ static get schema(): z.ZodEffects<z.ZodObject<{
22
+ archive: z.ZodEffects<z.ZodObject<{
23
+ root: z.ZodType<Fr, any, string>;
24
+ nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ root: Fr;
27
+ nextAvailableLeafIndex: number;
28
+ }, {
29
+ root: string;
30
+ nextAvailableLeafIndex: string | number | bigint;
31
+ }>, AppendOnlyTreeSnapshot, {
32
+ root: string;
33
+ nextAvailableLeafIndex: string | number | bigint;
34
+ }>;
35
+ header: import("@aztec/foundation/schemas").ZodFor<CheckpointHeader>;
36
+ blocks: z.ZodArray<z.ZodEffects<z.ZodObject<{
37
+ archive: z.ZodEffects<z.ZodObject<{
38
+ root: z.ZodType<Fr, any, string>;
39
+ nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ root: Fr;
42
+ nextAvailableLeafIndex: number;
43
+ }, {
44
+ root: string;
45
+ nextAvailableLeafIndex: string | number | bigint;
46
+ }>, AppendOnlyTreeSnapshot, {
47
+ root: string;
48
+ nextAvailableLeafIndex: string | number | bigint;
49
+ }>;
50
+ header: import("@aztec/foundation/schemas").ZodFor<import("../tx/block_header.js").BlockHeader>;
51
+ body: import("@aztec/foundation/schemas").ZodFor<import("../block/body.js").Body>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ archive: AppendOnlyTreeSnapshot;
54
+ header: import("../tx/block_header.js").BlockHeader;
55
+ body: import("../block/body.js").Body;
56
+ }, {
57
+ archive: {
58
+ root: string;
59
+ nextAvailableLeafIndex: string | number | bigint;
60
+ };
61
+ header?: any;
62
+ body?: any;
63
+ }>, L2BlockNew, {
64
+ archive: {
65
+ root: string;
66
+ nextAvailableLeafIndex: string | number | bigint;
67
+ };
68
+ header?: any;
69
+ body?: any;
70
+ }>, "many">;
71
+ }, "strip", z.ZodTypeAny, {
72
+ archive: AppendOnlyTreeSnapshot;
73
+ header: CheckpointHeader;
74
+ blocks: L2BlockNew[];
75
+ }, {
76
+ archive: {
77
+ root: string;
78
+ nextAvailableLeafIndex: string | number | bigint;
79
+ };
80
+ blocks: {
81
+ archive: {
82
+ root: string;
83
+ nextAvailableLeafIndex: string | number | bigint;
84
+ };
85
+ header?: any;
86
+ body?: any;
87
+ }[];
88
+ header?: any;
89
+ }>, Checkpoint, {
90
+ archive: {
91
+ root: string;
92
+ nextAvailableLeafIndex: string | number | bigint;
93
+ };
94
+ blocks: {
95
+ archive: {
96
+ root: string;
97
+ nextAvailableLeafIndex: string | number | bigint;
98
+ };
99
+ header?: any;
100
+ body?: any;
101
+ }[];
102
+ header?: any;
103
+ }>;
104
+ static fromBuffer(buf: Buffer | BufferReader): Checkpoint;
105
+ toBuffer(): Buffer<ArrayBufferLike>;
106
+ toBlobFields(): Fr[];
107
+ }
108
+ //# sourceMappingURL=checkpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint.d.ts","sourceRoot":"","sources":["../../src/checkpoint/checkpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,qBAAa,UAAU;IAEnB,8DAA8D;IACvD,OAAO,EAAE,sBAAsB;IACtC,gCAAgC;IACzB,MAAM,EAAE,gBAAgB;IAC/B,mCAAmC;IAC5B,MAAM,EAAE,UAAU,EAAE;;IAL3B,8DAA8D;IACvD,OAAO,EAAE,sBAAsB;IACtC,gCAAgC;IACzB,MAAM,EAAE,gBAAgB;IAC/B,mCAAmC;IAC5B,MAAM,EAAE,UAAU,EAAE;IAG7B,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAQhB;IAED,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY;IAQ5C,QAAQ;IAID,YAAY;CAIpB"}
@@ -0,0 +1,39 @@
1
+ import { Fr } from '@aztec/foundation/fields';
2
+ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
3
+ import { z } from 'zod';
4
+ import { L2BlockNew } from '../block/l2_block_new.js';
5
+ import { CheckpointHeader } from '../rollup/checkpoint_header.js';
6
+ import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
7
+ export class Checkpoint {
8
+ archive;
9
+ header;
10
+ blocks;
11
+ constructor(/** Snapshot of archive tree after the checkpoint is added. */ archive, /** Header of the checkpoint. */ header, /** L2 blocks in the checkpoint. */ blocks){
12
+ this.archive = archive;
13
+ this.header = header;
14
+ this.blocks = blocks;
15
+ }
16
+ static get schema() {
17
+ return z.object({
18
+ archive: AppendOnlyTreeSnapshot.schema,
19
+ header: CheckpointHeader.schema,
20
+ blocks: z.array(L2BlockNew.schema)
21
+ }).transform(({ archive, header, blocks })=>new Checkpoint(archive, header, blocks));
22
+ }
23
+ static fromBuffer(buf) {
24
+ const reader = BufferReader.asReader(buf);
25
+ const archive = reader.readObject(AppendOnlyTreeSnapshot);
26
+ const header = reader.readObject(CheckpointHeader);
27
+ const blocks = reader.readVector(L2BlockNew);
28
+ return new Checkpoint(archive, header, blocks);
29
+ }
30
+ toBuffer() {
31
+ return serializeToBuffer(this.archive, this.header, this.blocks.length, this.blocks);
32
+ }
33
+ toBlobFields() {
34
+ const blocksBlobFields = this.blocks.flatMap((block, i)=>block.toBlobFields(i === 0));
35
+ return [
36
+ new Fr(blocksBlobFields.length + 1)
37
+ ].concat(blocksBlobFields);
38
+ }
39
+ }
@@ -1,2 +1,2 @@
1
- export * from './checkpoint_body.js';
1
+ export * from './checkpoint.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/checkpoint/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/checkpoint/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- export * from './checkpoint_body.js';
1
+ export * from './checkpoint.js';
@@ -16,7 +16,7 @@ export declare class PrivateLog {
16
16
  getEmittedFields(): Fr[];
17
17
  getEmittedFieldsWithoutTag(): Fr[];
18
18
  toBlobFields(): Fr[];
19
- static fromBlobFields(fields: Fr[] | FieldReader): PrivateLog;
19
+ static fromBlobFields(emittedLength: number, fields: Fr[] | FieldReader): PrivateLog;
20
20
  isEmpty(): boolean;
21
21
  static empty(): PrivateLog;
22
22
  toBuffer(): Buffer;
@@ -1 +1 @@
1
- {"version":3,"file":"private_log.d.ts","sourceRoot":"","sources":["../../src/logs/private_log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,KAAK,QAAQ,EAAa,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EACL,YAAY,EACZ,WAAW,EACX,KAAK,KAAK,EAGX,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,qBAAa,UAAU;IAIZ,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,0BAA0B,CAAC;IAEpD,aAAa,EAAE,MAAM;IAL9B,MAAM,CAAC,aAAa,SAAyC;gBAGpD,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,0BAA0B,CAAC,EAEpD,aAAa,EAAE,MAAM;IAG9B,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC;IAIxC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC;IAI7C,QAAQ,IAAI,EAAE,EAAE;IAIhB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW;IAK5C,gBAAgB;IAIhB,0BAA0B;IAI1B,YAAY,IAAI,EAAE,EAAE;IAIpB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW;IAOhD,OAAO;IAIP,MAAM,CAAC,KAAK;IAIZ,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAK/C,MAAM,CAAC,MAAM,CAAC,GAAG,KAAc;IAM/B,MAAM,KAAK,MAAM;;;;;;;;;;;;OAQhB;IAED;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,UAAU;IAU5C,MAAM,CAAC,KAAK,EAAE,UAAU;IAIxB,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM;CAM3B"}
1
+ {"version":3,"file":"private_log.d.ts","sourceRoot":"","sources":["../../src/logs/private_log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,KAAK,QAAQ,EAAa,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EACL,YAAY,EACZ,WAAW,EACX,KAAK,KAAK,EAGX,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,qBAAa,UAAU;IAIZ,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,0BAA0B,CAAC;IAEpD,aAAa,EAAE,MAAM;IAL9B,MAAM,CAAC,aAAa,SAAyC;gBAGpD,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,0BAA0B,CAAC,EAEpD,aAAa,EAAE,MAAM;IAG9B,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC;IAIxC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC;IAI7C,QAAQ,IAAI,EAAE,EAAE;IAIhB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW;IAK5C,gBAAgB;IAIhB,0BAA0B;IAI1B,YAAY,IAAI,EAAE,EAAE;IAIpB,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW;IAMvE,OAAO;IAIP,MAAM,CAAC,KAAK;IAIZ,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAK/C,MAAM,CAAC,MAAM,CAAC,GAAG,KAAc;IAM/B,MAAM,KAAK,MAAM;;;;;;;;;;;;OAQhB;IAED;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,UAAU;IAU5C,MAAM,CAAC,KAAK,EAAE,UAAU;IAIxB,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM;CAM3B"}
@@ -38,13 +38,10 @@ export class PrivateLog {
38
38
  return this.fields.slice(1, this.emittedLength);
39
39
  }
40
40
  toBlobFields() {
41
- return [
42
- new Fr(this.emittedLength)
43
- ].concat(this.getEmittedFields());
41
+ return this.getEmittedFields();
44
42
  }
45
- static fromBlobFields(fields) {
43
+ static fromBlobFields(emittedLength, fields) {
46
44
  const reader = FieldReader.asReader(fields);
47
- const emittedLength = reader.readU32();
48
45
  const emittedFields = reader.readFieldArray(emittedLength);
49
46
  return new PrivateLog(padArrayEnd(emittedFields, Fr.ZERO, PRIVATE_LOG_SIZE_IN_FIELDS), emittedLength);
50
47
  }
@@ -0,0 +1,4 @@
1
+ import { Fr } from '@aztec/foundation/fields';
2
+ /** Computes the inHash for a block's ContentCommitment given its l1 to l2 messages. */
3
+ export declare function computeInHashFromL1ToL2Messages(unpaddedL1ToL2Messages: Fr[]): Promise<Fr>;
4
+ //# sourceMappingURL=in_hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in_hash.d.ts","sourceRoot":"","sources":["../../src/messaging/in_hash.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,uFAAuF;AACvF,wBAAsB,+BAA+B,CAAC,sBAAsB,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAO/F"}
@@ -0,0 +1,15 @@
1
+ import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
2
+ import { padArrayEnd } from '@aztec/foundation/collection';
3
+ import { sha256Trunc } from '@aztec/foundation/crypto';
4
+ import { Fr } from '@aztec/foundation/fields';
5
+ import { MerkleTreeCalculator } from '@aztec/foundation/trees';
6
+ /** Computes the inHash for a block's ContentCommitment given its l1 to l2 messages. */ export async function computeInHashFromL1ToL2Messages(unpaddedL1ToL2Messages) {
7
+ const l1ToL2Messages = padArrayEnd(unpaddedL1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
8
+ const hasher = (left, right)=>Promise.resolve(sha256Trunc(Buffer.concat([
9
+ left,
10
+ right
11
+ ])));
12
+ const parityHeight = Math.ceil(Math.log2(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP));
13
+ const parityCalculator = await MerkleTreeCalculator.create(parityHeight, Fr.ZERO.toBuffer(), hasher);
14
+ return new Fr(await parityCalculator.computeTreeRoot(l1ToL2Messages.map((msg)=>msg.toBuffer())));
15
+ }
@@ -1,3 +1,4 @@
1
+ export * from './in_hash.js';
1
2
  export * from './inbox_leaf.js';
2
3
  export * from './l1_to_l2_message.js';
3
4
  export * from './l1_to_l2_message_source.js';
@@ -5,4 +6,5 @@ export * from './l1_actor.js';
5
6
  export * from './l2_actor.js';
6
7
  export * from './l2_to_l1_message.js';
7
8
  export * from './l2_to_l1_membership.js';
9
+ export * from './out_hash.js';
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messaging/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messaging/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC"}
@@ -1,3 +1,4 @@
1
+ export * from './in_hash.js';
1
2
  export * from './inbox_leaf.js';
2
3
  export * from './l1_to_l2_message.js';
3
4
  export * from './l1_to_l2_message_source.js';
@@ -5,3 +6,4 @@ export * from './l1_actor.js';
5
6
  export * from './l2_actor.js';
6
7
  export * from './l2_to_l1_message.js';
7
8
  export * from './l2_to_l1_membership.js';
9
+ export * from './out_hash.js';
@@ -0,0 +1,5 @@
1
+ import { Fr } from '@aztec/foundation/fields';
2
+ export declare function computeTxOutHash(messages: Fr[]): Fr;
3
+ export declare function computeBlockOutHash(messagesPerBlock: Fr[][]): Fr;
4
+ export declare function computeCheckpointOutHash(messagesForAllTxs: Fr[][][]): Fr;
5
+ //# sourceMappingURL=out_hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"out_hash.d.ts","sourceRoot":"","sources":["../../src/messaging/out_hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,CAOnD;AAED,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAGhE;AAED,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAGxE"}
@@ -0,0 +1,28 @@
1
+ import { Fr } from '@aztec/foundation/fields';
2
+ import { UnbalancedMerkleTreeCalculator, computeUnbalancedMerkleTreeRoot } from '@aztec/foundation/trees';
3
+ export function computeTxOutHash(messages) {
4
+ if (!messages.length) {
5
+ return Fr.ZERO;
6
+ }
7
+ // Tx out hash is the root of the unbalanced merkle tree of all the messages.
8
+ // Zero hashes (which should not happen) are not compressed.
9
+ return Fr.fromBuffer(computeUnbalancedMerkleTreeRoot(messages.map((msg)=>msg.toBuffer())));
10
+ }
11
+ export function computeBlockOutHash(messagesPerBlock) {
12
+ const txOutHashes = messagesPerBlock.map((messages)=>computeTxOutHash(messages));
13
+ return aggregateOutHashes(txOutHashes);
14
+ }
15
+ export function computeCheckpointOutHash(messagesForAllTxs) {
16
+ const blockOutHashes = messagesForAllTxs.map((block)=>computeBlockOutHash(block));
17
+ return aggregateOutHashes(blockOutHashes);
18
+ }
19
+ // The root of this tree should match the `out_hash` calculated in the circuits. Zero hashes are compressed to reduce
20
+ // cost if the non-zero leaves result in a shorter path.
21
+ function aggregateOutHashes(outHashes) {
22
+ if (!outHashes.length) {
23
+ return Fr.ZERO;
24
+ }
25
+ const valueToCompress = Buffer.alloc(32);
26
+ const tree = UnbalancedMerkleTreeCalculator.create(outHashes.map((hash)=>hash.toBuffer()), valueToCompress);
27
+ return Fr.fromBuffer(tree.getRoot());
28
+ }
@@ -2,6 +2,7 @@ import { EthAddress } from '@aztec/foundation/eth-address';
2
2
  import { Fr } from '@aztec/foundation/fields';
3
3
  import { BufferReader } from '@aztec/foundation/serialize';
4
4
  import type { FieldsOf } from '@aztec/foundation/types';
5
+ import { inspect } from 'util';
5
6
  import { AztecAddress } from '../aztec-address/index.js';
6
7
  import { GasFees } from '../gas/gas_fees.js';
7
8
  /**
@@ -50,5 +51,20 @@ export declare class CheckpointConstantData {
50
51
  static empty(): CheckpointConstantData;
51
52
  toBuffer(): Buffer<ArrayBufferLike>;
52
53
  static fromBuffer(buffer: Buffer | BufferReader): CheckpointConstantData;
54
+ toInspect(): {
55
+ chainId: number;
56
+ version: number;
57
+ vkTreeRoot: `0x${string}`;
58
+ protocolContractsHash: `0x${string}`;
59
+ proverId: `0x${string}`;
60
+ slotNumber: number;
61
+ coinbase: `0x${string}`;
62
+ feeRecipient: `0x${string}`;
63
+ gasFees: {
64
+ feePerDaGas: bigint;
65
+ feePerL2Gas: bigint;
66
+ };
67
+ };
68
+ [inspect.custom](): string;
53
69
  }
54
70
  //# sourceMappingURL=checkpoint_constant_data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkpoint_constant_data.d.ts","sourceRoot":"","sources":["../../src/rollup/checkpoint_constant_data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C;;GAEG;AACH,qBAAa,sBAAsB;IAE/B,6BAA6B;IACtB,OAAO,EAAE,EAAE;IAClB,6BAA6B;IACtB,OAAO,EAAE,EAAE;IAClB,yCAAyC;IAClC,UAAU,EAAE,EAAE;IACrB,2CAA2C;IACpC,qBAAqB,EAAE,EAAE;IAChC,gCAAgC;IACzB,QAAQ,EAAE,EAAE;IACnB,qCAAqC;IAC9B,UAAU,EAAE,EAAE;IACrB,sCAAsC;IAC/B,QAAQ,EAAE,UAAU;IAC3B,+BAA+B;IACxB,YAAY,EAAE,YAAY;IACjC,2CAA2C;IACpC,OAAO,EAAE,OAAO;;IAjBvB,6BAA6B;IACtB,OAAO,EAAE,EAAE;IAClB,6BAA6B;IACtB,OAAO,EAAE,EAAE;IAClB,yCAAyC;IAClC,UAAU,EAAE,EAAE;IACrB,2CAA2C;IACpC,qBAAqB,EAAE,EAAE;IAChC,gCAAgC;IACzB,QAAQ,EAAE,EAAE;IACnB,qCAAqC;IAC9B,UAAU,EAAE,EAAE;IACrB,sCAAsC;IAC/B,QAAQ,EAAE,UAAU;IAC3B,+BAA+B;IACxB,YAAY,EAAE,YAAY;IACjC,2CAA2C;IACpC,OAAO,EAAE,OAAO;IAGzB,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,sBAAsB,CAAC;IAIpD,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,sBAAsB,CAAC;IAczD,MAAM,CAAC,KAAK;IAcZ,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;CAchD"}
1
+ {"version":3,"file":"checkpoint_constant_data.d.ts","sourceRoot":"","sources":["../../src/rollup/checkpoint_constant_data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C;;GAEG;AACH,qBAAa,sBAAsB;IAE/B,6BAA6B;IACtB,OAAO,EAAE,EAAE;IAClB,6BAA6B;IACtB,OAAO,EAAE,EAAE;IAClB,yCAAyC;IAClC,UAAU,EAAE,EAAE;IACrB,2CAA2C;IACpC,qBAAqB,EAAE,EAAE;IAChC,gCAAgC;IACzB,QAAQ,EAAE,EAAE;IACnB,qCAAqC;IAC9B,UAAU,EAAE,EAAE;IACrB,sCAAsC;IAC/B,QAAQ,EAAE,UAAU;IAC3B,+BAA+B;IACxB,YAAY,EAAE,YAAY;IACjC,2CAA2C;IACpC,OAAO,EAAE,OAAO;;IAjBvB,6BAA6B;IACtB,OAAO,EAAE,EAAE;IAClB,6BAA6B;IACtB,OAAO,EAAE,EAAE;IAClB,yCAAyC;IAClC,UAAU,EAAE,EAAE;IACrB,2CAA2C;IACpC,qBAAqB,EAAE,EAAE;IAChC,gCAAgC;IACzB,QAAQ,EAAE,EAAE;IACnB,qCAAqC;IAC9B,UAAU,EAAE,EAAE;IACrB,sCAAsC;IAC/B,QAAQ,EAAE,UAAU;IAC3B,+BAA+B;IACxB,YAAY,EAAE,YAAY;IACjC,2CAA2C;IACpC,OAAO,EAAE,OAAO;IAGzB,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,sBAAsB,CAAC;IAIpD,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,sBAAsB,CAAC;IAczD,MAAM,CAAC,KAAK;IAcZ,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAe/C,SAAS;;;;;;;;;;;;;;IAcT,CAAC,OAAO,CAAC,MAAM,CAAC;CAGjB"}
@@ -1,6 +1,7 @@
1
1
  import { EthAddress } from '@aztec/foundation/eth-address';
2
2
  import { Fr } from '@aztec/foundation/fields';
3
3
  import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
4
+ import { inspect } from 'util';
4
5
  import { AztecAddress } from '../aztec-address/index.js';
5
6
  import { GasFees } from '../gas/gas_fees.js';
6
7
  /**
@@ -52,4 +53,20 @@ import { GasFees } from '../gas/gas_fees.js';
52
53
  const reader = BufferReader.asReader(buffer);
53
54
  return new CheckpointConstantData(Fr.fromBuffer(reader), Fr.fromBuffer(reader), Fr.fromBuffer(reader), Fr.fromBuffer(reader), Fr.fromBuffer(reader), Fr.fromBuffer(reader), reader.readObject(EthAddress), reader.readObject(AztecAddress), reader.readObject(GasFees));
54
55
  }
56
+ toInspect() {
57
+ return {
58
+ chainId: this.chainId.toNumber(),
59
+ version: this.version.toNumber(),
60
+ vkTreeRoot: this.vkTreeRoot.toString(),
61
+ protocolContractsHash: this.protocolContractsHash.toString(),
62
+ proverId: this.proverId.toString(),
63
+ slotNumber: this.slotNumber.toNumber(),
64
+ coinbase: this.coinbase.toString(),
65
+ feeRecipient: this.feeRecipient.toString(),
66
+ gasFees: this.gasFees.toInspect()
67
+ };
68
+ }
69
+ [inspect.custom]() {
70
+ return `CheckpointConstantData ${inspect(this.toInspect())}`;
71
+ }
55
72
  }
@@ -14,7 +14,6 @@ import { AztecAddress } from '../aztec-address/index.js';
14
14
  import { L2BlockHeader } from '../block/index.js';
15
15
  import { type ContractClassPublic, ContractDeploymentData, type ContractInstanceWithAddress, type ExecutablePrivateFunctionWithMembershipProof, type UtilityFunctionWithMembershipProof } from '../contract/index.js';
16
16
  import { Gas, GasSettings } from '../gas/index.js';
17
- import type { MerkleTreeReadOperations } from '../interfaces/merkle_tree_operations.js';
18
17
  import { PrivateKernelTailCircuitPublicInputs, PrivateToPublicAccumulatedData, PrivateToPublicKernelCircuitPublicInputs, PrivateToRollupAccumulatedData } from '../kernel/index.js';
19
18
  import { PrivateCircuitPublicInputs } from '../kernel/private_circuit_public_inputs.js';
20
19
  import { PrivateToRollupKernelCircuitPublicInputs } from '../kernel/private_to_rollup_kernel_circuit_public_inputs.js';
@@ -70,6 +69,7 @@ export declare function makeGasSettings(): GasSettings;
70
69
  * @returns A selector.
71
70
  */
72
71
  export declare function makeSelector(seed: number): FunctionSelector;
72
+ export declare function makePublicDataWrite(seed?: number): PublicDataWrite;
73
73
  /**
74
74
  * Creates arbitrary public data read.
75
75
  * @param seed - The seed to use for generating the public data read.
@@ -98,8 +98,21 @@ export declare function makeContractStorageRead(seed?: number): ContractStorageR
98
98
  * @param seed - The seed to use for generating the accumulated data.
99
99
  * @returns An accumulated data.
100
100
  */
101
- export declare function makePrivateToRollupAccumulatedData(seed?: number, full?: boolean): PrivateToRollupAccumulatedData;
102
- export declare function makePrivateToPublicAccumulatedData(seed?: number): PrivateToPublicAccumulatedData;
101
+ export declare function makePrivateToRollupAccumulatedData(seed?: number, { numNoteHashes, numNullifiers, numL2ToL1Messages, numPrivateLogs, numContractClassLogs, }?: {
102
+ numNoteHashes?: number;
103
+ numNullifiers?: number;
104
+ numL2ToL1Messages?: number;
105
+ numPrivateLogs?: number;
106
+ numContractClassLogs?: number;
107
+ }): PrivateToRollupAccumulatedData;
108
+ export declare function makePrivateToPublicAccumulatedData(seed?: number, { numNoteHashes, numNullifiers, numL2ToL1Messages, numPrivateLogs, numContractClassLogs, numEnqueuedCalls, }?: {
109
+ numNoteHashes?: number;
110
+ numNullifiers?: number;
111
+ numL2ToL1Messages?: number;
112
+ numPrivateLogs?: number;
113
+ numContractClassLogs?: number;
114
+ numEnqueuedCalls?: number;
115
+ }): PrivateToPublicAccumulatedData;
103
116
  export declare function makeGas(seed?: number): Gas;
104
117
  /**
105
118
  * Creates arbitrary call context.
@@ -121,7 +134,7 @@ export declare function makeProtocolContracts(seed?: number): ProtocolContracts;
121
134
  * @param seed - The seed to use for generating the kernel circuit public inputs.
122
135
  * @returns Public kernel circuit public inputs.
123
136
  */
124
- export declare function makePrivateToRollupKernelCircuitPublicInputs(seed?: number, fullAccumulatedData?: boolean): PrivateToRollupKernelCircuitPublicInputs;
137
+ export declare function makePrivateToRollupKernelCircuitPublicInputs(seed?: number): PrivateToRollupKernelCircuitPublicInputs;
125
138
  /**
126
139
  * Creates arbitrary/mocked membership witness where the sibling paths is an array of fields in an ascending order starting from `start`.
127
140
  * @param size - The size of the membership witness.
@@ -365,21 +378,4 @@ export declare function makeAvmCircuitInputs(seed?: number, overrides?: Partial<
365
378
  * @returns The field.
366
379
  */
367
380
  export declare function fr(n: number): Fr;
368
- /** Makes a bloated processed tx for testing purposes. */
369
- export declare function makeBloatedProcessedTx({ seed, header, db, chainId, version, gasSettings, vkTreeRoot, protocolContracts, globalVariables, newL1ToL2Snapshot, feePayer, feePaymentPublicDataWrite, gasUsed, privateOnly, }?: {
370
- seed?: number;
371
- header?: BlockHeader;
372
- db?: MerkleTreeReadOperations;
373
- chainId?: Fr;
374
- version?: Fr;
375
- gasSettings?: GasSettings;
376
- vkTreeRoot?: Fr;
377
- globalVariables?: GlobalVariables;
378
- newL1ToL2Snapshot?: AppendOnlyTreeSnapshot;
379
- protocolContracts?: ProtocolContracts;
380
- feePayer?: AztecAddress;
381
- feePaymentPublicDataWrite?: PublicDataWrite;
382
- gasUsed?: Gas;
383
- privateOnly?: boolean;
384
- }): Promise<import("../tx/processed_tx.js").ProcessedTx>;
385
381
  //# sourceMappingURL=factories.d.ts.map