Skip to content

Commit

Permalink
fix: dirty rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 committed Jan 18, 2025
1 parent 5fcc672 commit 06d7a31
Show file tree
Hide file tree
Showing 25 changed files with 501 additions and 501 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"yarn-project/aztec": "0.71.0",
"barretenberg": "0.71.0",
"barretenberg/ts": "0.71.0"
}
}
748 changes: 472 additions & 276 deletions barretenberg/ts/CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion barretenberg/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@
"webpack-dev-server": "^4.15.0",
"worker-loader": "^3.0.8"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[app_public_inputs.historical_header.state.l1_to_l2_message_tree]
root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000080"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050"

[app_public_inputs.historical_header.state.partial.note_hash_tree]
root = "0x0a17550139b25759dfb5ffb96aadf7463293b4d61ccc033e2e02a894d1dfb6bb"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ claimed_first_nullifier = "0x1c494a56b9781c466405f63904ecd9a4253c4473c4243025f8d

[previous_kernel_public_inputs.constants.historical_header.state.l1_to_l2_message_tree]
root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000080"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050"

[previous_kernel_public_inputs.constants.historical_header.state.partial.note_hash_tree]
root = "0x0a17550139b25759dfb5ffb96aadf7463293b4d61ccc033e2e02a894d1dfb6bb"
Expand Down Expand Up @@ -6515,7 +6515,7 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[app_public_inputs.historical_header.state.l1_to_l2_message_tree]
root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000080"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050"

[app_public_inputs.historical_header.state.partial.note_hash_tree]
root = "0x0a17550139b25759dfb5ffb96aadf7463293b4d61ccc033e2e02a894d1dfb6bb"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ claimed_first_nullifier = "0x29ad545dcad1584eae312702f7c4dbae93b65334000b6b340db

[previous_kernel_public_inputs.constants.historical_header.state.l1_to_l2_message_tree]
root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000080"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050"

[previous_kernel_public_inputs.constants.historical_header.state.partial.note_hash_tree]
root = "0x0a17550139b25759dfb5ffb96aadf7463293b4d61ccc033e2e02a894d1dfb6bb"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ claimed_first_nullifier = "0x29ad545dcad1584eae312702f7c4dbae93b65334000b6b340db

[previous_kernel_public_inputs.constants.historical_header.state.l1_to_l2_message_tree]
root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000080"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050"

[previous_kernel_public_inputs.constants.historical_header.state.partial.note_hash_tree]
root = "0x0a17550139b25759dfb5ffb96aadf7463293b4d61ccc033e2e02a894d1dfb6bb"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ claimed_first_nullifier = "0x1c494a56b9781c466405f63904ecd9a4253c4473c4243025f8d

[previous_kernel_public_inputs.constants.historical_header.state.l1_to_l2_message_tree]
root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000080"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050"

[previous_kernel_public_inputs.constants.historical_header.state.partial.note_hash_tree]
root = "0x0a17550139b25759dfb5ffb96aadf7463293b4d61ccc033e2e02a894d1dfb6bb"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protocol_contract_tree_root = "0x0586d6158689bcc36f32f0e2e351cfe7b3be422add44055

[inputs.tube_data.public_inputs.constants.historical_header.state.l1_to_l2_message_tree]
root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000070"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050"

[inputs.tube_data.public_inputs.constants.historical_header.state.partial.note_hash_tree]
root = "0x0a17550139b25759dfb5ffb96aadf7463293b4d61ccc033e2e02a894d1dfb6bb"
Expand Down Expand Up @@ -5240,7 +5240,7 @@ fee_write_sibling_path = [
]

[inputs.archive_root_membership_witness]
leaf_index = "7"
leaf_index = "5"
sibling_path = [
"0x0ab953051018e13053816017f9f28b07e95dae2d85cced764d47b115f36b02c8",
"0x0b63a53787021a4a962a452c2921b3663aff1ffd8d5510540f8e659e782956f1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protocol_contract_tree_root = "0x0586d6158689bcc36f32f0e2e351cfe7b3be422add44055

[inputs.tube_data.public_inputs.constants.historical_header.state.l1_to_l2_message_tree]
root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000080"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050"

[inputs.tube_data.public_inputs.constants.historical_header.state.partial.note_hash_tree]
root = "0x0a17550139b25759dfb5ffb96aadf7463293b4d61ccc033e2e02a894d1dfb6bb"
Expand Down Expand Up @@ -3511,7 +3511,7 @@ reverted = false

[inputs.avm_proof_data.public_inputs.start_tree_snapshots.l1_to_l2_message_tree]
root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6"
next_available_leaf_index = "0x00000000000000000000000000000000000000000000000000000000000000a0"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000070"

[inputs.avm_proof_data.public_inputs.start_tree_snapshots.note_hash_tree]
root = "0x240ed7360e4ebefb2394ea93644b2789263d460d2a5fb334cbbf478b7f9e5172"
Expand Down Expand Up @@ -4849,7 +4849,7 @@ inner = "0x0000000000000000000000000000000000000000000000000000000000000000"

[inputs.avm_proof_data.public_inputs.end_tree_snapshots.l1_to_l2_message_tree]
root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6"
next_available_leaf_index = "0x00000000000000000000000000000000000000000000000000000000000000a0"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000070"

[inputs.avm_proof_data.public_inputs.end_tree_snapshots.note_hash_tree]
root = "0x240ed7360e4ebefb2394ea93644b2789263d460d2a5fb334cbbf478b7f9e5172"
Expand Down Expand Up @@ -19069,7 +19069,7 @@ public_data_tree_sibling_paths = [
]

[inputs.archive_root_membership_witness]
leaf_index = "8"
leaf_index = "5"
sibling_path = [
"0x0ab953051018e13053816017f9f28b07e95dae2d85cced764d47b115f36b02c8",
"0x208f92a13694549692dfec01f4aa84d79010d453fb94aea1c890f25e253b4e66",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3399,10 +3399,6 @@ prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051"
root = "0x08eab7f7684fd6e62e17a138a0a7d98fc68efe59a1adb0744a377f81b85e86f8"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000008"

[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.new_archive]
root = "0x1566582e6653f16bc9df9431aeb78df062bf2700872597c2c497d5fd9f9b1fb2"
next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000009"

[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables]
chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69"
version = "0x0000000000000000000000000000000000000000000000000000000000000001"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,97 +193,4 @@ pub(crate) mod tests {

let _ = builder.execute();
}

#[test]
unconstrained fn correct_block_root_rollup_output() {
let builder = TestBuilder::new().mock_evaluate_blobs();

let output = builder.execute();

let left_rollup = builder.previous_rollup_data[0].base_or_merge_rollup_public_inputs;
let right_rollup = builder.previous_rollup_data[1].base_or_merge_rollup_public_inputs;

assert_eq(output.previous_archive, left_rollup.constants.last_archive);
assert(output.new_archive != output.previous_archive);
assert_eq(output.start_global_variables, left_rollup.constants.global_variables);
assert_eq(output.end_global_variables, left_rollup.constants.global_variables);

let expected_out_hash = accumulate_sha256([left_rollup.out_hash, right_rollup.out_hash]);
assert_eq(output.out_hash, expected_out_hash);

let expected_fee = FeeRecipient {
recipient: left_rollup.constants.global_variables.coinbase,
value: left_rollup.accumulated_fees + right_rollup.accumulated_fees,
};
assert_array_eq(output.fees, [expected_fee]);
}

#[test]
fn correct_blob_with_non_empty_fields() {
// Note: this test will not run in unconstrained, because it reaches the foreign call
// TODO(#10323): remove the oracle and switch this test to unconstrained

// The below values are generated from block_building_helper.test.ts.
let blob_fields_0 = [
0x000000000000000000000000000000000074785f737461727400000500010000,
0x000000000000000000000000000000000000000000000000000000000000002a,
0x0002000000000000000000000000000000000000000000000000000000000000,
0x0000000000000000000000000000000000000000000000000000000004000001,
0x0000000000000000000000000000000000000000000000000000000000000123,
];
let blob_fields_1 = [
0x000000000000000000000000000000000074785f737461727400000700010000,
0x000000000000000000000000000000000000000000000000000000000000002b,
0x0002000000000000000000000000000000000000000000000000000000000000,
0x0000000000000000000000000000000000000000000000000000000003000001,
0x0000000000000000000000000000000000000000000000000000000000006789,
0x0000000000000000000000000000000000000000000000000000000004000001,
0x0000000000000000000000000000000000000000000000000000000000000045,
];
let expected_blob_commitment = [
0x008c32fe581c8fdba12c0d7597911dead2d937d68525bae655508412bb53bb98,
0x0000000000000000000000000000006aaa0680f21270e7d8de4e19da5164f95c,
];
let expected_blobs_hash =
0x00a965619c8668b834755678b32d023b9c5e8588ce449f44f7fa9335455b5cc5;
let expected_z = 0x1f92b871671f27a378d23f1cef10fbd8f0d90dd7172da9e3c3fc1aa745a072c3;

let mut builder = TestBuilder::new_with_blobs_fields(blob_fields_0, blob_fields_1);
builder.data.blob_commitments[0].inner = expected_blob_commitment;
builder.data.blobs_hash = expected_blobs_hash;

let output = builder.execute();

let start_sponge_blob =
builder.previous_rollup_data[0].base_or_merge_rollup_public_inputs.start_sponge_blob;
let end_sponge_blob =
builder.previous_rollup_data[1].base_or_merge_rollup_public_inputs.end_sponge_blob;
let blobs_fields = array_concat(blob_fields_0, blob_fields_1);
let mut expected_sponge = start_sponge_blob;
expected_sponge.absorb(blobs_fields, blobs_fields.len());
assert(!end_sponge_blob.eq(start_sponge_blob));
assert(end_sponge_blob.eq(expected_sponge));

let hashed_tx_effects = expected_sponge.squeeze();
let computed_z = Poseidon2::hash(
[hashed_tx_effects, expected_blob_commitment[0], expected_blob_commitment[1]],
3,
);
assert_eq(computed_z, expected_z);
assert_eq(output.blob_public_inputs[0].inner[0].z, expected_z);
assert_eq(
output.blob_public_inputs[0].inner[0].kzg_commitment.inner,
expected_blob_commitment,
);
}

#[test(should_fail_with = "block's first blob sponge was not empty")]
unconstrained fn non_empty_start_blob_fails() {
let mut builder = TestBuilder::new();

builder.previous_rollup_data[0].base_or_merge_rollup_public_inputs.start_sponge_blob.fields =
1;

let _ = builder.execute();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000
"0x2bfe76f395d6323a7ad5e2886a16de302df81f0780887c37818d2733df2d4c65",
"0x15dd83badec3e098e06bbd95925d30001e832ace6a7f4c4580665be5dc1a10e9"
]
cache_size = "0x0000000000000000000000000000000000000000000000000000000000000002"
cache_size = "0x0000000000000000000000000000000000000000000000000000000000000003"
squeeze_mode = false

[inputs.previous_rollup_data.proof]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3443,10 +3443,10 @@ prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051"
inner = "0x000000000000000000000000ad0df4c37133fd475d440a4cd5fd5d8366209721"

[[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees]]
value = "0x000000000000000000000000000000000000000000000000001057ce82718190"
value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees.recipient]
inner = "0x0000000000000000000000008043b75809c29debab25045670017d0468d1ed6a"
inner = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees]]
value = "0x0000000000000000000000000000000000000000000000000000000000000000"
Expand Down Expand Up @@ -3775,19 +3775,19 @@ z = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs]]
[[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner]]
z = "0x0698067eb007e0104c543ff0a17eeca7feb1ae7b4e9bcdcb1e8a71ecda4e08ba"
z = "0x0000000000000000000000000000000000000000000000000000000000000000"

[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner.y]
limbs = [
"0xc0fb86ef7a6ca8e55a5af91f9dd81e",
"0xd13c5c9920d37bc235ced3def0f6b1",
"0x2d66"
"0x000000000000000000000000000000",
"0x000000000000000000000000000000",
"0x0000"
]

[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner.kzg_commitment]
inner = [
"0x00954f3d403cc21aeebe254e7753b8fefccf7bb4482afac18b6bacc8db10d16e",
"0x0000000000000000000000000000002a74c5ff9e06623e544aca2e9515de8d8c"
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000"
]

[[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::collections::BTreeMap;
use crate::ssa::{
ir::{
basic_block::BasicBlockId,
dfg::DataFlowGraph,
function::{Function, FunctionId},
map::SparseMap,
post_order::PostOrder,
Expand All @@ -26,7 +25,7 @@ impl Ssa {
let mut context = Context::default();
context.populate_functions(&self.functions);
for function in self.functions.values_mut() {
context.normalize_ids(function, &self.globals.dfg);
context.normalize_ids(function);
}
self.functions = context.functions.into_btree();
}
Expand Down Expand Up @@ -66,7 +65,7 @@ impl Context {
}
}

fn normalize_ids(&mut self, old_function: &mut Function, globals: &DataFlowGraph) {
fn normalize_ids(&mut self, old_function: &mut Function) {
self.new_ids.blocks.clear();
self.new_ids.values.clear();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ impl<'a> FunctionContext<'a> {

let definitions = HashMap::default();
let mut this = Self { definitions, builder, shared_context, loops: Vec::new() };
this.add_globals();
this.add_parameters_to_scope(parameters);
this
}
Expand All @@ -147,12 +146,6 @@ impl<'a> FunctionContext<'a> {
self.add_parameters_to_scope(&func.parameters);
}

fn add_globals(&mut self) {
for (_, value) in self.shared_context.globals_context.dfg.values_iter() {
self.builder.current_function.dfg.make_global(value.get_type().into_owned());
}
}

/// Add each parameter to the current scope, and return the list of parameter types.
///
/// The returned parameter type list will be flattened, so any struct parameters will
Expand Down
1 change: 0 additions & 1 deletion noir/noir-repo/tooling/lsp/src/requests/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ use noirc_frontend::{
def_map::{CrateDefMap, LocalModuleId, ModuleDefId, ModuleId},
resolution::visibility::{
item_in_module_is_visible, method_call_is_visible, struct_member_is_visible,
trait_member_is_visible,
},
},
hir_def::traits::Trait,
Expand Down
2 changes: 1 addition & 1 deletion spartan/aztec-network/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ ethereum:
externalHost: ""
replicas: 1
chainId: 1337
blockTime: 12sec
blockTime: 12
extraAccounts: 10
# 1 billion gas limit
# helps ensure we can deploy public contracts
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@
"engines": {
"node": ">=18"
}
}
}
41 changes: 0 additions & 41 deletions yarn-project/bb-prover/src/avm_proving.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,47 +290,6 @@ describe('AVM WitGen, "check circuit" tests', () => {
},
TIMEOUT,
);
it(
'Should prove and verify multiple app logic enqueued calls (set storage in first call, read it in next)',
async () => {
await proveAndVerifyAvmTestContract(
/*checkCircuitOnly=*/ true,
/*setupFunctionNames=*/ [],
/*setupArgs=*/ [],
/*appFunctionNames=*/ ['set_storage_single', 'read_assert_storage_single'],
/*appArgs=*/ [[new Fr(5)], [new Fr(5)]],
);
},
TIMEOUT,
);
it(
'Should prove and verify multiple app logic enqueued calls (like `enqueue_public_from_private`)',
async () => {
await proveAndVerifyAvmTestContract(
/*checkCircuitOnly=*/ true,
/*setupFunctionNames=*/ [],
/*setupArgs=*/ [],
/*appFunctionNames=*/ ['set_opcode_u8', 'set_read_storage_single'],
/*appArgs=*/ [[], [new Fr(5)]],
);
},
TIMEOUT,
);
it.skip(
'Should prove and verify enqueued calls in every phase, with enqueued calls that depend on each other',
async () => {
await proveAndVerifyAvmTestContract(
/*checkCircuitOnly=*/ true,
/*setupFunctionNames=*/ ['read_assert_storage_single', 'set_storage_single'],
/*setupArgs=*/ [[new Fr(0)], [new Fr(5)]],
/*appFunctionNames=*/ ['read_assert_storage_single', 'set_storage_single'],
/*appArgs=*/ [[new Fr(5)], [new Fr(10)]],
/*teardownFunctionName=*/ 'read_assert_storage_single',
/*teardownArgs=*/ [new Fr(10)],
);
},
TIMEOUT,
);
});

/**
Expand Down
Loading

0 comments on commit 06d7a31

Please sign in to comment.