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

docs: New CrossChain Message model #4250

Closed
Tracked by #4492
LHerskind opened this issue Jan 28, 2024 · 3 comments · Fixed by #4485
Closed
Tracked by #4492

docs: New CrossChain Message model #4250

LHerskind opened this issue Jan 28, 2024 · 3 comments · Fixed by #4485
Assignees

Comments

@LHerskind
Copy link
Contributor

LHerskind commented Jan 28, 2024

Based on gas computations for the current message model, it was decided that it is too expensive for the improvement in Devex that it brought.

Namely, the fraction of the cost that had to be incurred during the validation phase put a limiter on the size of individual blocks since the cost was dependent on the number of messages.

The new proposal is at a high level, adding more trees, and then only moving a root across as part of the block validation itself. This means that the gas costs incurred in validation is constant. This gives us the benefits of:

  • Removing some constraints on the block sizes
  • Remove a fee market for incoming messages
  • Improving censorship resistance for cross-chain messages
    Those don't come entirely for free though, as:
  • The circuits need to perform additional hashing
  • Consumption of messages (L2 -> L1 messages) need to provide a membership proof. This membership proof require that user is reading events/DA and rebuilds the tree or a frontend does so. This tree have no private information so can be built by anyone.

The benefits outweigh the negatives.

Implementation wise, the inbox becomes a series of frontier-merkle trees (storage-optimized merkle tree). While the outbox is pretty standard merkle inclusion and nullifier tracking.

@LHerskind LHerskind added this to A3 Jan 28, 2024
@LHerskind LHerskind converted this from a draft issue Jan 28, 2024
@LHerskind LHerskind self-assigned this Jan 28, 2024
@iAmMichaelConnor
Copy link
Contributor

It still makes me uneasy (in the new model) that when a user sends an L1->L2 message, they are not paying for the costs associated with inserting that message into the L1->L2 mesage tree on L2. Instead, the transactors in the next rollup block are effectively covering this cost. I don't have a feel for the concrete marginal costs that each additional L1->L2 message imposes on the next sequencer.

It feels like how our generation is paying the pensions of the older generation. And that isn't going well.

@LHerskind
Copy link
Contributor Author

they are not paying for the costs associated with inserting that message into the L1->L2 mesage tree on L2.

The fee market would be such a pain. Especially as the act or paying the fee on L1, would likely be more expensive than the actual fee.

The remedy is worse than the disease.

I don't have a feel for the concrete marginal costs that each additional L1->L2 message imposes on the next sequencer.

From some of the napkin math Joe and I did ~7 sha hashes per base -> 1 second in proving time. And then 1 extra in the merges etc.

@iAmMichaelConnor
Copy link
Contributor

hashes per base

I'd still like to compare two approaches:

  • Doing these l1_to_l2_message leaf insertions in the base rollup circuits; vs
  • Doing these l1_to_l2_message leaf insertions in a standalone circuit which feeds into the root_rollup circuit. It's possible to do this and still make all of the l1_to_l2_messages available to all txs in the block.

I prefer the latter approach. It's a better separation of concerns. The base rollup circuit should only be concerned with logic relating to the one tx being added to the rollup. The number of l1_to_l2_messages is unrelated to the number of txs in a block. So there will either be redundant hashing if # messages < # txs (and I know we'll be parallelising base rollups, but it's still redundant hashing). Or if # messages > # txs, then there won't be enough base rollup instances to insert all messages.

With a standalone circuit, it can specialise in just doing merkle tree insertions. Deciding who generates that proof and who gets paid is an out-of-protocol concern, just like deciding who generates the proof for the root_rollup circuit.

@LHerskind LHerskind changed the title feat!: New CrossChain Message model docs: New CrossChain Message model Feb 7, 2024
LHerskind added a commit that referenced this issue Feb 8, 2024
Fixes #4250 and writes out an initial implementation of a solidity frontier tree.
@github-project-automation github-project-automation bot moved this from Todo to Done in A3 Feb 8, 2024
LHerskind added a commit that referenced this issue Feb 12, 2024
Updates the yellow paper to align with the changes made by #4250 + updates the rollup circuits to align with one kernel per base.
michaelelliot pushed a commit to Swoir/noir_rs that referenced this issue Feb 28, 2024
Fixes AztecProtocol#4250 and writes out an initial implementation of a solidity frontier tree.
michaelelliot pushed a commit to Swoir/noir_rs that referenced this issue Feb 28, 2024
Updates the yellow paper to align with the changes made by AztecProtocol#4250 + updates the rollup circuits to align with one kernel per base.
LHerskind added a commit that referenced this issue Mar 4, 2024
Fixes #4558.

Adds a section to the yellow-paper on message compression circuits for L1 -> L2 message following #4250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants