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 apps & fee support to AVM simulator and AVM bb-prover tests #11323

Merged
merged 6 commits into from
Jan 28, 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
4 changes: 3 additions & 1 deletion barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,9 @@ void AvmTraceBuilder::pay_fee()
// TS equivalent:
// computeFeePayerBalanceStorageSlot(fee_payer);
std::vector<FF> slot_hash_inputs = { FEE_JUICE_BALANCES_SLOT, public_inputs.fee_payer };
const auto balance_slot = poseidon2_trace_builder.poseidon2_hash(slot_hash_inputs, clk, Poseidon2Caller::SILO);
// TODO: do constrained slot derivations!
// const auto balance_slot = poseidon2_trace_builder.poseidon2_hash(slot_hash_inputs, clk, Poseidon2Caller::SILO);
const auto balance_slot = Poseidon2::hash(slot_hash_inputs);

Comment on lines 324 to 328
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was broken! I think because this was calling the poseidon gadget without an execution trace row. I can throw this in another PR if this PR ends up being at all controversial/long-lived.

// ** Read the balance before fee payment **
// TS equivalent:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,14 @@ contract AvmTest {
* be optimized away.
************************************************************************/
#[public]
fn bulk_testing(args_field: [Field; 10], args_u8: [u8; 10]) {
fn bulk_testing(
args_field: [Field; 10],
args_u8: [u8; 10],
get_instance_for_address: AztecAddress,
expected_deployer: AztecAddress,
expected_class_id: ContractClassId,
expected_initialization_hash: Field,
) {
dep::aztec::oracle::debug_log::debug_log("set_storage_single");
set_storage_single(30);
dep::aztec::oracle::debug_log::debug_log("set_storage_list");
Expand All @@ -692,9 +699,12 @@ contract AvmTest {
dep::aztec::oracle::debug_log::debug_log("pedersen_hash_with_index");
let _ = pedersen_hash_with_index(args_field);
dep::aztec::oracle::debug_log::debug_log("test_get_contract_instance");
// address should match yarn-project/simulator/src/public/fixtures/index.ts's
// MockedAvmTestContractDataSource.otherContractInstance
test_get_contract_instance(AztecAddress::from_field(0x4444));
test_get_contract_instance_matches(
get_instance_for_address,
expected_deployer,
expected_class_id,
expected_initialization_hash,
);
dep::aztec::oracle::debug_log::debug_log("get_address");
let _ = get_address();
dep::aztec::oracle::debug_log::debug_log("get_sender");
Expand Down
2 changes: 2 additions & 0 deletions yarn-project/bb-prover/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
"devDependencies": {
"@aztec/ethereum": "workspace:^",
"@aztec/kv-store": "workspace:^",
"@aztec/noir-contracts.js": "workspace:^",
"@aztec/protocol-contracts": "workspace:^",
dbanks12 marked this conversation as resolved.
Show resolved Hide resolved
"@aztec/types": "workspace:^",
"@jest/globals": "^29.5.0",
"@types/jest": "^29.5.0",
Expand Down
Loading
Loading