-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: increase max L2 to L1 msgs (#6959)
See [this doc ](https://hackmd.io/@aztec-network/rJIbJVv40) for more info - this PR implements the second solution, using variable height subtrees for L2 to L1 msgs. ### Main changes - The `out_hash` computed in `base` is now the root of a variable height merkle tree. The height is calculated from the number of non-empty messages (this is calculated by moving backwards from the final possible msg, as we currently don't sort L2 to L1 messages in the kernel). The variable trees are not cheaper in the circuit because we cannot branch off hashes we don't need, but the result is smaller trees to deal with in ts/sol. We can also simply move to a full tree which can hold the new maximum. - Because of the variable heights, we cannot supply a `height` to `Outbox.sol`. Instead, I've added a `minHeight` (height in block + 1) and check that we haven't reached the maximum height (`minHeight` + 3*, since I've currently set the max msgs to 8*). -- NB: I don't believe this exposes much risk, because the usual path shortening attack works by a user supplying some intermediate node as a leaf. A user cannot do this here as we must supply a raw message, hash it in the contract, then check membership. AFAIK it would be too difficult to find a message preimage for an intermediate node to pass the `consume` check without a valid message. - We extract the path in `server.ts` by concatenating the variable height subtree path and the path created by the rollup circuits hashing two `out_hash`es. This will *not* work if/when we decide to have 'wonky' rollups (but in this case, a lot of other aspects will also break e.g. `txsEffects`, `inHash`) Note this also fixes the issue with mismatched trees when more than one transaction in a block has fewer than the max messages (see doc for more info).
- Loading branch information
1 parent
5647571
commit 875fb2d
Showing
25 changed files
with
781 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.