You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, L2 to L1 messages are hashed into a merkle tree at the tx level, with the root of this tree being the out_hash calculated and output from the base rollup.
From the base upwards, each merge and root circuit accumulates this as out_hash = H(left.out_hash, right.out_hash).
Previously, each transaction was limited to just 2 messages, which meant the tx's out_hash = H(msg_0, msg_1). However, transactions with just 1 message (=> out_hash = H(msg_0, 0)) caused issues as methods in ts to recreate the out_hash were not padding with empty messages. This was fixed in #6959, but introduced a variable size tree for the tx's out_hash. With the possibility of wonky rollups, this tree would be very unbalanced and messy to keep track of.
A solution is to ensure all L2 to L1 messages in a block are formed into a balanced tree. We could:
Keep track of the tree's state in the rollups like note and nullifier trees, using PartialStateReference to accumulate them
Add L2 to L1 messages to the parity circuits
A rollup just provides the final out_hash (the root of the message tree) and the height (currently a height range since the tree has variable height) to the Outbox. Consuming this message requires a valid message preimage and path, which is checked against the stored out_hash using sha256.
The text was updated successfully, but these errors were encountered:
Currently, L2 to L1 messages are hashed into a merkle tree at the tx level, with the root of this tree being the
out_hash
calculated and output from the base rollup.From the base upwards, each merge and root circuit accumulates this as
out_hash = H(left.out_hash, right.out_hash)
.Previously, each transaction was limited to just 2 messages, which meant the tx's
out_hash = H(msg_0, msg_1)
. However, transactions with just 1 message (=>out_hash = H(msg_0, 0)
) caused issues as methods in ts to recreate theout_hash
were not padding with empty messages. This was fixed in #6959, but introduced a variable size tree for the tx'sout_hash
. With the possibility of wonky rollups, this tree would be very unbalanced and messy to keep track of.A solution is to ensure all L2 to L1 messages in a block are formed into a balanced tree. We could:
PartialStateReference
to accumulate themA rollup just provides the final
out_hash
(the root of the message tree) and the height (currently a height range since the tree has variable height) to the Outbox. Consuming this message requires a valid message preimage and path, which is checked against the storedout_hash
using sha256.The text was updated successfully, but these errors were encountered: