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

chore!: Add Side effect counter struct for ordering #3608

Merged
merged 90 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from 74 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
b818bb9
start adding new side effect structs
dan-aztec Nov 29, 2023
c97cb48
start changing Field to SideEffect{LinkedToNoteHash}
dan-aztec Dec 3, 2023
411b0dc
start revert of pending_read_requests
dan-aztec Dec 4, 2023
cc34281
update commitment/nullifier propogation
dan-aztec Dec 4, 2023
ac0bca7
more type changes
dan-aztec Dec 4, 2023
4bec7cd
start changing context.nr
dan-aztec Dec 5, 2023
976a305
start updating circuits struct
dan-aztec Dec 5, 2023
21a24d7
remove all pending_Read_requests
dan-aztec Dec 6, 2023
91d2d3e
rip out more read requests
dan-aztec Dec 6, 2023
69bece0
merge
dan-aztec Dec 6, 2023
8851e89
sideeffect TS class
dan-aztec Dec 6, 2023
8802540
0 values
dan-aztec Dec 7, 2023
b5b3ea4
Merge branch 'master' into dan/side-effect-counter-struct
dan-aztec Dec 7, 2023
6b46ea0
missing merge conflict
dan-aztec Dec 7, 2023
6c9a5ca
lingering merge conflict
dan-aztec Dec 7, 2023
f116e6e
some noir updates
dan-aztec Dec 7, 2023
26b7ec5
use single index for pedersen hash across sideffects
dan-aztec Dec 7, 2023
58271e9
Merge branch 'master' into dan/side-effect-counter-struct
dan-aztec Dec 7, 2023
076da96
explicit field names in sideffect constructor
dan-aztec Dec 7, 2023
4472994
comma
dan-aztec Dec 7, 2023
d1d62a4
struct_array_length
dan-aztec Dec 7, 2023
bd07095
Merge branch 'master' into dan/side-effect-counter-struct
dan-aztec Dec 7, 2023
e865101
rename to counter
dan-aztec Dec 7, 2023
ee5cf86
update some tests
dan-aztec Dec 7, 2023
15f7bba
test imports
dan-aztec Dec 7, 2023
15b5840
more test imports
dan-aztec Dec 7, 2023
6808b8e
noir fixes
dan-aztec Dec 7, 2023
8dba682
more
dan-aztec Dec 8, 2023
58b75ac
Merge branch 'master' into dan/side-effect-counter-struct
dan-aztec Dec 8, 2023
30df276
bad merge
dan-aztec Dec 8, 2023
5f482be
types?
dan-aztec Dec 8, 2023
ed135d8
break down public_kernel_public_previous big test
dan-aztec Dec 8, 2023
064a84d
test fix
dan-aztec Dec 8, 2023
4e64cb4
isolate failing build
dan-aztec Dec 8, 2023
0c2817c
squashing
dan-aztec Dec 13, 2023
c22ab9e
Merge branch 'master' into dan/side-effect-counter-struct
dan-aztec Dec 13, 2023
901de10
noir-protocol snapshot
dan-aztec Dec 13, 2023
db2c1ed
Merge branch 'dan/side-effect-counter-struct' of github.com:AztecProt…
dan-aztec Dec 13, 2023
cd502d7
Merge branch 'master' into dan/side-effect-counter-struct
dan-aztec Dec 13, 2023
83e8ebe
Merge branch 'master' into dan/side-effect-counter-struct
dan-aztec Dec 13, 2023
7b11764
Merge branch 'master' into dan/side-effect-counter-struct
dan-aztec Dec 13, 2023
0a4bbe2
update context.nr
dan-aztec Dec 13, 2023
ee8be04
bad merge on constants update
dan-aztec Dec 14, 2023
1c3a60c
add deserialize and rename is_zero to is_empty
dan-aztec Dec 14, 2023
980624f
rebuild protocol circuits
dan-aztec Dec 14, 2023
4ba1249
small fixes
dan-aztec Dec 14, 2023
17a5e04
recompile ts
dan-aztec Dec 14, 2023
1c5c57f
update noir-compiler snapshot
dan-aztec Dec 14, 2023
29da4c0
Merge branch 'master' into dan/side-effect-counter-struct
dan-aztec Dec 14, 2023
f5ad5a5
0
dan-aztec Dec 14, 2023
e780def
Merge branch 'dan/side-effect-counter-struct' of github.com:AztecProt…
dan-aztec Dec 14, 2023
25ad690
fix tobuffer/serialization method
dan-aztec Dec 14, 2023
20b4d4f
fix two tests but acvm failing
dan-aztec Dec 14, 2023
7e0e9ff
fix output notes
dan-aztec Dec 15, 2023
ef300c9
add some logs, having trouble with some failing tests
dan-aztec Dec 15, 2023
357bfd7
need to update e2e test output, but test fails
dan-aztec Dec 15, 2023
d624c34
Merge branch 'master' into dan/side-effect-counter-struct
dan-aztec Dec 16, 2023
2a19967
fix to_typescript, but now hash mismatch
dan-aztec Dec 18, 2023
c390e6d
Merge branch 'master' into dan/side-effect-counter-struct
dan-aztec Dec 18, 2023
c0da6d1
Merge branch 'master' into dan/side-effect-counter-struct
dan-aztec Dec 19, 2023
27a3b92
starting to pin down hash mismatch in PublicCircuitPublicInputs
dan-aztec Dec 21, 2023
80efea3
fix bad typesript hash on callrequest
dan-aztec Dec 21, 2023
3143a16
Merge branch 'master' into dan/side-effect-counter-struct
dan-aztec Dec 21, 2023
be6b215
update snapshots
dan-aztec Dec 21, 2023
833e812
fix: extraneous value in initial witness
sirasistant Jan 2, 2024
5612ebf
chore: update callstackitem size
sirasistant Jan 2, 2024
d1616e2
fix: read correctly the call stack item
sirasistant Jan 2, 2024
08ac709
tests: fix private execution tests
sirasistant Jan 2, 2024
42cdf4b
chore: update test fixtures
sirasistant Jan 2, 2024
d73ee27
test: fix noir tests
sirasistant Jan 2, 2024
4ca0a89
tests: fix public kernel tests
sirasistant Jan 2, 2024
9b5e1ea
test: fix noir tests
sirasistant Jan 2, 2024
fe5dae6
Merge branch 'master' into dan/side-effect-counter-struct
dan-aztec Jan 2, 2024
95103d2
revert clang formatting
dan-aztec Jan 2, 2024
b83c05a
fix bad merge on base_rollup_inputs.nr
dan-aztec Jan 2, 2024
d369666
sideEffect import
dan-aztec Jan 2, 2024
3fbd183
fix bad merge
dan-aztec Jan 2, 2024
bcd3c45
delete comments/cleanup
dan-aztec Jan 2, 2024
822d531
forgot some comments
dan-aztec Jan 3, 2024
aa5af63
test: undo snap change
sirasistant Jan 3, 2024
8ee5b3f
chore: various cleanups
sirasistant Jan 3, 2024
a7f9557
fix: use EMPTY_NULLIFIED_COMMITMENT
sirasistant Jan 3, 2024
26c35aa
wip removing nullified commitments
sirasistant Jan 3, 2024
34f3dee
feat: remove EMPTY_NULLIFIED_COMMITMENT
sirasistant Jan 3, 2024
92731c5
Merge branch 'master' into dan/side-effect-counter-struct
sirasistant Jan 3, 2024
2b15b87
chore: remove extraneous log
sirasistant Jan 3, 2024
e480699
chore: various chores
sirasistant Jan 3, 2024
115fd0a
fix: end sideffect counter in public inputs
sirasistant Jan 3, 2024
936d619
chore: format
sirasistant Jan 3, 2024
9c86396
Merge branch 'master' into dan/side-effect-counter-struct
sirasistant Jan 3, 2024
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
4 changes: 1 addition & 3 deletions barretenberg/cpp/.clang-format
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
PointerAlignment: Left
ColumnLimit: 120
BreakBeforeBraces: Allman
IndentWidth: 4
BinPackArguments: false
BinPackParameters: false
AllowShortFunctionsOnASingleLine: None
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated keys - git hook fails on os x with these present

Cpp11BracedListStyle: false
AlwaysBreakAfterReturnType: None
AlwaysBreakAfterDefinitionReturnType: None
Expand All @@ -25,4 +23,4 @@ BraceWrapping:
SplitEmptyRecord: false
SplitEmptyNamespace: false
AllowShortFunctionsOnASingleLine : Inline
SortIncludes: true
SortIncludes: true
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ template <typename NCT> struct CombinedAccumulatedData {
AggregationObject aggregation_object{};

std::array<fr, MAX_READ_REQUESTS_PER_TX> read_requests{};
std::array<fr, MAX_PENDING_READ_REQUESTS_PER_TX> pending_read_requests{};

std::array<fr, MAX_NEW_COMMITMENTS_PER_TX> new_commitments{};
std::array<fr, MAX_NEW_NULLIFIERS_PER_TX> new_nullifiers{};
Expand Down Expand Up @@ -61,7 +60,6 @@ template <typename NCT> struct CombinedAccumulatedData {
// for serialization, update with new fields
MSGPACK_FIELDS(aggregation_object,
read_requests,
pending_read_requests,
new_commitments,
new_nullifiers,
nullified_commitments,
Expand Down Expand Up @@ -100,7 +98,6 @@ template <typename NCT> struct CombinedAccumulatedData {
},

to_ct(read_requests),
to_ct(pending_read_requests),

to_ct(new_commitments),
to_ct(new_nullifiers),
Expand Down Expand Up @@ -141,7 +138,6 @@ template <typename NCT> struct CombinedAccumulatedData {
},

to_nt(read_requests),
to_nt(pending_read_requests),

to_nt(new_commitments),
to_nt(new_nullifiers),
Expand Down Expand Up @@ -172,7 +168,6 @@ template <typename NCT> struct CombinedAccumulatedData {
aggregation_object.add_proof_outputs_as_public_inputs();

set_array_public(read_requests);
set_array_public(pending_read_requests);

set_array_public(new_commitments);
set_array_public(new_nullifiers);
Expand Down
6 changes: 3 additions & 3 deletions circuits/cpp/src/aztec3/circuits/abis/packers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ struct ConstantsPacker {
MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL,
MAX_PUBLIC_DATA_READS_PER_CALL,
MAX_READ_REQUESTS_PER_CALL,
MAX_PENDING_READ_REQUESTS_PER_CALL,
MAX_NEW_COMMITMENTS_PER_TX,
MAX_NEW_NULLIFIERS_PER_TX,
MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX,
Expand All @@ -37,8 +36,7 @@ struct ConstantsPacker {
MAX_PUBLIC_DATA_READS_PER_TX,
MAX_NEW_CONTRACTS_PER_TX,
MAX_OPTIONALLY_REVEALED_DATA_LENGTH_PER_TX,
MAX_READ_REQUESTS_PER_TX,
MAX_PENDING_READ_REQUESTS_PER_TX),
MAX_READ_REQUESTS_PER_TX),
NVP(NUM_ENCRYPTED_LOGS_HASHES_PER_TX,
NUM_UNENCRYPTED_LOGS_HASHES_PER_TX,
NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP,
Expand Down Expand Up @@ -132,6 +130,7 @@ struct GeneratorIndexPacker {
int GLOBAL_VARIABLES = GeneratorIndex::GLOBAL_VARIABLES;
int PARTIAL_ADDRESS = GeneratorIndex::PARTIAL_ADDRESS;
int BLOCK_HASH = GeneratorIndex::BLOCK_HASH;
int SIDE_EFFECT = GeneratorIndex::SIDE_EFFECT;
int TX_REQUEST = GeneratorIndex::TX_REQUEST;
int SIGNATURE_PAYLOAD = GeneratorIndex::SIGNATURE_PAYLOAD;
int VK = GeneratorIndex::VK;
Expand Down Expand Up @@ -170,6 +169,7 @@ struct GeneratorIndexPacker {
GLOBAL_VARIABLES,
PARTIAL_ADDRESS,
BLOCK_HASH,
SIDE_EFFECT,
TX_REQUEST,
SIGNATURE_PAYLOAD,
VK,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ template <typename NCT> class PrivateCircuitPublicInputs {
std::array<fr, RETURN_VALUES_LENGTH> return_values{};

std::array<fr, MAX_READ_REQUESTS_PER_CALL> read_requests{};
std::array<fr, MAX_PENDING_READ_REQUESTS_PER_CALL> pending_read_requests{};

std::array<fr, MAX_NEW_COMMITMENTS_PER_CALL> new_commitments{};
std::array<fr, MAX_NEW_NULLIFIERS_PER_CALL> new_nullifiers{};
Expand Down Expand Up @@ -58,7 +57,6 @@ template <typename NCT> class PrivateCircuitPublicInputs {
args_hash,
return_values,
read_requests,
pending_read_requests,
new_commitments,
new_nullifiers,
nullified_commitments,
Expand All @@ -78,7 +76,7 @@ template <typename NCT> class PrivateCircuitPublicInputs {
{
return call_context == other.call_context && args_hash == other.args_hash &&
return_values == other.return_values && read_requests == other.read_requests &&
pending_read_requests == other.pending_read_requests && new_commitments == other.new_commitments &&
new_commitments == other.new_commitments &&
new_nullifiers == other.new_nullifiers && nullified_commitments == other.nullified_commitments &&
private_call_stack == other.private_call_stack && public_call_stack == other.public_call_stack &&
new_l2_to_l1_msgs == other.new_l2_to_l1_msgs && encrypted_logs_hash == other.encrypted_logs_hash &&
Expand All @@ -105,7 +103,6 @@ template <typename NCT> class PrivateCircuitPublicInputs {
to_ct(return_values),

to_ct(read_requests),
to_ct(pending_read_requests),

to_ct(new_commitments),
to_ct(new_nullifiers),
Expand Down Expand Up @@ -145,7 +142,6 @@ template <typename NCT> class PrivateCircuitPublicInputs {
to_nt(return_values),

to_nt(read_requests),
to_nt(pending_read_requests),

to_nt(new_commitments),
to_nt(new_nullifiers),
Expand Down Expand Up @@ -184,7 +180,6 @@ template <typename NCT> class PrivateCircuitPublicInputs {
spread_arr_into_vec(return_values, inputs);

spread_arr_into_vec(read_requests, inputs);
spread_arr_into_vec(pending_read_requests, inputs);

spread_arr_into_vec(new_commitments, inputs);
spread_arr_into_vec(new_nullifiers, inputs);
Expand Down Expand Up @@ -235,7 +230,6 @@ template <typename NCT> class OptionalPrivateCircuitPublicInputs {
std::array<opt_fr, RETURN_VALUES_LENGTH> return_values;

std::array<opt_fr, MAX_READ_REQUESTS_PER_CALL> read_requests;
std::array<opt_fr, MAX_PENDING_READ_REQUESTS_PER_CALL> pending_read_requests;

std::array<opt_fr, MAX_NEW_COMMITMENTS_PER_CALL> new_commitments;
std::array<opt_fr, MAX_NEW_NULLIFIERS_PER_CALL> new_nullifiers;
Expand Down Expand Up @@ -263,7 +257,6 @@ template <typename NCT> class OptionalPrivateCircuitPublicInputs {
args_hash,
return_values,
read_requests,
pending_read_requests,
new_commitments,
new_nullifiers,
nullified_commitments,
Expand All @@ -288,7 +281,6 @@ template <typename NCT> class OptionalPrivateCircuitPublicInputs {
std::array<opt_fr, RETURN_VALUES_LENGTH> const& return_values,

std::array<opt_fr, MAX_READ_REQUESTS_PER_CALL> const& read_requests,
std::array<opt_fr, MAX_PENDING_READ_REQUESTS_PER_CALL> const& pending_read_requests,

std::array<opt_fr, MAX_NEW_COMMITMENTS_PER_CALL> const& new_commitments,
std::array<opt_fr, MAX_NEW_NULLIFIERS_PER_CALL> const& new_nullifiers,
Expand All @@ -314,7 +306,6 @@ template <typename NCT> class OptionalPrivateCircuitPublicInputs {
, args_hash(args_hash)
, return_values(return_values)
, read_requests(read_requests)
, pending_read_requests(pending_read_requests)
, new_commitments(new_commitments)
, new_nullifiers(new_nullifiers)
, nullified_commitments(nullified_commitments)
Expand Down Expand Up @@ -342,7 +333,6 @@ template <typename NCT> class OptionalPrivateCircuitPublicInputs {
new_inputs.return_values.fill(std::nullopt);

new_inputs.read_requests.fill(std::nullopt);
new_inputs.pending_read_requests.fill(std::nullopt);

new_inputs.new_commitments.fill(std::nullopt);
new_inputs.new_nullifiers.fill(std::nullopt);
Expand Down Expand Up @@ -408,7 +398,6 @@ template <typename NCT> class OptionalPrivateCircuitPublicInputs {
make_unused_array_elements_zero(builder, return_values);

make_unused_array_elements_zero(builder, read_requests);
make_unused_array_elements_zero(builder, pending_read_requests);

make_unused_array_elements_zero(builder, new_commitments);
make_unused_array_elements_zero(builder, new_nullifiers);
Expand Down Expand Up @@ -448,7 +437,6 @@ template <typename NCT> class OptionalPrivateCircuitPublicInputs {
set_array_public(return_values);

set_array_public(read_requests);
set_array_public(pending_read_requests);

set_array_public(new_commitments);
set_array_public(new_nullifiers);
Expand Down Expand Up @@ -490,7 +478,6 @@ template <typename NCT> class OptionalPrivateCircuitPublicInputs {
to_ct(return_values),

to_ct(read_requests),
to_ct(pending_read_requests),

to_ct(new_commitments),
to_ct(new_nullifiers),
Expand Down Expand Up @@ -532,7 +519,6 @@ template <typename NCT> class OptionalPrivateCircuitPublicInputs {
to_nt(return_values),

to_nt(read_requests),
to_nt(pending_read_requests),

to_nt(new_commitments),
to_nt(new_nullifiers),
Expand Down Expand Up @@ -575,7 +561,6 @@ template <typename NCT> class OptionalPrivateCircuitPublicInputs {
spread_arr_opt_into_vec(return_values, inputs);

spread_arr_opt_into_vec(read_requests, inputs);
spread_arr_opt_into_vec(pending_read_requests, inputs);

spread_arr_opt_into_vec(new_commitments, inputs);
spread_arr_opt_into_vec(new_nullifiers, inputs);
Expand Down Expand Up @@ -613,7 +598,6 @@ template <typename NCT> class OptionalPrivateCircuitPublicInputs {
.return_values = map(return_values, get_value),

.read_requests = map(read_requests, get_value),
.pending_read_requests = map(pending_read_requests, get_value),

.new_commitments = map(new_commitments, get_value),
.new_nullifiers = map(new_nullifiers, get_value),
Expand Down
3 changes: 0 additions & 3 deletions circuits/cpp/src/aztec3/circuits/kernel/private/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ void common_validate_arrays(DummyBuilder& builder, PrivateCircuitPublicInputs<NT
// to push_array_to_array() routines which rely on the passed arrays to be well-formed.
validate_array(builder, app_public_inputs.return_values, "App public inputs - Return values");
validate_array(builder, app_public_inputs.read_requests, "App public inputs - Read requests");
validate_array(builder, app_public_inputs.pending_read_requests, "App public inputs - Pending read requests");
validate_array(builder, app_public_inputs.new_commitments, "App public inputs - New commitments");
validate_array(builder, app_public_inputs.new_nullifiers, "App public inputs - New nullifiers");
validate_array(builder, app_public_inputs.nullified_commitments, "App public inputs - Nullified commitments");
Expand All @@ -152,7 +151,6 @@ void common_validate_previous_kernel_arrays(DummyBuilder& builder, CombinedAccum
{
// Each of the following arrays is expected to be zero-padded.
validate_array(builder, end.read_requests, "Accumulated data - Read Requests");
validate_array(builder, end.pending_read_requests, "Accumulated data - Pending read Requests");
validate_array(builder, end.new_commitments, "Accumulated data - New commitments");
validate_array(builder, end.new_nullifiers, "Accumulated data - New nullifiers");
validate_array(builder, end.nullified_commitments, "Accumulated data - Nullified commitments");
Expand Down Expand Up @@ -183,7 +181,6 @@ void common_update_end_values(DummyBuilder& builder,
const auto& read_requests = private_call_public_inputs.read_requests;
const auto& read_request_membership_witnesses = private_call.read_request_membership_witnesses;

// don't update pending_read_requests, because those just get passed through without any change

const auto& new_commitments = private_call_public_inputs.new_commitments;
const auto& new_nullifiers = private_call_public_inputs.new_nullifiers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ void update_end_values(DummyCircuitBuilder& builder,
builder.do_assert(is_array_empty(public_inputs.end.read_requests),
"public_inputs.end.read_requests must start as empty in initial kernel iteration",
CircuitErrorCode::PRIVATE_KERNEL__UNSUPPORTED_OP);
builder.do_assert(is_array_empty(public_inputs.end.pending_read_requests),
"public_inputs.end.pending_read_requests must start as empty in initial kernel iteration",
CircuitErrorCode::PRIVATE_KERNEL__UNSUPPORTED_OP);
builder.do_assert(public_inputs.end.encrypted_log_preimages_length == NT::fr(0),
"public_inputs.end.encrypted_log_preimages_length must start as 0 in initial kernel iteration",
CircuitErrorCode::PRIVATE_KERNEL__UNSUPPORTED_OP);
Expand Down
7 changes: 2 additions & 5 deletions circuits/cpp/src/aztec3/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ constexpr size_t MAX_NEW_L2_TO_L1_MSGS_PER_CALL = 2;
constexpr size_t MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 16;
constexpr size_t MAX_PUBLIC_DATA_READS_PER_CALL = 16;
constexpr size_t MAX_READ_REQUESTS_PER_CALL = 32;
constexpr size_t MAX_PENDING_READ_REQUESTS_PER_CALL = MAX_READ_REQUESTS_PER_CALL;


// "PER TRANSACTION" CONSTANTS
Expand All @@ -66,8 +65,6 @@ constexpr size_t MAX_PUBLIC_DATA_READS_PER_TX = 16;
constexpr size_t MAX_NEW_CONTRACTS_PER_TX = 1;
constexpr size_t MAX_OPTIONALLY_REVEALED_DATA_LENGTH_PER_TX = 4;
constexpr size_t MAX_READ_REQUESTS_PER_TX = MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL * MAX_READ_REQUESTS_PER_CALL;
constexpr size_t MAX_PENDING_READ_REQUESTS_PER_TX =
MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL * MAX_PENDING_READ_REQUESTS_PER_CALL;
constexpr size_t NUM_ENCRYPTED_LOGS_HASHES_PER_TX = 1;
constexpr size_t NUM_UNENCRYPTED_LOGS_HASHES_PER_TX = 1;
// docs:end:constants
Expand Down Expand Up @@ -324,15 +321,15 @@ constexpr size_t CONTRACT_DEPLOYMENT_DATA_LENGTH = 6;
// should change this constant as well as the offsets in private_call_stack_item.nr
constexpr size_t PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH =
CALL_CONTEXT_LENGTH + 1 // +1 for args_hash
+ RETURN_VALUES_LENGTH + MAX_READ_REQUESTS_PER_CALL + MAX_PENDING_READ_REQUESTS_PER_CALL +
+ RETURN_VALUES_LENGTH + MAX_READ_REQUESTS_PER_CALL +
MAX_NEW_COMMITMENTS_PER_CALL + 2 * MAX_NEW_NULLIFIERS_PER_CALL + MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL +
MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL + MAX_NEW_L2_TO_L1_MSGS_PER_CALL + NUM_FIELDS_PER_SHA256 +
NUM_FIELDS_PER_SHA256 + 2 // + 2 for logs preimage lengths
+ BLOCK_HEADER_LENGTH + CONTRACT_DEPLOYMENT_DATA_LENGTH + 2; // + 2 for chain_id and version

constexpr size_t PRIVATE_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH =
1 + 1 // call_context_hash + args_hash
+ RETURN_VALUES_LENGTH + MAX_READ_REQUESTS_PER_CALL + MAX_PENDING_READ_REQUESTS_PER_CALL +
+ RETURN_VALUES_LENGTH + MAX_READ_REQUESTS_PER_CALL +
MAX_NEW_COMMITMENTS_PER_CALL + 2 * MAX_NEW_NULLIFIERS_PER_CALL + MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL +
MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL + MAX_NEW_L2_TO_L1_MSGS_PER_CALL + NUM_FIELDS_PER_SHA256 +
NUM_FIELDS_PER_SHA256 + 2 // + 2 for logs preimage lengths
Expand Down
12 changes: 5 additions & 7 deletions l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ library Constants {
uint256 internal constant MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 16;
uint256 internal constant MAX_PUBLIC_DATA_READS_PER_CALL = 16;
uint256 internal constant MAX_READ_REQUESTS_PER_CALL = 32;
uint256 internal constant MAX_PENDING_READ_REQUESTS_PER_CALL = 32;
uint256 internal constant MAX_NEW_COMMITMENTS_PER_TX = 64;
uint256 internal constant MAX_NEW_NULLIFIERS_PER_TX = 64;
uint256 internal constant MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX = 8;
Expand All @@ -35,7 +34,6 @@ library Constants {
uint256 internal constant MAX_NEW_CONTRACTS_PER_TX = 1;
uint256 internal constant MAX_OPTIONALLY_REVEALED_DATA_LENGTH_PER_TX = 4;
uint256 internal constant MAX_READ_REQUESTS_PER_TX = 128;
uint256 internal constant MAX_PENDING_READ_REQUESTS_PER_TX = 128;
uint256 internal constant NUM_ENCRYPTED_LOGS_HASHES_PER_TX = 1;
uint256 internal constant NUM_UNENCRYPTED_LOGS_HASHES_PER_TX = 1;
uint256 internal constant NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP = 16;
Expand Down Expand Up @@ -69,19 +67,19 @@ library Constants {
uint256 internal constant GET_NOTE_ORACLE_RETURN_LENGTH = 23;
uint256 internal constant MAX_NOTES_PER_PAGE = 10;
uint256 internal constant VIEW_NOTE_ORACLE_RETURN_LENGTH = 212;
uint256 internal constant CALL_CONTEXT_LENGTH = 7;
uint256 internal constant CALL_CONTEXT_LENGTH = 8;
uint256 internal constant BLOCK_HEADER_LENGTH = 7;
uint256 internal constant FUNCTION_DATA_LENGTH = 4;
uint256 internal constant CONTRACT_DEPLOYMENT_DATA_LENGTH = 6;
uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 155;
uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 235;
uint256 internal constant CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH = 3;
uint256 internal constant CONTRACT_STORAGE_READ_LENGTH = 2;
uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 142;
uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 190;
uint256 internal constant GET_NOTES_ORACLE_RETURN_LENGTH = 674;
uint256 internal constant EMPTY_NULLIFIED_COMMITMENT = 1000000;
uint256 internal constant CALL_PRIVATE_FUNCTION_RETURN_SIZE = 161;
uint256 internal constant CALL_PRIVATE_FUNCTION_RETURN_SIZE = 210;
uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH = 87;
uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH = 144;
uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH = 192;
uint256 internal constant COMMITMENTS_NUM_BYTES_PER_BASE_ROLLUP = 2048;
uint256 internal constant NULLIFIERS_NUM_BYTES_PER_BASE_ROLLUP = 2048;
uint256 internal constant PUBLIC_DATA_WRITES_NUM_BYTES_PER_BASE_ROLLUP = 1024;
Expand Down
2 changes: 1 addition & 1 deletion noir/noir_stdlib/src/eddsa.nr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::hash::poseidon;
use crate::ec::consts::te::baby_jubjub;
use crate::ec::tecurve::affine::Point as TEPoint;
// Returns true if x is less than y
fn lt_bytes32(x: Field, y: Field) -> bool {
pub fn lt_bytes32(x: Field, y: Field) -> bool {
let x_bytes = x.to_le_bytes(32);
let y_bytes = y.to_le_bytes(32);
let mut x_is_lt = false;
Expand Down
Loading
Loading