@aztec/stdlib 3.0.0-nightly.20251001 → 3.0.0-nightly.20251003

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.
@@ -12,21 +12,21 @@ export declare function inBlockSchemaFor<T extends ZodTypeAny>(schema: T): z.Zod
12
12
  data: T;
13
13
  l2BlockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
14
14
  l2BlockHash: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, Buffer<ArrayBuffer>, string>, L2BlockHash, string>;
15
- }, "strip", ZodTypeAny, { [k in keyof z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
15
+ }, "strip", ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
16
16
  data: T;
17
17
  l2BlockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
18
18
  l2BlockHash: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, Buffer<ArrayBuffer>, string>, L2BlockHash, string>;
19
- }>, any>]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
19
+ }>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
20
20
  data: T;
21
21
  l2BlockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
22
22
  l2BlockHash: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, Buffer<ArrayBuffer>, string>, L2BlockHash, string>;
23
- }>, any>[k]; }, { [k_1 in keyof z.baseObjectInputType<{
23
+ }>, any>[k]; } : never, z.baseObjectInputType<{
24
24
  data: T;
25
25
  l2BlockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
26
26
  l2BlockHash: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, Buffer<ArrayBuffer>, string>, L2BlockHash, string>;
27
- }>]: z.baseObjectInputType<{
27
+ }> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
28
28
  data: T;
29
29
  l2BlockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
30
30
  l2BlockHash: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, Buffer<ArrayBuffer>, string>, L2BlockHash, string>;
31
- }>[k_1]; }>;
31
+ }>[k_1]; } : never>;
32
32
  //# sourceMappingURL=in_block.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"in_block.d.ts","sourceRoot":"","sources":["../../src/block/in_block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,CAAC,CAAC;CACT,CAAC;AAEF,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAMpD;AAED,wBAAsB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAMjF;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAAE,MAAM,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;YAM/D"}
1
+ {"version":3,"file":"in_block.d.ts","sourceRoot":"","sources":["../../src/block/in_block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,CAAC,CAAC;CACT,CAAC;AAEF,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAMpD;AAED,wBAAsB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAMjF;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAAE,MAAM,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;oBAM/D"}
@@ -120,7 +120,7 @@ interface ContractClassCommitments {
120
120
  }
121
121
  /** A contract class with its precomputed id. */
122
122
  export type ContractClassWithId = ContractClass & Pick<ContractClassCommitments, 'id'>;
123
- export declare const ContractClassWithIdSchema: z.ZodObject<z.objectUtil.extendShape<{
123
+ export declare const ContractClassWithIdSchema: z.ZodObject<{
124
124
  version: z.ZodLiteral<1>;
125
125
  artifactHash: z.ZodType<Fr, any, string>;
126
126
  privateFunctions: z.ZodArray<z.ZodObject<{
@@ -146,9 +146,9 @@ export declare const ContractClassWithIdSchema: z.ZodObject<z.objectUtil.extendS
146
146
  type: "Buffer";
147
147
  data: number[];
148
148
  }>]>;
149
- }, {
149
+ } & {
150
150
  id: z.ZodType<Fr, any, string>;
151
- }>, "strip", z.ZodTypeAny, {
151
+ }, "strip", z.ZodTypeAny, {
152
152
  version: 1;
153
153
  id: Fr;
154
154
  artifactHash: Fr;
@@ -1 +1 @@
1
- {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/hash/hash.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D;;;;GAIG;AACH,wBAAsB,MAAM,CAAC,WAAW,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAG3D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC,CAE1F;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAE9E;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAEpF;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAErF;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAEnF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,CAExD;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,EA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;IACZ,aAAa,EAAE,EAAE,CAAC;IAClB,OAAO,EAAE,EAAE,CAAC;CACb,MAEA"}
package/dest/hash/hash.js CHANGED
@@ -103,9 +103,6 @@ import { Fr } from '@aztec/foundation/fields';
103
103
  * @param calldata - Calldata to hash.
104
104
  * @returns Hash of the calldata.
105
105
  */ export function computeCalldataHash(calldata) {
106
- if (calldata.length === 0) {
107
- return Promise.resolve(Fr.ZERO);
108
- }
109
106
  return poseidon2HashWithSeparator(calldata, GeneratorIndex.PUBLIC_CALLDATA);
110
107
  }
111
108
  /**
@@ -44,7 +44,7 @@ export interface AztecNodeAdmin {
44
44
  export type AztecNodeAdminConfig = ValidatorClientFullConfig & SequencerConfig & ProverConfig & SlasherConfig & Pick<ArchiverSpecificConfig, 'archiverPollingIntervalMS' | 'skipValidateBlockAttestations' | 'archiverBatchSize'> & {
45
45
  maxTxPoolSize: number;
46
46
  };
47
- export declare const AztecNodeAdminConfigSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
47
+ export declare const AztecNodeAdminConfigSchema: z.ZodObject<{
48
48
  transactionPollingIntervalMS: z.ZodOptional<z.ZodNumber>;
49
49
  maxTxsPerBlock: z.ZodOptional<z.ZodNumber>;
50
50
  minTxsPerBlock: z.ZodOptional<z.ZodNumber>;
@@ -95,7 +95,7 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<z.objectUtil.extend
95
95
  skipCollectingAttestations: z.ZodOptional<z.ZodBoolean>;
96
96
  secondsBeforeInvalidatingBlockAsCommitteeMember: z.ZodNumber;
97
97
  secondsBeforeInvalidatingBlockAsNonCommitteeMember: z.ZodNumber;
98
- }, {
98
+ } & {
99
99
  nodeUrl: z.ZodOptional<z.ZodString>;
100
100
  realProofs: z.ZodBoolean;
101
101
  proverId: z.ZodOptional<import("../schemas/schemas.js").ZodFor<import("@aztec/foundation/schemas").EthAddress>>;
@@ -103,7 +103,7 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<z.objectUtil.extend
103
103
  proverTestDelayMs: z.ZodNumber;
104
104
  proverTestDelayFactor: z.ZodNumber;
105
105
  proverAgentCount: z.ZodNumber;
106
- }>, {
106
+ } & {
107
107
  slashOverridePayload: z.ZodOptional<z.ZodType<import("@aztec/foundation/schemas").EthAddress, any, string>>;
108
108
  slashMinPenaltyPercentage: z.ZodNumber;
109
109
  slashMaxPenaltyPercentage: z.ZodNumber;
@@ -123,7 +123,7 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<z.objectUtil.extend
123
123
  slashBroadcastedInvalidBlockPenalty: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
124
124
  slashExecuteRoundsLookBack: z.ZodNumber;
125
125
  slashSelfAllowed: z.ZodOptional<z.ZodBoolean>;
126
- }>, {
126
+ } & {
127
127
  validatorAddresses: z.ZodOptional<z.ZodArray<z.ZodType<import("@aztec/foundation/schemas").EthAddress, any, string>, "many">>;
128
128
  disableValidator: z.ZodBoolean;
129
129
  disabledValidators: z.ZodArray<z.ZodType<import("@aztec/foundation/schemas").EthAddress, any, string>, "many">;
@@ -131,16 +131,16 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<z.objectUtil.extend
131
131
  validatorReexecute: z.ZodBoolean;
132
132
  validatorReexecuteDeadlineMs: z.ZodNumber;
133
133
  alwaysReexecuteBlockProposals: z.ZodOptional<z.ZodBoolean>;
134
- }>, Pick<{
134
+ } & Pick<{
135
135
  archiverPollingIntervalMS: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
136
136
  archiverBatchSize: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
137
137
  viemPollingIntervalMS: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
138
138
  maxLogs: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
139
139
  archiverStoreMapSizeKb: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
140
140
  skipValidateBlockAttestations: z.ZodOptional<z.ZodBoolean>;
141
- }, "archiverPollingIntervalMS" | "archiverBatchSize" | "skipValidateBlockAttestations">>, {
141
+ }, "archiverPollingIntervalMS" | "archiverBatchSize" | "skipValidateBlockAttestations"> & {
142
142
  maxTxPoolSize: z.ZodNumber;
143
- }>, "strip", z.ZodTypeAny, {
143
+ }, "strip", z.ZodTypeAny, {
144
144
  secondsBeforeInvalidatingBlockAsCommitteeMember: number;
145
145
  secondsBeforeInvalidatingBlockAsNonCommitteeMember: number;
146
146
  slashMinPenaltyPercentage: number;
@@ -5948,11 +5948,11 @@ export declare const ProvingJobFulfilledResult: z.ZodObject<{
5948
5948
  status: z.ZodLiteral<"fulfilled">;
5949
5949
  value: z.ZodBranded<z.ZodString, "ProvingJobUri">;
5950
5950
  }, "strip", z.ZodTypeAny, {
5951
- status: "fulfilled";
5952
5951
  value: string & z.BRAND<"ProvingJobUri">;
5953
- }, {
5954
5952
  status: "fulfilled";
5953
+ }, {
5955
5954
  value: string;
5955
+ status: "fulfilled";
5956
5956
  }>;
5957
5957
  export type ProvingJobFulfilledResult = z.infer<typeof ProvingJobFulfilledResult>;
5958
5958
  export declare const ProvingJobRejectedResult: z.ZodObject<{
@@ -5970,11 +5970,11 @@ export declare const ProvingJobSettledResult: z.ZodDiscriminatedUnion<"status",
5970
5970
  status: z.ZodLiteral<"fulfilled">;
5971
5971
  value: z.ZodBranded<z.ZodString, "ProvingJobUri">;
5972
5972
  }, "strip", z.ZodTypeAny, {
5973
- status: "fulfilled";
5974
5973
  value: string & z.BRAND<"ProvingJobUri">;
5975
- }, {
5976
5974
  status: "fulfilled";
5975
+ }, {
5977
5976
  value: string;
5977
+ status: "fulfilled";
5978
5978
  }>, z.ZodObject<{
5979
5979
  status: z.ZodLiteral<"rejected">;
5980
5980
  reason: z.ZodString;
@@ -6008,11 +6008,11 @@ export declare const ProvingJobStatus: z.ZodDiscriminatedUnion<"status", [z.ZodO
6008
6008
  status: z.ZodLiteral<"fulfilled">;
6009
6009
  value: z.ZodBranded<z.ZodString, "ProvingJobUri">;
6010
6010
  }, "strip", z.ZodTypeAny, {
6011
- status: "fulfilled";
6012
6011
  value: string & z.BRAND<"ProvingJobUri">;
6013
- }, {
6014
6012
  status: "fulfilled";
6013
+ }, {
6015
6014
  value: string;
6015
+ status: "fulfilled";
6016
6016
  }>, z.ZodObject<{
6017
6017
  status: z.ZodLiteral<"rejected">;
6018
6018
  reason: z.ZodString;
@@ -9,6 +9,6 @@ export type L2ToL1MembershipWitness = {
9
9
  siblingPath: SiblingPath<number>;
10
10
  };
11
11
  export declare function computeL2ToL1MembershipWitness(messageRetriever: MessageRetrieval, l2BlockNumber: number, message: Fr): Promise<L2ToL1MembershipWitness | undefined>;
12
- export declare function computeL2ToL1MembershipWitnessFromMessagesForAllTxs(messagesForAllTxs: Fr[][], message: Fr): Promise<L2ToL1MembershipWitness>;
12
+ export declare function computeL2ToL1MembershipWitnessFromMessagesForAllTxs(messagesForAllTxs: Fr[][], message: Fr): L2ToL1MembershipWitness;
13
13
  export declare function getL2ToL1MessageLeafId(membershipWitness: Pick<L2ToL1MembershipWitness, 'leafIndex' | 'siblingPath'>): bigint;
14
14
  //# sourceMappingURL=l2_to_l1_membership.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"l2_to_l1_membership.d.ts","sourceRoot":"","sources":["../../src/messaging/l2_to_l1_membership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EACL,WAAW,EAKZ,MAAM,yBAAyB,CAAC;AASjC,MAAM,W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AAE,GACV,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAO9C;AAID,wBAAgB,mDAAmD,CACjE,iBAAiB,EAAE,EAAE,EAAE,EAAE,EACzB,OAAO,EAAE,EAAE,GACV,uBAAuB,CA4DzB;AAED,wBAAgB,sBAAsB,CACpC,iBAAiB,EAAE,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,aAAa,CAAC,GAC5E,MAAM,CAER"}
@@ -1,11 +1,5 @@
1
1
  import { Fr } from '@aztec/foundation/fields';
2
- import { SiblingPath, UnbalancedMerkleTreeCalculator, computeUnbalancedMerkleTreeRoot, findLeafLevelAndIndex, getMaxUnbalancedTreeDepth } from '@aztec/foundation/trees';
3
- async function createOutHashTree(messages) {
4
- const messageSubtreeHeight = getMaxUnbalancedTreeDepth(messages.length);
5
- const calculator = UnbalancedMerkleTreeCalculator.create(messageSubtreeHeight);
6
- await calculator.appendLeaves(messages.map((msg)=>msg.toBuffer()));
7
- return calculator;
8
- }
2
+ import { SiblingPath, UnbalancedMerkleTreeCalculator, computeUnbalancedMerkleTreeRoot } from '@aztec/foundation/trees';
9
3
  export async function computeL2ToL1MembershipWitness(messageRetriever, l2BlockNumber, message) {
10
4
  const messagesForAllTxs = await messageRetriever.getL2ToL1Messages(l2BlockNumber);
11
5
  if (!messagesForAllTxs) {
@@ -13,7 +7,9 @@ export async function computeL2ToL1MembershipWitness(messageRetriever, l2BlockNu
13
7
  }
14
8
  return computeL2ToL1MembershipWitnessFromMessagesForAllTxs(messagesForAllTxs, message);
15
9
  }
16
- export async function computeL2ToL1MembershipWitnessFromMessagesForAllTxs(messagesForAllTxs, message) {
10
+ // TODO: Allow to specify the message to consume by its index or by an offset, in case there are multiple messages with
11
+ // the same value.
12
+ export function computeL2ToL1MembershipWitnessFromMessagesForAllTxs(messagesForAllTxs, message) {
17
13
  // Find index of message in subtree and index of tx in a block.
18
14
  let messageIndexInTx = -1;
19
15
  const txIndex = messagesForAllTxs.findIndex((messages)=>{
@@ -25,9 +21,9 @@ export async function computeL2ToL1MembershipWitnessFromMessagesForAllTxs(messag
25
21
  }
26
22
  // Get the txOutHash and the sibling path of the message in the tx subtree.
27
23
  const txMessages = messagesForAllTxs[txIndex];
28
- const txOutHashTree = await createOutHashTree(txMessages);
24
+ const txOutHashTree = UnbalancedMerkleTreeCalculator.create(txMessages.map((msg)=>msg.toBuffer()));
29
25
  const txOutHash = txOutHashTree.getRoot();
30
- const messagePathInSubtree = await txOutHashTree.getSiblingPath(message);
26
+ const messagePathInSubtree = txOutHashTree.getSiblingPath(message.toBuffer());
31
27
  // Calculate txOutHash for all txs.
32
28
  const txSubtreeRoots = messagesForAllTxs.map((messages, i)=>{
33
29
  // For a tx with no messages, we have to set an out hash of 0 to match what the circuit does.
@@ -41,19 +37,21 @@ export async function computeL2ToL1MembershipWitnessFromMessagesForAllTxs(messag
41
37
  return Fr.fromBuffer(root);
42
38
  });
43
39
  // Construct the top tree.
44
- // The leaves of this tree are the txOutHashes.
45
- // The root of this tree is the out_hash calculated in the circuit.
46
- const topTree = await createOutHashTree(txSubtreeRoots);
40
+ // The leaves of this tree are the `txOutHashes`.
41
+ // The root of this tree should match the `out_hash` calculated in the circuits. Zero hashes are compressed to reduce
42
+ // cost if the non-zero leaves result in a shorter path.
43
+ const valueToCompress = Buffer.alloc(32);
44
+ const topTree = UnbalancedMerkleTreeCalculator.create(txSubtreeRoots.map((root)=>root.toBuffer()), valueToCompress);
47
45
  const root = Fr.fromBuffer(topTree.getRoot());
48
46
  // Compute the combined sibling path by appending the tx subtree path to the top tree path.
49
- const txPathInTopTree = await topTree.getSiblingPath(txOutHash);
47
+ const txPathInTopTree = topTree.getSiblingPath(txOutHash);
50
48
  const combinedPath = messagePathInSubtree.toBufferArray().concat(txPathInTopTree.toBufferArray());
51
49
  // Compute the combined index.
52
50
  // It is the index of the message in the balanced tree at its current height.
53
- const txLeafPosition = findLeafLevelAndIndex(messagesForAllTxs.length, txIndex);
54
- const messageLeafPosition = findLeafLevelAndIndex(txMessages.length, messageIndexInTx);
55
- const numLeavesInLeftSubtrees = txLeafPosition.indexAtLevel * (1 << messageLeafPosition.level);
56
- const combinedIndex = numLeavesInLeftSubtrees + messageLeafPosition.indexAtLevel;
51
+ const txLeafIndexAtLevel = topTree.getLeafLocation(txIndex).index;
52
+ const messageLeafPosition = txOutHashTree.getLeafLocation(messageIndexInTx);
53
+ const numLeavesInLeftSubtrees = txLeafIndexAtLevel * (1 << messageLeafPosition.level);
54
+ const combinedIndex = numLeavesInLeftSubtrees + messageLeafPosition.index;
57
55
  return {
58
56
  root,
59
57
  leafIndex: BigInt(combinedIndex),
@@ -1,4 +1,4 @@
1
- import { BlobAccumulatorPublicInputs, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
1
+ import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
2
2
  import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
3
3
  import { EthAddress } from '@aztec/foundation/eth-address';
4
4
  import { Fr } from '@aztec/foundation/fields';
@@ -33,11 +33,11 @@ export declare class CheckpointRollupPublicInputs {
33
33
  /**
34
34
  * Accumulated opening proofs for all blobs before this checkpoint range.
35
35
  */
36
- startBlobAccumulator: BlobAccumulatorPublicInputs;
36
+ startBlobAccumulator: BlobAccumulator;
37
37
  /**
38
38
  * Accumulated opening proofs for all blobs after applying this checkpoint range.
39
39
  */
40
- endBlobAccumulator: BlobAccumulatorPublicInputs;
40
+ endBlobAccumulator: BlobAccumulator;
41
41
  /**
42
42
  * Final values z and gamma, shared across the epoch.
43
43
  */
@@ -66,11 +66,11 @@ export declare class CheckpointRollupPublicInputs {
66
66
  /**
67
67
  * Accumulated opening proofs for all blobs before this checkpoint range.
68
68
  */
69
- startBlobAccumulator: BlobAccumulatorPublicInputs,
69
+ startBlobAccumulator: BlobAccumulator,
70
70
  /**
71
71
  * Accumulated opening proofs for all blobs after applying this checkpoint range.
72
72
  */
73
- endBlobAccumulator: BlobAccumulatorPublicInputs,
73
+ endBlobAccumulator: BlobAccumulator,
74
74
  /**
75
75
  * Final values z and gamma, shared across the epoch.
76
76
  */
@@ -1 +1 @@
1
- {"version":3,"file":"checkpoint_rollup_public_inputs.d.ts","sourceRoot":"","sources":["../../src/rollup/checkpoint_rollup_public_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAwC,MAAM,6BAA6B,CAAC;AAE7G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D;;GAEG;AACH,qBAAa,4BAA4B;IAErC;;OAEG;IACI,SAAS,EAAE,iBAAiB;IACnC;;OAEG;IACI,eAAe,EAAE,sBAAsB;IAC9C;;OAEG;IACI,UAAU,EAAE,sBAAsB;IACzC;;OAEG;IACI,sBAAsB,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,wBAAwB,CAAC;IACzE;;OAEG;IACI,IAAI,EAAE,KAAK,CAAC,YAAY,EAAE,OAAO,wBAAwB,CAAC;IACjE;;OAEG;IACI,oBAAoB,EAAE,2BAA2B;IACxD;;OAEG;IACI,kBAAkB,EAAE,2BAA2B;IACtD;;OAEG;IACI,mBAAmB,EAAE,2BAA2B;;IA/BvD;;OAEG;IACI,SAAS,EAAE,iBAAiB;IACnC;;OAEG;IACI,eAAe,EAAE,sBAAsB;IAC9C;;OAEG;IACI,UAAU,EAAE,sBAAsB;IACzC;;OAEG;IACI,sBAAsB,EAAE,KAA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EAAE;gBADT,SAAS,EAAE,UAAU,EACrB,KAAK,EAAE,EAAE;IAGlB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,YAAY;IAK9D,QAAQ;IAIR,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC;IAI/C,QAAQ;IAIR,OAAO;IAIP,cAAc;;;;;;;IAOd,MAAM,CAAC,MAAM;CAGd"}
@@ -1,4 +1,4 @@
1
- import { BlobAccumulatorPublicInputs, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
1
+ import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
2
2
  import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
3
3
  import { EthAddress } from '@aztec/foundation/eth-address';
4
4
  import { Fr } from '@aztec/foundation/fields';
@@ -46,7 +46,7 @@ import { EpochConstantData } from './epoch_constant_data.js';
46
46
  }
47
47
  static fromBuffer(buffer) {
48
48
  const reader = BufferReader.asReader(buffer);
49
- return new CheckpointRollupPublicInputs(reader.readObject(EpochConstantData), reader.readObject(AppendOnlyTreeSnapshot), reader.readObject(AppendOnlyTreeSnapshot), reader.readArray(AZTEC_MAX_EPOCH_DURATION, Fr), reader.readArray(AZTEC_MAX_EPOCH_DURATION, FeeRecipient), reader.readObject(BlobAccumulatorPublicInputs), reader.readObject(BlobAccumulatorPublicInputs), reader.readObject(FinalBlobBatchingChallenges));
49
+ return new CheckpointRollupPublicInputs(reader.readObject(EpochConstantData), reader.readObject(AppendOnlyTreeSnapshot), reader.readObject(AppendOnlyTreeSnapshot), reader.readArray(AZTEC_MAX_EPOCH_DURATION, Fr), reader.readArray(AZTEC_MAX_EPOCH_DURATION, FeeRecipient), reader.readObject(BlobAccumulator), reader.readObject(BlobAccumulator), reader.readObject(FinalBlobBatchingChallenges));
50
50
  }
51
51
  toBuffer() {
52
52
  return serializeToBuffer(this.constants, this.previousArchive, this.newArchive, this.checkpointHeaderHashes, this.fees, this.startBlobAccumulator, this.endBlobAccumulator, this.finalBlobChallenges);
@@ -1,4 +1,4 @@
1
- import { BlobAccumulatorPublicInputs, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
1
+ import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
2
2
  import { ARCHIVE_HEIGHT, BLOBS_PER_BLOCK } from '@aztec/constants';
3
3
  import { BLS12Point, Fr } from '@aztec/foundation/fields';
4
4
  import { BufferReader, type Tuple } from '@aztec/foundation/serialize';
@@ -18,7 +18,7 @@ export declare class CheckpointRootRollupHints {
18
18
  /**
19
19
  * The current blob accumulation state across the epoch.
20
20
  */
21
- startBlobAccumulator: BlobAccumulatorPublicInputs;
21
+ startBlobAccumulator: BlobAccumulator;
22
22
  /**
23
23
  * Finalized challenges z and gamma for performing blob batching. Shared value across the epoch.
24
24
  */
@@ -50,7 +50,7 @@ export declare class CheckpointRootRollupHints {
50
50
  /**
51
51
  * The current blob accumulation state across the epoch.
52
52
  */
53
- startBlobAccumulator: BlobAccumulatorPublicInputs,
53
+ startBlobAccumulator: BlobAccumulator,
54
54
  /**
55
55
  * Finalized challenges z and gamma for performing blob batching. Shared value across the epoch.
56
56
  */
@@ -71,7 +71,7 @@ export declare class CheckpointRootRollupHints {
71
71
  */
72
72
  blobsHash: Fr);
73
73
  static from(fields: FieldsOf<CheckpointRootRollupHints>): CheckpointRootRollupHints;
74
- static getFields(fields: FieldsOf<CheckpointRootRollupHints>): readonly [BlockHeader, [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr], BlobAccumulatorPublicInputs, FinalBlobBatchingChallenges, Fr[], [BLS12Point, BLS12Point, BLS12Point], Fr];
74
+ static getFields(fields: FieldsOf<CheckpointRootRollupHints>): readonly [BlockHeader, [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr], BlobAccumulator, FinalBlobBatchingChallenges, Fr[], [BLS12Point, BLS12Point, BLS12Point], Fr];
75
75
  toBuffer(): Buffer<ArrayBufferLike>;
76
76
  static fromBuffer(buffer: Buffer | BufferReader): CheckpointRootRollupHints;
77
77
  toString(): `0x${string}`;
@@ -1 +1 @@
1
- {"version":3,"file":"checkpoint_root_rollup_private_inputs.d.ts","sourceRoot":"","sources":["../../src/rollup/checkpoint_root_rollup_private_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,eAAe,EAAmB,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAqB,MAAM,6BAA6B,CAAC;AAE1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAa,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,qBAAa,yBAAyB;IAElC;;OAEG;IACI,mBAAmB,EAAE,WAAW;IACvC;;OAEG;IACI,0BAA0B,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,cAAc,CAAC;IACnE;;OAEG;IACI,oBAAoB,EAAE,2BAA2B;IACxD;;OAEG;IACI,mBAAmB,EAAE,2BAA2B;IACvD;;;;OAIG;IACI,UAAU,EAAE,EAAE,EAAE;IACvB;;OAEG;IACI,eAAe,EAAE,KAAK,CAAC,UAAU,EAAE,OAAO,eAAe,CAAC;IACjE;;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,EAAE;IAIzB,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM;IAI9B,MAAM;IAIN,MAAM,KAAK,MAAM,6EAEhB;CACF"}
@@ -1,4 +1,4 @@
1
- import { BlobAccumulatorPublicInputs, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
1
+ import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
2
2
  import { ARCHIVE_HEIGHT, BLOBS_PER_BLOCK, FIELDS_PER_BLOB } from '@aztec/constants';
3
3
  import { BLS12Point, Fr } from '@aztec/foundation/fields';
4
4
  import { bufferSchemaFor } from '@aztec/foundation/schemas';
@@ -60,7 +60,7 @@ export class CheckpointRootRollupHints {
60
60
  }
61
61
  static fromBuffer(buffer) {
62
62
  const reader = BufferReader.asReader(buffer);
63
- return new CheckpointRootRollupHints(BlockHeader.fromBuffer(reader), reader.readArray(ARCHIVE_HEIGHT, Fr), reader.readObject(BlobAccumulatorPublicInputs), reader.readObject(FinalBlobBatchingChallenges), // Below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)'
63
+ return new CheckpointRootRollupHints(BlockHeader.fromBuffer(reader), reader.readArray(ARCHIVE_HEIGHT, Fr), reader.readObject(BlobAccumulator), reader.readObject(FinalBlobBatchingChallenges), // Below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)'
64
64
  // reader.readArray(FIELDS_PER_BLOB, Fr),
65
65
  Array.from({
66
66
  length: FIELDS_PER_BLOB * BLOBS_PER_BLOCK
@@ -1,4 +1,4 @@
1
- import { FinalBlobAccumulatorPublicInputs } from '@aztec/blob-lib';
1
+ import { FinalBlobAccumulator } from '@aztec/blob-lib';
2
2
  import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
3
3
  import { Fr } from '@aztec/foundation/fields';
4
4
  import { BufferReader, type Tuple } from '@aztec/foundation/serialize';
@@ -18,13 +18,13 @@ export declare class RootRollupPublicInputs {
18
18
  checkpointHeaderHashes: Tuple<Fr, typeof AZTEC_MAX_EPOCH_DURATION>;
19
19
  fees: Tuple<FeeRecipient, typeof AZTEC_MAX_EPOCH_DURATION>;
20
20
  constants: EpochConstantData;
21
- blobPublicInputs: FinalBlobAccumulatorPublicInputs;
21
+ blobPublicInputs: FinalBlobAccumulator;
22
22
  constructor(
23
23
  /** Root of the archive tree before this rollup is processed */
24
24
  previousArchiveRoot: Fr,
25
25
  /** Root of the archive tree after this rollup is processed */
26
- endArchiveRoot: Fr, checkpointHeaderHashes: Tuple<Fr, typeof AZTEC_MAX_EPOCH_DURATION>, fees: Tuple<FeeRecipient, typeof AZTEC_MAX_EPOCH_DURATION>, constants: EpochConstantData, blobPublicInputs: FinalBlobAccumulatorPublicInputs);
27
- static getFields(fields: FieldsOf<RootRollupPublicInputs>): readonly [Fr, Fr, [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr], [FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient], EpochConstantData, FinalBlobAccumulatorPublicInputs];
26
+ endArchiveRoot: Fr, checkpointHeaderHashes: Tuple<Fr, typeof AZTEC_MAX_EPOCH_DURATION>, fees: Tuple<FeeRecipient, typeof AZTEC_MAX_EPOCH_DURATION>, constants: EpochConstantData, blobPublicInputs: FinalBlobAccumulator);
27
+ static getFields(fields: FieldsOf<RootRollupPublicInputs>): readonly [Fr, Fr, [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr], [FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient, FeeRecipient], EpochConstantData, FinalBlobAccumulator];
28
28
  toBuffer(): Buffer<ArrayBufferLike>;
29
29
  toFields(): Fr[];
30
30
  static from(fields: FieldsOf<RootRollupPublicInputs>): RootRollupPublicInputs;
@@ -1 +1 @@
1
- {"version":3,"file":"root_rollup_public_inputs.d.ts","sourceRoot":"","sources":["../../src/rollup/root_rollup_public_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kB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AWzD,QAAQ;IAIR,QAAQ,IAAI,EAAE,EAAE;IAIhB,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,sBAAsB,CAAC,GAAG,sBAAsB;IAI7E;;;;OAIG;WACW,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,sBAAsB;IAY/E,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,uDAAuD;IACvD,MAAM;IAIN,yCAAyC;IACzC,MAAM,KAAK,MAAM,+DAEhB;IAED,gFAAgF;IAChF,MAAM,CAAC,MAAM;CAUd"}
@@ -1,4 +1,4 @@
1
- import { FinalBlobAccumulatorPublicInputs } from '@aztec/blob-lib';
1
+ import { FinalBlobAccumulator } from '@aztec/blob-lib';
2
2
  import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
3
3
  import { makeTuple } from '@aztec/foundation/array';
4
4
  import { Fr } from '@aztec/foundation/fields';
@@ -51,7 +51,7 @@ import { EpochConstantData } from './epoch_constant_data.js';
51
51
  * @returns The deserialized `RootRollupPublicInputs` object.
52
52
  */ static fromBuffer(buffer) {
53
53
  const reader = BufferReader.asReader(buffer);
54
- return new RootRollupPublicInputs(Fr.fromBuffer(reader), Fr.fromBuffer(reader), reader.readArray(AZTEC_MAX_EPOCH_DURATION, Fr), reader.readArray(AZTEC_MAX_EPOCH_DURATION, FeeRecipient), EpochConstantData.fromBuffer(reader), reader.readObject(FinalBlobAccumulatorPublicInputs));
54
+ return new RootRollupPublicInputs(Fr.fromBuffer(reader), Fr.fromBuffer(reader), reader.readArray(AZTEC_MAX_EPOCH_DURATION, Fr), reader.readArray(AZTEC_MAX_EPOCH_DURATION, FeeRecipient), EpochConstantData.fromBuffer(reader), reader.readObject(FinalBlobAccumulator));
55
55
  }
56
56
  toString() {
57
57
  return bufferToHex(this.toBuffer());
@@ -66,6 +66,6 @@ import { EpochConstantData } from './epoch_constant_data.js';
66
66
  return bufferSchemaFor(RootRollupPublicInputs);
67
67
  }
68
68
  /** Creates a random instance. Used for testing only - will not prove/verify. */ static random() {
69
- return new RootRollupPublicInputs(Fr.random(), Fr.random(), makeTuple(AZTEC_MAX_EPOCH_DURATION, Fr.random), makeTuple(AZTEC_MAX_EPOCH_DURATION, FeeRecipient.random), new EpochConstantData(Fr.random(), Fr.random(), Fr.random(), Fr.random(), Fr.random()), FinalBlobAccumulatorPublicInputs.random());
69
+ return new RootRollupPublicInputs(Fr.random(), Fr.random(), makeTuple(AZTEC_MAX_EPOCH_DURATION, Fr.random), makeTuple(AZTEC_MAX_EPOCH_DURATION, FeeRecipient.random), new EpochConstantData(Fr.random(), Fr.random(), Fr.random(), Fr.random(), Fr.random()), FinalBlobAccumulator.random());
70
70
  }
71
71
  }
@@ -1,4 +1,4 @@
1
- import { BlobAccumulatorPublicInputs, FinalBlobAccumulatorPublicInputs } from '@aztec/blob-lib';
1
+ import { BlobAccumulator, FinalBlobAccumulator } from '@aztec/blob-lib';
2
2
  import { makeBatchedBlobAccumulator, makeSpongeBlob } from '@aztec/blob-lib/testing';
3
3
  import { ARCHIVE_HEIGHT, AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, AZTEC_MAX_EPOCH_DURATION, CIVC_PROOF_LENGTH, CONTRACT_CLASS_LOG_SIZE_IN_FIELDS, FIXED_DA_GAS, FIXED_L2_GAS, GeneratorIndex, L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, MAX_CONTRACT_CLASS_LOGS_PER_TX, MAX_ENQUEUED_CALLS_PER_CALL, MAX_ENQUEUED_CALLS_PER_TX, MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_CALL, MAX_NOTE_HASHES_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL, MAX_NULLIFIERS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PRIVATE_LOGS_PER_CALL, MAX_PRIVATE_LOGS_PER_TX, MAX_PROTOCOL_CONTRACTS, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH, NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH, NULLIFIER_TREE_HEIGHT, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, NUM_BASE_PARITY_PER_ROOT_PARITY, NUM_MSGS_PER_BASE_PARITY, PRIVATE_LOG_SIZE_IN_FIELDS, PUBLIC_DATA_TREE_HEIGHT, RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, VK_TREE_HEIGHT } from '@aztec/constants';
4
4
  import { makeHalfFullTuple, makeTuple } from '@aztec/foundation/array';
@@ -428,7 +428,7 @@ function makeEpochConstantData(seed = 1) {
428
428
  }
429
429
  export function makeCheckpointRollupPublicInputs(seed = 0) {
430
430
  const startBlobAccumulator = makeBatchedBlobAccumulator(seed);
431
- return new CheckpointRollupPublicInputs(makeEpochConstantData(seed), makeAppendOnlyTreeSnapshot(seed + 0x100), makeAppendOnlyTreeSnapshot(seed + 0x200), makeTuple(AZTEC_MAX_EPOCH_DURATION, ()=>fr(seed), 0x300), makeTuple(AZTEC_MAX_EPOCH_DURATION, ()=>makeFeeRecipient(seed), 0x700), BlobAccumulatorPublicInputs.fromBatchedBlobAccumulator(startBlobAccumulator), BlobAccumulatorPublicInputs.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed + 1)), startBlobAccumulator.finalBlobChallenges);
431
+ return new CheckpointRollupPublicInputs(makeEpochConstantData(seed), makeAppendOnlyTreeSnapshot(seed + 0x100), makeAppendOnlyTreeSnapshot(seed + 0x200), makeTuple(AZTEC_MAX_EPOCH_DURATION, ()=>fr(seed), 0x300), makeTuple(AZTEC_MAX_EPOCH_DURATION, ()=>makeFeeRecipient(seed), 0x700), BlobAccumulator.fromBatchedBlobAccumulator(startBlobAccumulator), BlobAccumulator.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed + 1)), startBlobAccumulator.finalBlobChallenges);
432
432
  }
433
433
  export function makeParityPublicInputs(seed = 0) {
434
434
  return new ParityPublicInputs(new Fr(BigInt(seed + 0x200)), new Fr(BigInt(seed + 0x300)), new Fr(BigInt(seed + 0x400)));
@@ -445,7 +445,7 @@ export function makeParityRootPrivateInputs(seed = 0) {
445
445
  * @param blockNumber - The block number to use in the global variables of a header.
446
446
  * @returns A root rollup public inputs.
447
447
  */ export function makeRootRollupPublicInputs(seed = 0) {
448
- return new RootRollupPublicInputs(fr(seed + 0x100), fr(seed + 0x200), makeTuple(AZTEC_MAX_EPOCH_DURATION, ()=>fr(seed), 0x300), makeTuple(AZTEC_MAX_EPOCH_DURATION, ()=>makeFeeRecipient(seed), 0x500), makeEpochConstantData(seed + 0x600), FinalBlobAccumulatorPublicInputs.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed)));
448
+ return new RootRollupPublicInputs(fr(seed + 0x100), fr(seed + 0x200), makeTuple(AZTEC_MAX_EPOCH_DURATION, ()=>fr(seed), 0x300), makeTuple(AZTEC_MAX_EPOCH_DURATION, ()=>makeFeeRecipient(seed), 0x500), makeEpochConstantData(seed + 0x600), FinalBlobAccumulator.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed)));
449
449
  }
450
450
  /**
451
451
  * Makes content commitment
@@ -4,13 +4,13 @@ import { TxEffect } from './tx_effect.js';
4
4
  export type IndexedTxEffect = InBlock<TxEffect> & {
5
5
  txIndexInBlock: number;
6
6
  };
7
- export declare function indexedTxSchema(): import("zod").ZodObject<import("zod").objectUtil.extendShape<{
7
+ export declare function indexedTxSchema(): import("zod").ZodObject<{
8
8
  data: import("@aztec/foundation/schemas").ZodFor<TxEffect>;
9
9
  l2BlockNumber: import("zod").ZodPipeline<import("zod").ZodUnion<[import("zod").ZodBigInt, import("zod").ZodNumber, import("zod").ZodString]>, import("zod").ZodNumber>;
10
10
  l2BlockHash: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>, Buffer<ArrayBuffer>, string>, L2BlockHash, string>;
11
- }, {
11
+ } & {
12
12
  txIndexInBlock: import("zod").ZodPipeline<import("zod").ZodUnion<[import("zod").ZodBigInt, import("zod").ZodNumber, import("zod").ZodString]>, import("zod").ZodNumber>;
13
- }>, "strip", import("zod").ZodTypeAny, {
13
+ }, "strip", import("zod").ZodTypeAny, {
14
14
  data: TxEffect;
15
15
  l2BlockNumber: number;
16
16
  l2BlockHash: L2BlockHash;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/stdlib",
3
- "version": "3.0.0-nightly.20251001",
3
+ "version": "3.0.0-nightly.20251003",
4
4
  "type": "module",
5
5
  "inherits": [
6
6
  "../package.common.json",
@@ -70,13 +70,13 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@aws-sdk/client-s3": "^3.892.0",
73
- "@aztec/bb.js": "3.0.0-nightly.20251001",
74
- "@aztec/blob-lib": "3.0.0-nightly.20251001",
75
- "@aztec/constants": "3.0.0-nightly.20251001",
76
- "@aztec/ethereum": "3.0.0-nightly.20251001",
77
- "@aztec/foundation": "3.0.0-nightly.20251001",
78
- "@aztec/l1-artifacts": "3.0.0-nightly.20251001",
79
- "@aztec/noir-noirc_abi": "3.0.0-nightly.20251001",
73
+ "@aztec/bb.js": "3.0.0-nightly.20251003",
74
+ "@aztec/blob-lib": "3.0.0-nightly.20251003",
75
+ "@aztec/constants": "3.0.0-nightly.20251003",
76
+ "@aztec/ethereum": "3.0.0-nightly.20251003",
77
+ "@aztec/foundation": "3.0.0-nightly.20251003",
78
+ "@aztec/l1-artifacts": "3.0.0-nightly.20251003",
79
+ "@aztec/noir-noirc_abi": "3.0.0-nightly.20251003",
80
80
  "@google-cloud/storage": "^7.15.0",
81
81
  "axios": "^1.9.0",
82
82
  "json-stringify-deterministic": "1.0.12",
package/src/hash/hash.ts CHANGED
@@ -109,10 +109,6 @@ export function computeVarArgsHash(args: Fr[]): Promise<Fr> {
109
109
  * @returns Hash of the calldata.
110
110
  */
111
111
  export function computeCalldataHash(calldata: Fr[]): Promise<Fr> {
112
- if (calldata.length === 0) {
113
- return Promise.resolve(Fr.ZERO);
114
- }
115
-
116
112
  return poseidon2HashWithSeparator(calldata, GeneratorIndex.PUBLIC_CALLDATA);
117
113
  }
118
114
 
@@ -1,18 +1,5 @@
1
1
  import { Fr } from '@aztec/foundation/fields';
2
- import {
3
- SiblingPath,
4
- UnbalancedMerkleTreeCalculator,
5
- computeUnbalancedMerkleTreeRoot,
6
- findLeafLevelAndIndex,
7
- getMaxUnbalancedTreeDepth,
8
- } from '@aztec/foundation/trees';
9
-
10
- async function createOutHashTree(messages: Fr[]) {
11
- const messageSubtreeHeight = getMaxUnbalancedTreeDepth(messages.length);
12
- const calculator = UnbalancedMerkleTreeCalculator.create(messageSubtreeHeight);
13
- await calculator.appendLeaves(messages.map(msg => msg.toBuffer()));
14
- return calculator;
15
- }
2
+ import { SiblingPath, UnbalancedMerkleTreeCalculator, computeUnbalancedMerkleTreeRoot } from '@aztec/foundation/trees';
16
3
 
17
4
  export interface MessageRetrieval {
18
5
  getL2ToL1Messages(l2BlockNumber: number): Promise<Fr[][] | undefined>;
@@ -37,10 +24,12 @@ export async function computeL2ToL1MembershipWitness(
37
24
  return computeL2ToL1MembershipWitnessFromMessagesForAllTxs(messagesForAllTxs, message);
38
25
  }
39
26
 
40
- export async function computeL2ToL1MembershipWitnessFromMessagesForAllTxs(
27
+ // TODO: Allow to specify the message to consume by its index or by an offset, in case there are multiple messages with
28
+ // the same value.
29
+ export function computeL2ToL1MembershipWitnessFromMessagesForAllTxs(
41
30
  messagesForAllTxs: Fr[][],
42
31
  message: Fr,
43
- ): Promise<L2ToL1MembershipWitness> {
32
+ ): L2ToL1MembershipWitness {
44
33
  // Find index of message in subtree and index of tx in a block.
45
34
  let messageIndexInTx = -1;
46
35
  const txIndex = messagesForAllTxs.findIndex(messages => {
@@ -54,9 +43,9 @@ export async function computeL2ToL1MembershipWitnessFromMessagesForAllTxs(
54
43
 
55
44
  // Get the txOutHash and the sibling path of the message in the tx subtree.
56
45
  const txMessages = messagesForAllTxs[txIndex];
57
- const txOutHashTree = await createOutHashTree(txMessages);
46
+ const txOutHashTree = UnbalancedMerkleTreeCalculator.create(txMessages.map(msg => msg.toBuffer()));
58
47
  const txOutHash = txOutHashTree.getRoot();
59
- const messagePathInSubtree = await txOutHashTree.getSiblingPath(message);
48
+ const messagePathInSubtree = txOutHashTree.getSiblingPath(message.toBuffer());
60
49
 
61
50
  // Calculate txOutHash for all txs.
62
51
  const txSubtreeRoots = messagesForAllTxs.map((messages, i) => {
@@ -74,21 +63,26 @@ export async function computeL2ToL1MembershipWitnessFromMessagesForAllTxs(
74
63
  });
75
64
 
76
65
  // Construct the top tree.
77
- // The leaves of this tree are the txOutHashes.
78
- // The root of this tree is the out_hash calculated in the circuit.
79
- const topTree = await createOutHashTree(txSubtreeRoots);
66
+ // The leaves of this tree are the `txOutHashes`.
67
+ // The root of this tree should match the `out_hash` calculated in the circuits. Zero hashes are compressed to reduce
68
+ // cost if the non-zero leaves result in a shorter path.
69
+ const valueToCompress = Buffer.alloc(32);
70
+ const topTree = UnbalancedMerkleTreeCalculator.create(
71
+ txSubtreeRoots.map(root => root.toBuffer()),
72
+ valueToCompress,
73
+ );
80
74
  const root = Fr.fromBuffer(topTree.getRoot());
81
75
 
82
76
  // Compute the combined sibling path by appending the tx subtree path to the top tree path.
83
- const txPathInTopTree = await topTree.getSiblingPath(txOutHash);
77
+ const txPathInTopTree = topTree.getSiblingPath(txOutHash);
84
78
  const combinedPath = messagePathInSubtree.toBufferArray().concat(txPathInTopTree.toBufferArray());
85
79
 
86
80
  // Compute the combined index.
87
81
  // It is the index of the message in the balanced tree at its current height.
88
- const txLeafPosition = findLeafLevelAndIndex(messagesForAllTxs.length, txIndex);
89
- const messageLeafPosition = findLeafLevelAndIndex(txMessages.length, messageIndexInTx);
90
- const numLeavesInLeftSubtrees = txLeafPosition.indexAtLevel * (1 << messageLeafPosition.level);
91
- const combinedIndex = numLeavesInLeftSubtrees + messageLeafPosition.indexAtLevel;
82
+ const txLeafIndexAtLevel = topTree.getLeafLocation(txIndex).index;
83
+ const messageLeafPosition = txOutHashTree.getLeafLocation(messageIndexInTx);
84
+ const numLeavesInLeftSubtrees = txLeafIndexAtLevel * (1 << messageLeafPosition.level);
85
+ const combinedIndex = numLeavesInLeftSubtrees + messageLeafPosition.index;
92
86
 
93
87
  return {
94
88
  root,
@@ -1,4 +1,4 @@
1
- import { BlobAccumulatorPublicInputs, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
1
+ import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
2
2
  import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
3
3
  import { EthAddress } from '@aztec/foundation/eth-address';
4
4
  import { Fr } from '@aztec/foundation/fields';
@@ -38,11 +38,11 @@ export class CheckpointRollupPublicInputs {
38
38
  /**
39
39
  * Accumulated opening proofs for all blobs before this checkpoint range.
40
40
  */
41
- public startBlobAccumulator: BlobAccumulatorPublicInputs,
41
+ public startBlobAccumulator: BlobAccumulator,
42
42
  /**
43
43
  * Accumulated opening proofs for all blobs after applying this checkpoint range.
44
44
  */
45
- public endBlobAccumulator: BlobAccumulatorPublicInputs,
45
+ public endBlobAccumulator: BlobAccumulator,
46
46
  /**
47
47
  * Final values z and gamma, shared across the epoch.
48
48
  */
@@ -57,8 +57,8 @@ export class CheckpointRollupPublicInputs {
57
57
  reader.readObject(AppendOnlyTreeSnapshot),
58
58
  reader.readArray(AZTEC_MAX_EPOCH_DURATION, Fr),
59
59
  reader.readArray(AZTEC_MAX_EPOCH_DURATION, FeeRecipient),
60
- reader.readObject(BlobAccumulatorPublicInputs),
61
- reader.readObject(BlobAccumulatorPublicInputs),
60
+ reader.readObject(BlobAccumulator),
61
+ reader.readObject(BlobAccumulator),
62
62
  reader.readObject(FinalBlobBatchingChallenges),
63
63
  );
64
64
  }
@@ -1,4 +1,4 @@
1
- import { BlobAccumulatorPublicInputs, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
1
+ import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
2
2
  import { ARCHIVE_HEIGHT, BLOBS_PER_BLOCK, FIELDS_PER_BLOB } from '@aztec/constants';
3
3
  import { BLS12Point, Fr } from '@aztec/foundation/fields';
4
4
  import { bufferSchemaFor } from '@aztec/foundation/schemas';
@@ -23,7 +23,7 @@ export class CheckpointRootRollupHints {
23
23
  /**
24
24
  * The current blob accumulation state across the epoch.
25
25
  */
26
- public startBlobAccumulator: BlobAccumulatorPublicInputs,
26
+ public startBlobAccumulator: BlobAccumulator,
27
27
  /**
28
28
  * Finalized challenges z and gamma for performing blob batching. Shared value across the epoch.
29
29
  */
@@ -70,7 +70,7 @@ export class CheckpointRootRollupHints {
70
70
  return new CheckpointRootRollupHints(
71
71
  BlockHeader.fromBuffer(reader),
72
72
  reader.readArray(ARCHIVE_HEIGHT, Fr),
73
- reader.readObject(BlobAccumulatorPublicInputs),
73
+ reader.readObject(BlobAccumulator),
74
74
  reader.readObject(FinalBlobBatchingChallenges),
75
75
  // Below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)'
76
76
  // reader.readArray(FIELDS_PER_BLOB, Fr),
@@ -1,4 +1,4 @@
1
- import { FinalBlobAccumulatorPublicInputs } from '@aztec/blob-lib';
1
+ import { FinalBlobAccumulator } from '@aztec/blob-lib';
2
2
  import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
3
3
  import { makeTuple } from '@aztec/foundation/array';
4
4
  import { Fr } from '@aztec/foundation/fields';
@@ -24,7 +24,7 @@ export class RootRollupPublicInputs {
24
24
  public checkpointHeaderHashes: Tuple<Fr, typeof AZTEC_MAX_EPOCH_DURATION>,
25
25
  public fees: Tuple<FeeRecipient, typeof AZTEC_MAX_EPOCH_DURATION>,
26
26
  public constants: EpochConstantData,
27
- public blobPublicInputs: FinalBlobAccumulatorPublicInputs,
27
+ public blobPublicInputs: FinalBlobAccumulator,
28
28
  ) {}
29
29
 
30
30
  static getFields(fields: FieldsOf<RootRollupPublicInputs>) {
@@ -63,7 +63,7 @@ export class RootRollupPublicInputs {
63
63
  reader.readArray(AZTEC_MAX_EPOCH_DURATION, Fr),
64
64
  reader.readArray(AZTEC_MAX_EPOCH_DURATION, FeeRecipient),
65
65
  EpochConstantData.fromBuffer(reader),
66
- reader.readObject(FinalBlobAccumulatorPublicInputs),
66
+ reader.readObject(FinalBlobAccumulator),
67
67
  );
68
68
  }
69
69
 
@@ -93,7 +93,7 @@ export class RootRollupPublicInputs {
93
93
  makeTuple(AZTEC_MAX_EPOCH_DURATION, Fr.random),
94
94
  makeTuple(AZTEC_MAX_EPOCH_DURATION, FeeRecipient.random),
95
95
  new EpochConstantData(Fr.random(), Fr.random(), Fr.random(), Fr.random(), Fr.random()),
96
- FinalBlobAccumulatorPublicInputs.random(),
96
+ FinalBlobAccumulator.random(),
97
97
  );
98
98
  }
99
99
  }
@@ -1,4 +1,4 @@
1
- import { BlobAccumulatorPublicInputs, FinalBlobAccumulatorPublicInputs } from '@aztec/blob-lib';
1
+ import { BlobAccumulator, FinalBlobAccumulator } from '@aztec/blob-lib';
2
2
  import { makeBatchedBlobAccumulator, makeSpongeBlob } from '@aztec/blob-lib/testing';
3
3
  import {
4
4
  ARCHIVE_HEIGHT,
@@ -753,8 +753,8 @@ export function makeCheckpointRollupPublicInputs(seed = 0) {
753
753
  makeAppendOnlyTreeSnapshot(seed + 0x200),
754
754
  makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x300),
755
755
  makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x700),
756
- BlobAccumulatorPublicInputs.fromBatchedBlobAccumulator(startBlobAccumulator),
757
- BlobAccumulatorPublicInputs.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed + 1)),
756
+ BlobAccumulator.fromBatchedBlobAccumulator(startBlobAccumulator),
757
+ BlobAccumulator.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed + 1)),
758
758
  startBlobAccumulator.finalBlobChallenges,
759
759
  );
760
760
  }
@@ -790,7 +790,7 @@ export function makeRootRollupPublicInputs(seed = 0): RootRollupPublicInputs {
790
790
  makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x300),
791
791
  makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x500),
792
792
  makeEpochConstantData(seed + 0x600),
793
- FinalBlobAccumulatorPublicInputs.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed)),
793
+ FinalBlobAccumulator.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed)),
794
794
  );
795
795
  }
796
796