Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add L1 -> L2 message tree #348

Closed
3 tasks
Maddiaa0 opened this issue Apr 24, 2023 · 2 comments · Fixed by #385
Closed
3 tasks

Add L1 -> L2 message tree #348

Maddiaa0 opened this issue Apr 24, 2023 · 2 comments · Fixed by #385
Assignees

Comments

@Maddiaa0
Copy link
Member

Add an L1 -> L2 message tree in the circuits for messages that are inserted. Should be implemented as an append only tree.

To be decided when to insert the messages, e.g., could be in root or at merge state depending on the compute bounds we have.

The input messages must be part of the public inputs hash as well.

See https://github.com/orgs/AztecProtocol/projects/22/views/17?filterQuery=+team%3A%22%F0%9F%A7%9A%E2%80%8D%E2%99%80%EF%B8%8F+Fairies%22+&pane=issue&itemId=25342143


Require updates to:

  •  Circuits
  • Contracts
  • Typescript
@LHerskind LHerskind added this to A3 Apr 11, 2023
@Maddiaa0 Maddiaa0 self-assigned this Apr 24, 2023
@Maddiaa0 Maddiaa0 converted this from a draft issue Apr 24, 2023
@Maddiaa0 Maddiaa0 mentioned this issue Apr 26, 2023
6 tasks
@Maddiaa0
Copy link
Member Author

Maddiaa0 commented Apr 27, 2023

Update:
There will be some new fields required inside the root rollup
RootRollupInputs

  • l1_to_l2_messages: array
  • new_l1_to_l2_message_tree_root_sibling_path: MembershipWitness[]
  • new_historic_l1_to_l2_messge_tree_root_sibling_path: MembershipWitness[]

@iAmMichaelConnor
I am also deciding whether to include the following information in the rollup constants or within the root rollup inputs as it will increase proof size for every rollup, but is only required in the root:

  • start_l1_to_l2_message_tree_snapshot: AppendOnlyTreeSnapshot
  • start_historic_tree_l1_to_l2_message_tree_roots_snapshot: AppendOnlyTreeSnapshot

RootRollupPublicInputs

  • start_l1_to_l2_messages_tree_snapshot: AppendOnlyTreeSnapshot
  • end_l1_to_l2_messages_tree_snapshot: AppendOnlyTreeSnapshot
  • start_tree_of_historic_l1_to_l2_messages_roots_snapshot: AppendOnlyTreeSnapshot
  • end_tree_of_historic_l1_to_l2_messages_roots_snapshot: AppendOnlyTreeSnapshot
  • l1_to_l2_messages_hash: array<fr, 2> (will be included in smart contract calculation)

Tasks to cover

  • The root rollup circuit should do a subtree insertion of all of the l1 to l2 messages into the current l1 to l2 messages tree.
  • It should then insert that calculated root into the historic tree
  • Is should calculate the hash of appending all of the messages into one large string, this will ensure correct ordering of insertion into the tree and also enable the smart contract to validate the messages that were included within the rollup.

@iAmMichaelConnor
Copy link
Contributor

iAmMichaelConnor commented Apr 27, 2023

I am also deciding whether to include the following information in the rollup constants or within the root rollup inputs as it will increase proof size for every rollup, but is only required in the root

Just summarising our chat from earlier. We went with putting this information in the root rollup inputs.
I guess (if you tilt your head sideways a bit) 'constants' could be interpreted as "stuff that will be passed through all iterations of the rollup circuits, untouched", and since this information is only being introduced for the final iteration of the rollup circuit, it doesn't quite fit into this definition (because there won't be multiple iterations). This is how I'll sleep easy tonight.

@iAmMichaelConnor iAmMichaelConnor added this to the 📥 L1->L2 Calls milestone May 1, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in A3 May 3, 2023
@LHerskind LHerskind mentioned this issue May 9, 2023
@iAmMichaelConnor iAmMichaelConnor removed this from A3 Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants