-
Notifications
You must be signed in to change notification settings - Fork 295
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
feat: single tx block root rollup #11096
Conversation
Changes to circuit sizes
🧾 Summary (100% most significant diffs)
Full diff report 👇
|
@@ -47,7 +47,6 @@ contract Outbox is IOutbox { | |||
override(IOutbox) | |||
{ | |||
require(msg.sender == address(ROLLUP), Errors.Outbox__Unauthorized()); | |||
require(_root != bytes32(0), Errors.Outbox__InsertingInvalidRoot()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this check as we allow submitting an empty block, which will have 0 out hash.
if !dep::std::runtime::is_unconstrained() { | ||
self.previous_rollup_data[0].verify(); | ||
self.previous_rollup_data[0].validate_in_vk_tree(ALLOWED_PREVIOUS_CIRCUITS); | ||
let validator = BlockRootRollupInputsValidator::new( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking up the content into BlockRootRollupInputsValidator
and BlockRootRollupOutputComposer
so that the logic can be easily reused by all 3 types of block root rollups.
}; | ||
use types::constants::AZTEC_MAX_EPOCH_DURATION; | ||
|
||
pub global EMPTY_BLOBS_HASH: Field = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These hard-coded values are copied over from block_building_helper.test.ts
and compared in one of the tests below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleting this file because it used to test base rollup with empty private kernel. But now the empty private kernel is gone, and it's a pain to generate a valid tube proof here. And there's no point testing an empty base rollup specifically, which is also part of bb_prover_full_rollup.test.ts
.
* The L1 calculation instead computes the tree from right to left (slightly cheaper gas). | ||
* TODO: A more thorough investigation of which method is cheaper, then use that method everywhere. | ||
*/ | ||
export function computeUnbalancedMerkleRoot(leaves: Buffer[], emptyLeaf?: Buffer, hasher = sha256Trunc): Buffer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is copied from the deleted file unbalanced_merkle_root.ts
.
location: TreeNodeLocation; | ||
} | ||
|
||
export class UnbalancedTreeStore<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating this class to store and trace proving outputs in block-proving-state.ts
and epoch-proving-state.ts
.
pub fn finish_empty( | ||
self, | ||
constants: ConstantRollupData, | ||
previous_partial_state: PartialStateReference, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This currently can be anything, just like the start state for the first base rollup. Will fix it in a separate pr!
const blobFields = txEffects.flatMap(tx => tx.toBlobFields()); | ||
const blobs = Blob.getBlobs(blobFields); | ||
const blobCommitments = blobs.map(b => b.commitmentToFields()); | ||
const blobsHash = sha256ToField(blobs.map(b => b.getEthVersionedBlobHash())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the blobsHash
, we could use getBlobsHashFromBlobs
or remove that method and just use sha256ToField
- I'm just thinking doing it a single way is cleaner!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I just copied it from orchestrator. Didn't know we had a function for that! Thanks 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just one nit that's not important. So nice to not need padding txs, and to have a proper unbalanced tree!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Hope that removing tx effect padding in append only trees doesn't mess with world state assumptions 🤞
Just found this by chance. Awesome!! |
* master: (287 commits) feat: Sync from noir (#11051) chore(docs): Update tx concepts page (#10947) chore(docs): Edit Aztec.nr Guide section (#10866) chore: test:e2e defaults to no-docker (#10966) chore(avm): improve column stats (#11135) chore: Sanity checking of proving job IDs (#11134) feat: permutation argument optimizations (#10960) feat: single tx block root rollup (#11096) refactor: prover db config (#11126) feat: monitor event loop lag (#11127) chore: Greater stability at 1TPS (#10981) chore: Jest reporters for CI (#11125) fix: Sequencer times out L1 tx at end of L2 slot (#11112) feat: browser chunking (#11102) fix: Added start/stop guards to running promise and serial queue (#11120) fix: Don't retransmit txs upon node restart (#11123) fix: Prover node aborts execution at epoch end (#11111) feat: blob sink in sandbox without extra process (#11032) chore: log number of instructions executed for call in AVM. Misc fix. (#11110) git subrepo push --branch=master noir-projects/aztec-nr ...
…sync (#11141) #11096 broke Noir CI as the `Prover.toml` files weren't updated to take into account the new circuits. This PR executes the protocol circuits with these inputs to check they're valid. --------- Co-authored-by: Miranda Wood <[email protected]>
PrivateKernelEmpty
andEmptyNested
.SingleTxBlockRootRollup
circuit.EmptyBlockRootRollup
.l1_to_l2_message_tree
.