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

fix: tree heights that last past 3 days #9760

Merged
merged 17 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
VERSION 0.8
FROM ubuntu:noble

build-ci:
BUILD ./avm-transpiler/+build
BUILD ./barretenberg/cpp/+preset-release
BUILD ./barretenberg/cpp/+preset-wasm
BUILD ./barretenberg/cpp/+preset-gcc
BUILD ./barretenberg/cpp/+preset-fuzzing
BUILD ./barretenberg/cpp/+preset-clang-assert
BUILD ./barretenberg/cpp/+test-clang-format
BUILD ./boxes/+build
BUILD ./noir/+packages
BUILD ./noir/+nargo
BUILD ./noir-projects/+build
BUILD ./yarn-project/+end-to-end
BUILD ./yarn-project/+aztec

build:
# yarn-project has the entry point to Aztec
BUILD ./yarn-project/+build
Expand Down
16 changes: 8 additions & 8 deletions barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,16 @@
#define AVM_MOV_BASE_L2_GAS 23
#define AVM_SLOAD_BASE_L2_GAS 1218
#define AVM_SSTORE_BASE_L2_GAS 2642
#define AVM_NOTEHASHEXISTS_BASE_L2_GAS 986
#define AVM_EMITNOTEHASH_BASE_L2_GAS 2330
#define AVM_NULLIFIEREXISTS_BASE_L2_GAS 1226
#define AVM_EMITNULLIFIER_BASE_L2_GAS 2650
#define AVM_L1TOL2MSGEXISTS_BASE_L2_GAS 506
#define AVM_GETCONTRACTINSTANCE_BASE_L2_GAS 1248
#define AVM_NOTEHASHEXISTS_BASE_L2_GAS 1226
#define AVM_EMITNOTEHASH_BASE_L2_GAS 2650
#define AVM_NULLIFIEREXISTS_BASE_L2_GAS 2426
#define AVM_EMITNULLIFIER_BASE_L2_GAS 4250
#define AVM_L1TOL2MSGEXISTS_BASE_L2_GAS 1196
#define AVM_GETCONTRACTINSTANCE_BASE_L2_GAS 2448
#define AVM_EMITUNENCRYPTEDLOG_BASE_L2_GAS 18
#define AVM_SENDL2TOL1MSG_BASE_L2_GAS 226
#define AVM_CALL_BASE_L2_GAS 2445
#define AVM_STATICCALL_BASE_L2_GAS 2445
#define AVM_CALL_BASE_L2_GAS 4845
#define AVM_STATICCALL_BASE_L2_GAS 4845
#define AVM_RETURN_BASE_L2_GAS 28
#define AVM_REVERT_BASE_L2_GAS 28
#define AVM_DEBUGLOG_BASE_L2_GAS 12
Expand Down
26 changes: 13 additions & 13 deletions l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ library Constants {
uint256 internal constant MAX_NOTE_ENCRYPTED_LOGS_PER_CALL = 16;
uint256 internal constant MAX_ENCRYPTED_LOGS_PER_CALL = 4;
uint256 internal constant MAX_UNENCRYPTED_LOGS_PER_CALL = 4;
uint256 internal constant ARCHIVE_HEIGHT = 16;
uint256 internal constant ARCHIVE_HEIGHT = 29;
uint256 internal constant VK_TREE_HEIGHT = 6;
uint256 internal constant PROTOCOL_CONTRACT_TREE_HEIGHT = 3;
uint256 internal constant FUNCTION_TREE_HEIGHT = 5;
uint256 internal constant NOTE_HASH_TREE_HEIGHT = 32;
uint256 internal constant NOTE_HASH_TREE_HEIGHT = 40;
uint256 internal constant PUBLIC_DATA_TREE_HEIGHT = 40;
uint256 internal constant NULLIFIER_TREE_HEIGHT = 20;
uint256 internal constant L1_TO_L2_MSG_TREE_HEIGHT = 16;
uint256 internal constant NULLIFIER_TREE_HEIGHT = 40;
uint256 internal constant L1_TO_L2_MSG_TREE_HEIGHT = 39;
uint256 internal constant ARTIFACT_FUNCTION_TREE_MAX_HEIGHT = 5;
uint256 internal constant NULLIFIER_TREE_ID = 0;
uint256 internal constant NOTE_HASH_TREE_ID = 1;
Expand All @@ -49,10 +49,10 @@ library Constants {
uint256 internal constant NULLIFIER_SUBTREE_HEIGHT = 6;
uint256 internal constant PUBLIC_DATA_SUBTREE_HEIGHT = 6;
uint256 internal constant L1_TO_L2_MSG_SUBTREE_HEIGHT = 4;
uint256 internal constant NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH = 26;
uint256 internal constant NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH = 14;
uint256 internal constant NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH = 34;
uint256 internal constant NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH = 34;
uint256 internal constant PUBLIC_DATA_SUBTREE_SIBLING_PATH_LENGTH = 34;
uint256 internal constant L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH = 12;
uint256 internal constant L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH = 35;
uint256 internal constant MAX_NOTE_HASHES_PER_TX = 64;
uint256 internal constant MAX_NULLIFIERS_PER_TX = 64;
uint256 internal constant MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX = 8;
Expand Down Expand Up @@ -100,7 +100,7 @@ library Constants {
uint256 internal constant AZTEC_TARGET_COMMITTEE_SIZE = 48;
uint256 internal constant AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS = 13;
uint256 internal constant GENESIS_ARCHIVE_ROOT =
8142738430000951296386584486068033372964809139261822027365426310856631083550;
19007378675971183768036762391356802220352606103602592933942074152320327194720;
uint256 internal constant FEE_JUICE_INITIAL_MINT = 20000000000;
uint256 internal constant PUBLIC_DISPATCH_SELECTOR = 3578010381;
uint256 internal constant MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS = 3000;
Expand Down Expand Up @@ -130,12 +130,12 @@ library Constants {
uint256 internal constant L2_GAS_PER_READ_MERKLE_HASH = 30;
uint256 internal constant L2_GAS_PER_WRITE_MERKLE_HASH = 40;
uint256 internal constant L2_GAS_PER_PUBLIC_DATA_UPDATE = 2624;
uint256 internal constant L2_GAS_PER_NOTE_HASH = 2304;
uint256 internal constant L2_GAS_PER_NULLIFIER = 2624;
uint256 internal constant L2_GAS_PER_NOTE_HASH = 2624;
uint256 internal constant L2_GAS_PER_NULLIFIER = 4224;
uint256 internal constant L2_GAS_PER_PUBLIC_DATA_READ = 1200;
uint256 internal constant L2_GAS_PER_NOTE_HASH_READ_REQUEST = 960;
uint256 internal constant L2_GAS_PER_NULLIFIER_READ_REQUEST = 1200;
uint256 internal constant L2_GAS_PER_L1_TO_L2_MSG_READ_REQUEST = 480;
uint256 internal constant L2_GAS_PER_NOTE_HASH_READ_REQUEST = 1200;
uint256 internal constant L2_GAS_PER_NULLIFIER_READ_REQUEST = 2400;
uint256 internal constant L2_GAS_PER_L1_TO_L2_MSG_READ_REQUEST = 1170;
uint256 internal constant L2_GAS_PER_LOG_BYTE = 4;
uint256 internal constant L2_GAS_PER_L2_TO_L1_MSG = 200;
uint256 internal constant MAX_PROTOCOL_CONTRACTS = 7;
Expand Down
22 changes: 11 additions & 11 deletions l1-contracts/test/fixtures/empty_block_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"l2ToL1Messages": []
},
"block": {
"archive": "0x04f48997a6e0472d7919af16c50859f86c041ef9aefceba4be94657943618ac1",
"blockHash": "0x2f3394755802dfe8105c0e7a5a7733970b59d83f6b9bd6eb754317f4d6a73c0f",
"archive": "0x24e1c12d4a584568a82fbc48c43079c8d2b7617f5d3a768e660dd0a8e3b009ad",
"blockHash": "0x2d8b58bd83cd7eec7b62a2635acc860c170bd175049372f3fd9545a1ae858fc7",
"body": "0x00000000",
"txsEffectsHash": "0x00e994e16b3763fd5039413cf99c2b3c378e2bab939e7992a77bd201b28160d6",
"decodedHeader": {
Expand All @@ -23,32 +23,32 @@
"blockNumber": 1,
"slotNumber": "0x0000000000000000000000000000000000000000000000000000000000000012",
"chainId": 31337,
"timestamp": 1730234580,
"timestamp": 1730935817,
"version": 1,
"coinbase": "0x2590e3544a7e2e7d736649fefc72ea5ad1d6efc3",
"feeRecipient": "0x2146e005e28b76eedc61edeff431b412b5ece74a5818080051832d286795ce2e",
"coinbase": "0x187d0c268240c51b19894420517bf642467d48d0",
"feeRecipient": "0x2b183aca566b7ff2674665e46343ce741fca6195892cfc3425c39a370fc27f0b",
"gasFees": {
"feePerDaGas": 0,
"feePerL2Gas": 0
}
},
"lastArchive": {
"nextAvailableLeafIndex": 1,
"root": "0x1200a06aae1368abe36530b585bd7a4d2ba4de5037b82076412691a187d7621e"
"root": "0x2a05cb8aeefe9b9797f90650eae072f5ab7437807e62f9724ce1900467779860"
},
"stateReference": {
"l1ToL2MessageTree": {
"nextAvailableLeafIndex": 16,
"root": "0x14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3"
"root": "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6"
},
"partialStateReference": {
"noteHashTree": {
"nextAvailableLeafIndex": 128,
"root": "0x0b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d"
"root": "0x1fd848aa69e1633722fe249a5b7f53b094f1c9cef9f5c694b073fd1cc5850dfb"
},
"nullifierTree": {
"nextAvailableLeafIndex": 256,
"root": "0x19a8c197c12bb33da6314c4ef4f8f6fcb9e25250c085df8672adf67c8f1e3dbc"
"root": "0x0c499b373a1f0fe1b510a63563546d2d39e206895056a5af0143c5f30d639073"
},
"publicDataTree": {
"nextAvailableLeafIndex": 256,
Expand All @@ -57,8 +57,8 @@
}
}
},
"header": "0x1200a06aae1368abe36530b585bd7a4d2ba4de5037b82076412691a187d7621e00000001000000000000000000000000000000000000000000000000000000000000000200e994e16b3763fd5039413cf99c2b3c378e2bab939e7992a77bd201b28160d600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3000000100b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d0000008019a8c197c12bb33da6314c4ef4f8f6fcb9e25250c085df8672adf67c8f1e3dbc0000010023c08a6b1297210c5e24c76b9a936250a1ce2721576c26ea797c7ec35f9e46a9000001000000000000000000000000000000000000000000000000000000000000007a6900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000672148d42590e3544a7e2e7d736649fefc72ea5ad1d6efc32146e005e28b76eedc61edeff431b412b5ece74a5818080051832d286795ce2e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"publicInputsHash": "0x0086289eca84479d5e34db9c4548bdd156af80fb725c51219650aa4460c80240",
"header": "0x2a05cb8aeefe9b9797f90650eae072f5ab7437807e62f9724ce190046777986000000001000000000000000000000000000000000000000000000000000000000000000200e994e16b3763fd5039413cf99c2b3c378e2bab939e7992a77bd201b28160d600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6000000101fd848aa69e1633722fe249a5b7f53b094f1c9cef9f5c694b073fd1cc5850dfb000000800c499b373a1f0fe1b510a63563546d2d39e206895056a5af0143c5f30d6390730000010023c08a6b1297210c5e24c76b9a936250a1ce2721576c26ea797c7ec35f9e46a9000001000000000000000000000000000000000000000000000000000000000000007a6900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000672bfc09187d0c268240c51b19894420517bf642467d48d02b183aca566b7ff2674665e46343ce741fca6195892cfc3425c39a370fc27f0b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"publicInputsHash": "0x00b055fb2cf7f8975ef1e98c2e4e4a730765c7b2dc825f9593e4d3bac8196d10",
"numTxs": 0
}
}
22 changes: 11 additions & 11 deletions l1-contracts/test/fixtures/empty_block_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"l2ToL1Messages": []
},
"block": {
"archive": "0x07d7359b2b2922b8126019bef4f2d5698f25226f5f2270a79d1105503727dd6e",
"blockHash": "0x1836f56b16db44064b3231102c84c6eaf3327d0204a5171f65b3019fc79c2b5e",
"archive": "0x2c670bc906985275c4edab8fc97ce0fc4f1d2e76f47b8b163373ead05477f30c",
"blockHash": "0x0ca5c56199e259bbc1fb7cc169a5e5a0cac3312ec8b2663298d94c858ce1bd8d",
"body": "0x00000000",
"txsEffectsHash": "0x00e994e16b3763fd5039413cf99c2b3c378e2bab939e7992a77bd201b28160d6",
"decodedHeader": {
Expand All @@ -23,32 +23,32 @@
"blockNumber": 2,
"slotNumber": "0x0000000000000000000000000000000000000000000000000000000000000013",
"chainId": 31337,
"timestamp": 1730234604,
"timestamp": 1730935841,
"version": 1,
"coinbase": "0x2590e3544a7e2e7d736649fefc72ea5ad1d6efc3",
"feeRecipient": "0x2146e005e28b76eedc61edeff431b412b5ece74a5818080051832d286795ce2e",
"coinbase": "0x187d0c268240c51b19894420517bf642467d48d0",
"feeRecipient": "0x2b183aca566b7ff2674665e46343ce741fca6195892cfc3425c39a370fc27f0b",
"gasFees": {
"feePerDaGas": 0,
"feePerL2Gas": 0
}
},
"lastArchive": {
"nextAvailableLeafIndex": 2,
"root": "0x04f48997a6e0472d7919af16c50859f86c041ef9aefceba4be94657943618ac1"
"root": "0x24e1c12d4a584568a82fbc48c43079c8d2b7617f5d3a768e660dd0a8e3b009ad"
},
"stateReference": {
"l1ToL2MessageTree": {
"nextAvailableLeafIndex": 32,
"root": "0x14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3"
"root": "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6"
},
"partialStateReference": {
"noteHashTree": {
"nextAvailableLeafIndex": 256,
"root": "0x0b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d"
"root": "0x1fd848aa69e1633722fe249a5b7f53b094f1c9cef9f5c694b073fd1cc5850dfb"
},
"nullifierTree": {
"nextAvailableLeafIndex": 384,
"root": "0x19a8c197c12bb33da6314c4ef4f8f6fcb9e25250c085df8672adf67c8f1e3dbc"
"root": "0x0c499b373a1f0fe1b510a63563546d2d39e206895056a5af0143c5f30d639073"
},
"publicDataTree": {
"nextAvailableLeafIndex": 384,
Expand All @@ -57,8 +57,8 @@
}
}
},
"header": "0x04f48997a6e0472d7919af16c50859f86c041ef9aefceba4be94657943618ac100000002000000000000000000000000000000000000000000000000000000000000000200e994e16b3763fd5039413cf99c2b3c378e2bab939e7992a77bd201b28160d600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3000000200b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d0000010019a8c197c12bb33da6314c4ef4f8f6fcb9e25250c085df8672adf67c8f1e3dbc0000018023c08a6b1297210c5e24c76b9a936250a1ce2721576c26ea797c7ec35f9e46a9000001800000000000000000000000000000000000000000000000000000000000007a6900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001300000000000000000000000000000000000000000000000000000000672148ec2590e3544a7e2e7d736649fefc72ea5ad1d6efc32146e005e28b76eedc61edeff431b412b5ece74a5818080051832d286795ce2e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"publicInputsHash": "0x009727b9d0f6c22ea711c2e31249776bd687ffa0eaf97b54120af68c96da0eda",
"header": "0x24e1c12d4a584568a82fbc48c43079c8d2b7617f5d3a768e660dd0a8e3b009ad00000002000000000000000000000000000000000000000000000000000000000000000200e994e16b3763fd5039413cf99c2b3c378e2bab939e7992a77bd201b28160d600089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6000000201fd848aa69e1633722fe249a5b7f53b094f1c9cef9f5c694b073fd1cc5850dfb000001000c499b373a1f0fe1b510a63563546d2d39e206895056a5af0143c5f30d6390730000018023c08a6b1297210c5e24c76b9a936250a1ce2721576c26ea797c7ec35f9e46a9000001800000000000000000000000000000000000000000000000000000000000007a6900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001300000000000000000000000000000000000000000000000000000000672bfc21187d0c268240c51b19894420517bf642467d48d02b183aca566b7ff2674665e46343ce741fca6195892cfc3425c39a370fc27f0b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"publicInputsHash": "0x00e38518170ed036a18aa56570c0ebda3b6fc06800096913b62880eee834fece",
"numTxs": 0
}
}
22 changes: 11 additions & 11 deletions l1-contracts/test/fixtures/mixed_block_1.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions l1-contracts/test/fixtures/mixed_block_2.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use dep::protocol_types::{
};

// INDEX_LENGTH + NULLIFIER_LEAF_PREIMAGE_LENGTH + NULLIFIER_TREE_HEIGHT
global NULLIFIER_MEMBERSHIP_WITNESS: u32 = 24;
global NULLIFIER_MEMBERSHIP_WITNESS: u32 = 44;

pub struct NullifierMembershipWitness {
index: Field,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ pub global MAX_ENCRYPTED_LOGS_PER_CALL: u32 = 4;
pub global MAX_UNENCRYPTED_LOGS_PER_CALL: u32 = 4;

// TREES RELATED CONSTANTS
pub global ARCHIVE_HEIGHT: u32 = 16;
pub global ARCHIVE_HEIGHT: u32 = 29;
pub global VK_TREE_HEIGHT: u32 = 6;
pub global PROTOCOL_CONTRACT_TREE_HEIGHT: u32 = 3;
pub global FUNCTION_TREE_HEIGHT: u32 = 5;
pub global NOTE_HASH_TREE_HEIGHT: u32 = 32;
pub global NOTE_HASH_TREE_HEIGHT: u32 = 40;
pub global PUBLIC_DATA_TREE_HEIGHT: u32 = 40;
pub global NULLIFIER_TREE_HEIGHT: u32 = 20;
pub global L1_TO_L2_MSG_TREE_HEIGHT: u32 = 16;
pub global NULLIFIER_TREE_HEIGHT: u32 = 40;
pub global L1_TO_L2_MSG_TREE_HEIGHT: u32 = 39;
pub global ARTIFACT_FUNCTION_TREE_MAX_HEIGHT: u32 = 5;
pub global NULLIFIER_TREE_ID = 0;
pub global NOTE_HASH_TREE_ID = 1;
Expand Down Expand Up @@ -145,7 +145,7 @@ pub global AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS: u32 = 13;
// The following is taken from building a block and looking at the `lastArchive` value in it.
// You can run the `integration_l1_publisher.test.ts` and look at the first blocks in the fixtures.
pub global GENESIS_ARCHIVE_ROOT: Field =
0x1200a06aae1368abe36530b585bd7a4d2ba4de5037b82076412691a187d7621e;
0x2a05cb8aeefe9b9797f90650eae072f5ab7437807e62f9724ce1900467779860;
// The following and the value in `deploy_l1_contracts` must match. We should not have the code both places, but
// we are running into circular dependency issues. #3342
pub global FEE_JUICE_INITIAL_MINT: Field = 20000000000;
Expand Down
Loading
Loading