Skip to content

Commit 94a215f

Browse files
authored
feat!: checkpoint circuits (#16187)
Adding new checkpoint circuits as describe in the [design doc](AztecProtocol/engineering-designs#73). Things different to the doc: - The parity root is verified in the first block root in a checkpoint. This is to speed up the overall proving time. - The `CheckpointHeader` is the same as the previous `ProposedBlockHeader` - we will still be validating the same values on L1 when submitting a checkpoint. To make the e2e tests pass without changing too many things, each checkpoint currently only contains one block. The existing "L2Block" class represents a block and its checkpoint. And a temporary `L2BlockHeader` is created for it, which has all the fields required to construct a `BlockHeader` and a `CheckpointHeader`. The orchestrator should already work correctly for multiple blocks per checkpoint.
2 parents 4beae29 + a3e23b9 commit 94a215f

File tree

284 files changed

+49311
-25975
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+49311
-25975
lines changed

barretenberg/cpp/src/barretenberg/vm2/common/aztec_constants.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#define MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX 63
1616
#define MAX_L2_TO_L1_MSGS_PER_TX 8
1717
#define MAX_PUBLIC_LOGS_PER_TX 8
18-
#define GENESIS_BLOCK_HEADER_HASH "0x0e40440ea6abb9b58877d3aea6628cc6b14b6bc2148ce2be6f46db23360a6aba"
19-
#define GENESIS_ARCHIVE_ROOT "0x1f9c798be7975bb34c3e605a4c92c75796eae7b9a08644bc9a6a55354ed470be"
18+
#define GENESIS_BLOCK_HEADER_HASH "0x1946c22774242c1aae3d73ff44bd250fa7c0d1a83b55c8a5d3642a518c530ffb"
19+
#define GENESIS_ARCHIVE_ROOT "0x2a5d53da0a767a07c6e731af7ac9dad7f3bf4f19feea9ad7d177711f19a34cbe"
2020
#define MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS 3000
2121
#define MAX_PROTOCOL_CONTRACTS 7
2222
#define CANONICAL_AUTH_REGISTRY_ADDRESS 1
0 Bytes
Binary file not shown.

barretenberg/cpp/src/barretenberg/world_state/world_state.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -955,10 +955,6 @@ bb::fr WorldState::compute_initial_block_header_hash(const StateReference& initi
955955
// last archive - which, at genesis, is all 0s
956956
0, // root
957957
0, // next_available_leaf_index
958-
// content commitment - all 0s
959-
0, // blobs_hash
960-
0, // in_hash
961-
0, // out_hash
962958
// state reference - the initial state for all the trees (accept the archive tree)
963959
initial_state_ref.at(MerkleTreeId::L1_TO_L2_MESSAGE_TREE).first,
964960
initial_state_ref.at(MerkleTreeId::L1_TO_L2_MESSAGE_TREE).second,
@@ -968,6 +964,7 @@ bb::fr WorldState::compute_initial_block_header_hash(const StateReference& initi
968964
initial_state_ref.at(MerkleTreeId::NULLIFIER_TREE).second,
969965
initial_state_ref.at(MerkleTreeId::PUBLIC_DATA_TREE).first,
970966
initial_state_ref.at(MerkleTreeId::PUBLIC_DATA_TREE).second,
967+
0, // sponge_blob_hash
971968
// global variables
972969
0, // chain_id
973970
0, // version

l1-contracts/src/core/libraries/ConstantsGen.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ library Constants {
2121
uint256 internal constant BLOBS_PER_BLOCK = 3;
2222
uint256 internal constant AZTEC_MAX_EPOCH_DURATION = 48;
2323
uint256 internal constant GENESIS_ARCHIVE_ROOT =
24-
14_298_165_331_316_638_916_453_567_345_577_793_920_283_466_066_305_521_584_041_971_978_819_102_601_406;
24+
19_162_035_140_838_596_506_349_442_774_820_653_374_703_500_378_808_526_655_220_525_977_359_188_446_398;
2525
uint256 internal constant FEE_JUICE_ADDRESS = 5;
2626
uint256 internal constant BLS12_POINT_COMPRESSED_BYTES = 48;
2727
uint256 internal constant PROPOSED_BLOCK_HEADER_LENGTH_BYTES = 284;

l1-contracts/test/fixtures/empty_block_1.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,29 @@
2525
"l2ToL1Messages": []
2626
},
2727
"block": {
28-
"archive": "0x157c229ede998faac7d1732fa2d7373c6610c53e034e89a0b86d87fbda0d3615",
29-
"blobCommitments": "0x01c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
30-
"batchedBlobInputs": "0x010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c4440140ac4f3ee53aedc4865073ae7fb664e7401d10eadbe3bbcc266c35059f14826bb0000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
28+
"archive": "0x1b72b1a2eba9b490a938d521e9813907ecc3961c1a768fb79af5c824ea59bd64",
29+
"blobCommitments": "0x0183d27470dde07f76d48b7a2649d0e0470ece5b4bb789ead0018d75beee43d49b5494aadce0bd97af25e130ea8e2e34b7",
30+
"batchedBlobInputs": "0x0105787dfe45dce92e1fa720a458d3e14bee6fce9b73f6e8196825f49142d9cb2a8ea087412e4a8b29357d9e9c5b85edcf540f827eb75b397bf75b663480c94249681d0955dffa2b281bb84cd78926144d1ff9d995b9f4330fadcc097a1796b683d27470dde07f76d48b7a2649d0e0470ece5b4bb789ead0018d75beee43d49b5494aadce0bd97af25e130ea8e2e34b79514697b082a83078bb4369c0c43922a0c2aaeafab7ab0d97032581c552ab0110488a4505354d2a804e210da9010515b",
3131
"blockNumber": 1,
3232
"body": "0x00000000",
3333
"header": {
34-
"lastArchiveRoot": "0x1f9c798be7975bb34c3e605a4c92c75796eae7b9a08644bc9a6a55354ed470be",
34+
"lastArchiveRoot": "0x2a5d53da0a767a07c6e731af7ac9dad7f3bf4f19feea9ad7d177711f19a34cbe",
3535
"contentCommitment": {
36-
"blobsHash": "0x001cedbd7ea5309ef9d1d159209835409bf41b6b1802597a52fa70cc82e934d9",
36+
"blobsHash": "0x00037077d6b94ce99fcfe346182c4bb458a304f075a4f09c8df75f7ce1caadbb",
3737
"inHash": "0x00089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c",
3838
"outHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
3939
},
4040
"slotNumber": 70,
41-
"timestamp": 1749584579,
42-
"coinbase": "0x65deba9e3e0d6a6a1fff21019fcc2c11d765015b",
43-
"feeRecipient": "0x1433050acbece41b27856915520ff047f4b87dc18c54c8003212f5215e4182b2",
41+
"timestamp": 1755017911,
42+
"coinbase": "0xcb486390cb1e8799bfdc7b2f66905dd9579576cd",
43+
"feeRecipient": "0x0391c2c6d0d6bc8283ae38f44173ccd23da5261c89e689c6b797bc3d85232463",
4444
"gasFees": {
4545
"feePerDaGas": 0,
46-
"feePerL2Gas": 1390
46+
"feePerL2Gas": 26640
4747
},
4848
"totalManaUsed": 0
4949
},
50-
"headerHash": "0x00910e05de2688d2dc918a287b1a7a975edbd97e4431d5b68f2f39ae70c10c36",
50+
"headerHash": "0x007da5172a7680f47e110321340c0aabea353e71f24cc3754b71dfacb36f0d87",
5151
"numTxs": 0
5252
}
5353
}

l1-contracts/test/fixtures/empty_block_2.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,29 @@
2525
"l2ToL1Messages": []
2626
},
2727
"block": {
28-
"archive": "0x0821b9ac0f42c7d222a725987bafec72a5b0bdbcc8fa3f26f9e5ab9e0637e1ef",
29-
"blobCommitments": "0x01c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
30-
"batchedBlobInputs": "0x010657f37554c781402a22917dee2f75def7ab966d7b770905398eba3c44401416743433c1b3d551429cfbc09ab7899d4e14d2b5786a3243e29bc9c6c0d76bf10000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
28+
"archive": "0x228d4789111677b2063883a1d79694c88d8a4f6e5c954a54761629867b9e1605",
29+
"blobCommitments": "0x0183d27470dde07f76d48b7a2649d0e0470ece5b4bb789ead0018d75beee43d49b5494aadce0bd97af25e130ea8e2e34b7",
30+
"batchedBlobInputs": "0x01b3c791d91f8bd20ad24700636312ec9a9e1bfad72a91fb7ed1b184ca1e29ef08b789ecc069f33e37567cced97993b6d693faf3d97133ca073c70cd7e95b0fb5dae53b1277eeb809d8226e5acff01a87378bd57565c63f9186db20a0b58a810abff878c4b59bc23d410ae83c32a739595ccefd1c0df808cab83f1cb0aae49c7598b07c3370c8dc89763b0b2282a73c889470eabf8ca3dedeb2717c1276266f5b7ea51c3b9e482f0628f051d6c2a71544b44dd14fb0b86985866860aa23dc5f4",
3131
"blockNumber": 2,
3232
"body": "0x00000000",
3333
"header": {
34-
"lastArchiveRoot": "0x157c229ede998faac7d1732fa2d7373c6610c53e034e89a0b86d87fbda0d3615",
34+
"lastArchiveRoot": "0x1b72b1a2eba9b490a938d521e9813907ecc3961c1a768fb79af5c824ea59bd64",
3535
"contentCommitment": {
36-
"blobsHash": "0x001cedbd7ea5309ef9d1d159209835409bf41b6b1802597a52fa70cc82e934d9",
37-
"inHash": "0x00f72dcdb03d8b5839841eeeb4faeff962b52c0b4fe012b1532dd4886c4aca1a",
36+
"blobsHash": "0x00037077d6b94ce99fcfe346182c4bb458a304f075a4f09c8df75f7ce1caadbb",
37+
"inHash": "0x008b98b6f566f9bf78cf5edbe955467c2bd3a9cd9d179fe806a853a23fc97111",
3838
"outHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
3939
},
4040
"slotNumber": 76,
41-
"timestamp": 1749584795,
42-
"coinbase": "0x65deba9e3e0d6a6a1fff21019fcc2c11d765015b",
43-
"feeRecipient": "0x1433050acbece41b27856915520ff047f4b87dc18c54c8003212f5215e4182b2",
41+
"timestamp": 1755018127,
42+
"coinbase": "0xcb486390cb1e8799bfdc7b2f66905dd9579576cd",
43+
"feeRecipient": "0x0391c2c6d0d6bc8283ae38f44173ccd23da5261c89e689c6b797bc3d85232463",
4444
"gasFees": {
4545
"feePerDaGas": 0,
46-
"feePerL2Gas": 1040
46+
"feePerL2Gas": 2170
4747
},
4848
"totalManaUsed": 0
4949
},
50-
"headerHash": "0x00b420b7ee25554e7ead85feab8ba2752ceb7779d5792c7fd626bc07cb22c3fa",
50+
"headerHash": "0x0007944424c96680ffb947402b173a311d83c585d5a73bbc2fa4e2dd2b0c7c9c",
5151
"numTxs": 0
5252
}
5353
}

l1-contracts/test/fixtures/mixed_block_1.json

Lines changed: 11 additions & 11 deletions
Large diffs are not rendered by default.

l1-contracts/test/fixtures/mixed_block_2.json

Lines changed: 12 additions & 12 deletions
Large diffs are not rendered by default.

l1-contracts/test/fixtures/single_tx_block_1.json

Lines changed: 11 additions & 11 deletions
Large diffs are not rendered by default.

l1-contracts/test/fixtures/single_tx_block_2.json

Lines changed: 12 additions & 12 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)