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: Update requests per call should be less than per tx #11072

Merged
merged 2 commits into from
Jan 6, 2025
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
12 changes: 6 additions & 6 deletions barretenberg/cpp/pil/avm/constants_gen.pil
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace constants(256);
pol MAX_NULLIFIERS_PER_CALL = 16;
pol MAX_ENQUEUED_CALLS_PER_CALL = 16;
pol MAX_L2_TO_L1_MSGS_PER_CALL = 2;
pol MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 64;
pol MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 63;
pol MAX_PUBLIC_DATA_READS_PER_CALL = 64;
pol MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 16;
pol MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 16;
Expand Down Expand Up @@ -38,9 +38,9 @@ namespace constants(256);
pol START_NULLIFIER_NON_EXISTS_OFFSET = 32;
pol START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET = 48;
pol START_SSTORE_WRITE_OFFSET = 64;
pol START_SLOAD_WRITE_OFFSET = 128;
pol START_EMIT_NOTE_HASH_WRITE_OFFSET = 192;
pol START_EMIT_NULLIFIER_WRITE_OFFSET = 208;
pol START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET = 224;
pol START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 226;
pol START_SLOAD_WRITE_OFFSET = 127;
pol START_EMIT_NOTE_HASH_WRITE_OFFSET = 191;
pol START_EMIT_NULLIFIER_WRITE_OFFSET = 207;
pol START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET = 223;
pol START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 225;

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 @@ -5,7 +5,7 @@
#define MAX_NULLIFIERS_PER_CALL 16
#define MAX_ENQUEUED_CALLS_PER_CALL 16
#define MAX_L2_TO_L1_MSGS_PER_CALL 2
#define MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL 64
#define MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL 63
#define MAX_PUBLIC_DATA_READS_PER_CALL 64
#define MAX_NOTE_HASH_READ_REQUESTS_PER_CALL 16
#define MAX_NULLIFIER_READ_REQUESTS_PER_CALL 16
Expand Down Expand Up @@ -44,14 +44,14 @@
#define PUBLIC_INNER_CALL_REQUEST_LENGTH 13
#define STATE_REFERENCE_LENGTH 8
#define TOTAL_FEES_LENGTH 1
#define PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH 867
#define PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH 864
#define AVM_ACCUMULATED_DATA_LENGTH 320
#define AVM_CIRCUIT_PUBLIC_INPUTS_LENGTH 1011
#define AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS 86
#define MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS 21
#define AVM_PROOF_LENGTH_IN_FIELDS 4155
#define AVM_PUBLIC_COLUMN_MAX_SIZE 1024
#define AVM_PUBLIC_INPUTS_FLATTENED_SIZE 2915
#define AVM_PUBLIC_INPUTS_FLATTENED_SIZE 2912
#define MEM_TAG_FF 0
#define MEM_TAG_U1 1
#define MEM_TAG_U8 2
Expand All @@ -78,11 +78,11 @@
#define START_NULLIFIER_NON_EXISTS_OFFSET 32
#define START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET 48
#define START_SSTORE_WRITE_OFFSET 64
#define START_SLOAD_WRITE_OFFSET 128
#define START_EMIT_NOTE_HASH_WRITE_OFFSET 192
#define START_EMIT_NULLIFIER_WRITE_OFFSET 208
#define START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET 224
#define START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET 226
#define START_SLOAD_WRITE_OFFSET 127
#define START_EMIT_NOTE_HASH_WRITE_OFFSET 191
#define START_EMIT_NULLIFIER_WRITE_OFFSET 207
#define START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET 223
#define START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET 225
#define MAX_L2_GAS_PER_TX_PUBLIC_PORTION 6000000
#define AVM_POSEIDON2_BASE_L2_GAS 36
#define AVM_ADD_BASE_L2_GAS 27
Expand Down
14 changes: 7 additions & 7 deletions l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ library Constants {
uint256 internal constant MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL = 5;
uint256 internal constant MAX_ENQUEUED_CALLS_PER_CALL = 16;
uint256 internal constant MAX_L2_TO_L1_MSGS_PER_CALL = 2;
uint256 internal constant MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 64;
uint256 internal constant MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 63;
uint256 internal constant MAX_PUBLIC_DATA_READS_PER_CALL = 64;
uint256 internal constant MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 16;
uint256 internal constant MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 16;
Expand Down Expand Up @@ -187,7 +187,7 @@ library Constants {
uint256 internal constant BLOCK_HEADER_LENGTH = 25;
uint256 internal constant BLOCK_HEADER_LENGTH_BYTES = 648;
uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 741;
uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 867;
uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 864;
uint256 internal constant PRIVATE_CONTEXT_INPUTS_LENGTH = 40;
uint256 internal constant FEE_RECIPIENT_LENGTH = 2;
uint256 internal constant AGGREGATION_OBJECT_LENGTH = 16;
Expand Down Expand Up @@ -258,11 +258,11 @@ library Constants {
uint256 internal constant START_NULLIFIER_NON_EXISTS_OFFSET = 32;
uint256 internal constant START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET = 48;
uint256 internal constant START_SSTORE_WRITE_OFFSET = 64;
uint256 internal constant START_SLOAD_WRITE_OFFSET = 128;
uint256 internal constant START_EMIT_NOTE_HASH_WRITE_OFFSET = 192;
uint256 internal constant START_EMIT_NULLIFIER_WRITE_OFFSET = 208;
uint256 internal constant START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET = 224;
uint256 internal constant START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 226;
uint256 internal constant START_SLOAD_WRITE_OFFSET = 127;
uint256 internal constant START_EMIT_NOTE_HASH_WRITE_OFFSET = 191;
uint256 internal constant START_EMIT_NULLIFIER_WRITE_OFFSET = 207;
uint256 internal constant START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET = 223;
uint256 internal constant START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 225;
uint256 internal constant DEFAULT_GAS_LIMIT = 1000000000;
uint256 internal constant MAX_L2_GAS_PER_TX_PUBLIC_PORTION = 6000000;
uint256 internal constant DEFAULT_TEARDOWN_GAS_LIMIT = 6000000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub global MAX_NULLIFIERS_PER_CALL: u32 = 16;
pub global MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL: u32 = 5;
pub global MAX_ENQUEUED_CALLS_PER_CALL: u32 = 16;
pub global MAX_L2_TO_L1_MSGS_PER_CALL: u32 = 2;
pub global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL: u32 = 64;
pub global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL: u32 = 63;
pub global MAX_PUBLIC_DATA_READS_PER_CALL: u32 = 64;
pub global MAX_NOTE_HASH_READ_REQUESTS_PER_CALL: u32 = 16;
pub global MAX_NULLIFIER_READ_REQUESTS_PER_CALL: u32 = 16;
Expand Down Expand Up @@ -771,3 +771,14 @@ pub global PROOF_TYPE_PG: u32 = 3;
pub global PROOF_TYPE_AVM: u32 = 4;
pub global PROOF_TYPE_ROLLUP_HONK: u32 = 5;
pub global PROOF_TYPE_ROOT_ROLLUP_HONK: u32 = 6;

mod test {
use crate::constants::{
MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
};

#[test]
unconstrained fn test_constants() {
assert(MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL <= MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX);
}
}
16 changes: 8 additions & 8 deletions yarn-project/circuits.js/src/constants.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const MAX_NULLIFIERS_PER_CALL = 16;
export const MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL = 5;
export const MAX_ENQUEUED_CALLS_PER_CALL = 16;
export const MAX_L2_TO_L1_MSGS_PER_CALL = 2;
export const MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 64;
export const MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 63;
export const MAX_PUBLIC_DATA_READS_PER_CALL = 64;
export const MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 16;
export const MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 16;
Expand Down Expand Up @@ -165,7 +165,7 @@ export const TOTAL_MANA_USED_LENGTH = 1;
export const BLOCK_HEADER_LENGTH = 25;
export const BLOCK_HEADER_LENGTH_BYTES = 648;
export const PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 741;
export const PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 867;
export const PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 864;
export const PRIVATE_CONTEXT_INPUTS_LENGTH = 40;
export const FEE_RECIPIENT_LENGTH = 2;
export const AGGREGATION_OBJECT_LENGTH = 16;
Expand Down Expand Up @@ -215,7 +215,7 @@ export const MAX_PUBLIC_BYTECODE_SIZE_IN_BYTES = 96000;
export const MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS = 21;
export const AVM_PROOF_LENGTH_IN_FIELDS = 4155;
export const AVM_PUBLIC_COLUMN_MAX_SIZE = 1024;
export const AVM_PUBLIC_INPUTS_FLATTENED_SIZE = 2915;
export const AVM_PUBLIC_INPUTS_FLATTENED_SIZE = 2912;
export const MEM_TAG_FF = 0;
export const MEM_TAG_U1 = 1;
export const MEM_TAG_U8 = 2;
Expand All @@ -242,11 +242,11 @@ export const START_NULLIFIER_EXISTS_OFFSET = 16;
export const START_NULLIFIER_NON_EXISTS_OFFSET = 32;
export const START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET = 48;
export const START_SSTORE_WRITE_OFFSET = 64;
export const START_SLOAD_WRITE_OFFSET = 128;
export const START_EMIT_NOTE_HASH_WRITE_OFFSET = 192;
export const START_EMIT_NULLIFIER_WRITE_OFFSET = 208;
export const START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET = 224;
export const START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 226;
export const START_SLOAD_WRITE_OFFSET = 127;
export const START_EMIT_NOTE_HASH_WRITE_OFFSET = 191;
export const START_EMIT_NULLIFIER_WRITE_OFFSET = 207;
export const START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET = 223;
export const START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 225;
export const DEFAULT_GAS_LIMIT = 1000000000;
export const MAX_L2_GAS_PER_TX_PUBLIC_PORTION = 6000000;
export const DEFAULT_TEARDOWN_GAS_LIMIT = 6000000;
Expand Down
Loading