Problem Statement
There has been this lingering TODO in the code for a while now:
|
// TODO: Allow to specify the message to consume by its index or by an offset, in case there are multiple messages with |
|
// the same value. |
|
export function computeL2ToL1MembershipWitnessFromMessagesInEpoch( |
With the v4 update, L2 -> L1 messages rollup has been changed from block level to epoch level, which further exacerbated this problem - it's much more likely to have duplicate L2 -> L1 messages in an epoch than in a block. As is, there doesn't seem to be a way to compute a message witness for any duplicate messages except the first one.
Proposed Solution
Implement a more intuitive and uniquely identifying computeL2ToL1MembershipWitness signature, such as
export type L2ToL1MembershipWitness = {
epoch: EpochNumber; // Include this in output as opposed to input
root: Fr;
leafIndex: bigint;
siblingPath: SiblingPath<number>;
};
export async function computeL2ToL1MembershipWitness(
node: AztecNode,
txHash: TxHash,
messageIndexInTx: number,
): Promise<L2ToL1MembershipWitness | undefined>;
which internally figures out the message's full coordinates, i.e. (epoch, checkpointIndex, blockIndex, txIndex, messageIndexInTx).
Example Use Case
No response
Alternative Solutions
No response
Additional Context
No response
Problem Statement
There has been this lingering
TODOin the code for a while now:aztec-packages/yarn-project/stdlib/src/messaging/l2_to_l1_membership.ts
Lines 118 to 120 in e6dc4a6
With the v4 update, L2 -> L1 messages rollup has been changed from block level to epoch level, which further exacerbated this problem - it's much more likely to have duplicate L2 -> L1 messages in an epoch than in a block. As is, there doesn't seem to be a way to compute a message witness for any duplicate messages except the first one.
Proposed Solution
Implement a more intuitive and uniquely identifying
computeL2ToL1MembershipWitnesssignature, such aswhich internally figures out the message's full coordinates, i.e.
(epoch, checkpointIndex, blockIndex, txIndex, messageIndexInTx).Example Use Case
No response
Alternative Solutions
No response
Additional Context
No response