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

feat!: Brillig with a stack and conditional inlining [WIP] #8989

Open
wants to merge 38 commits into
base: master
Choose a base branch
from

Conversation

sirasistant
Copy link
Contributor

Please read contributing guidelines and remove this line.

@sirasistant sirasistant changed the title feat: Brillig with a stack and conditional inlining (WIP) feat: Brillig with a stack and conditional inlining [WIP] Oct 3, 2024
@sirasistant sirasistant marked this pull request as ready for review October 3, 2024 10:51
@sirasistant
Copy link
Contributor Author

Just taking out of draft to get some size metrics

Copy link
Contributor

github-actions bot commented Oct 3, 2024

Changes to public function bytecode sizes

Generated at commit: 603a5d2047c8f3f24aa3f0fed6c2de0739545e67, compared to commit: b62235ed75b55f79fd84a5ebf1a1f5af28fa289a

🧾 Summary (100% most significant diffs)

Program Bytecode size in bytes (+/-) %
AvmTest::elliptic_curve_add_and_double +522 ❌ +305.26%
AvmTest::assertion_failure +97 ❌ +115.48%
Child::set_value_with_two_nested_calls +621 ❌ +84.15%
AvmTest::get_transaction_fee +37 ❌ +53.62%
AvmTest::get_sender +37 ❌ +53.62%
AvmTest::get_storage_address +37 ❌ +53.62%
AvmTest::get_version +37 ❌ +53.62%
AvmTest::get_fee_per_da_gas +37 ❌ +53.62%
AvmTest::get_block_number +37 ❌ +53.62%
AvmTest::get_address +37 ❌ +53.62%
AvmTest::get_da_gas_left +37 ❌ +53.62%
AvmTest::get_chain_id +37 ❌ +53.62%
AvmTest::set_opcode_u8 +37 ❌ +53.62%
AvmTest::get_fee_per_l2_gas +37 ❌ +53.62%
AvmTest::get_timestamp +37 ❌ +53.62%
AvmTest::get_l2_gas_left +37 ❌ +53.62%
AvmTest::new_note_hash +37 ❌ +52.86%
AvmTest::new_nullifier +37 ❌ +52.86%
Test::emit_nullifier_public +37 ❌ +52.86%
AvmTest::set_opcode_u32 +37 ❌ +50.68%
AvmTest::nullifier_collision +37 ❌ +48.68%
AvmTest::set_opcode_u64 +37 ❌ +48.05%
DocsExample::spend_public_authwit +37 ❌ +46.84%
AvmTest::send_l2_to_l1_msg +37 ❌ +46.25%
Test::create_l2_to_l1_message_arbitrary_recipient_public +37 ❌ +46.25%
Test::dummy_public_call +37 ❌ +44.05%
AvmTest::set_opcode_small_field +37 ❌ +43.53%
AvmTest::add_args_return +37 ❌ +43.02%
AvmTest::nullifier_exists +41 ❌ +41.00%
AvmTest::modulo2 +37 ❌ +40.66%
AvmTest::l1_to_l2_msg_exists +41 ❌ +40.59%
AvmTest::note_hash_exists +41 ❌ +40.59%
AvmTest::assert_timestamp +37 ❌ +40.22%
Test::is_time_equal +37 ❌ +37.76%
AvmTest::set_opcode_big_field +37 ❌ +36.63%
AvmTest::set_opcode_really_big_field +37 ❌ +36.63%
AvmTest::assert_nullifier_exists +37 ❌ +35.58%
AvmTest::emit_nullifier_and_check +37 ❌ +33.64%
AvmTest::assert_same +33 ❌ +32.67%
InclusionProofs::push_nullifier_public +37 ❌ +32.17%
Child::pub_get_value +33 ❌ +26.83%
InclusionProofs::test_nullifier_inclusion_from_public +37 ❌ +25.69%
AvmTest::get_function_selector +37 ❌ +24.83%
AvmTest::check_selector +37 ❌ +22.56%
StaticChild::pub_get_value +33 ❌ +22.15%
AvmTest::add_u128 +33 ❌ +17.46%
Parent::pub_entry_point_twice +179 ❌ +17.06%
AvmTest::set_storage_single +37 ❌ +16.67%
Test::assert_public_global_vars +37 ❌ +16.30%
DelegatedOn::public_set_value +37 ❌ +16.23%
AvmTest::to_radix_le +37 ❌ +16.09%
AvmTest::set_storage_list +37 ❌ +15.23%
DocsExample::update_leader +37 ❌ +13.17%
Router::_check_block_number +144 ❌ +12.20%
Router::_check_timestamp +144 ❌ +12.03%
Child::pub_set_value +37 ❌ +11.78%
StaticChild::pub_set_value +37 ❌ +11.78%
AvmTest::return_oracle +37 ❌ +11.28%
NFT::_store_point_in_transient_storage +37 ❌ +10.79%
FPC::pay_refund_with_shielded_rebate +164 ❌ +10.64%
AvmTest::pedersen_commit +37 ❌ +10.57%
AvmTest::test_get_contract_instance_raw +37 ❌ +10.14%
DocsExample::get_shared_immutable_constrained_public_indirect +41 ❌ +9.74%
TokenBlacklist::_reduce_total_supply +80 ❌ +9.07%
Token::_reduce_total_supply +80 ❌ +9.07%
AvmTest::assert_calldata_copy +37 ❌ +8.67%
Lending::init +234 ❌ +8.46%
AvmTest::read_storage_single +37 ❌ +8.41%
AvmTest::variable_base_msm +37 ❌ +8.37%
AvmTest::keccak_f1600 +37 ❌ +7.96%
Uniswap::_assert_token_is_same +37 ❌ +7.92%
AvmInitializerTest::read_storage_immutable +37 ❌ +7.63%
Child::public_dispatch +413 ❌ +7.52%
NFT::public_get_symbol +37 ❌ +7.31%
TokenBridge::get_token +37 ❌ +7.31%
Token::get_admin +37 ❌ +7.31%
NFT::get_admin +37 ❌ +7.24%
NFT::public_get_name +37 ❌ +7.24%
Token::public_get_symbol +37 ❌ +7.24%
Token::public_get_name +37 ❌ +7.24%
AvmTest::elliptic_curve_add +37 ❌ +7.10%
DocsExample::get_shared_immutable_constrained_public +37 ❌ +7.09%
TokenBridge::_assert_token_is_same +37 ❌ +7.07%
Token::public_get_decimals +37 ❌ +7.03%
TokenBridge::get_portal_address_public +37 ❌ +6.81%
FPC::pay_refund +107 ❌ +6.42%
AvmTest::set_read_storage_single +37 ❌ +6.28%
TokenBlacklist::total_supply +37 ❌ +6.09%
Token::total_supply +37 ❌ +6.09%
EasyPrivateVoting::end_vote +37 ❌ +5.75%
NFT::set_admin +37 ❌ +5.74%
Token::set_admin +37 ❌ +5.74%
AvmTest::nested_static_call_to_set_storage +37 ❌ +5.47%
Child::pub_inc_value +37 ❌ +5.47%
ImportTest::pub_call_public_fn +37 ❌ +5.47%
StaticChild::pub_inc_value +37 ❌ +5.47%
AvmTest::create_same_nullifier_in_nested_call +37 ❌ +5.41%
AvmTest::create_different_nullifier_in_nested_call +37 ❌ +5.32%
AvmTest::read_storage_list +33 ❌ +5.31%
StaticChild::pub_illegal_inc_value +37 ❌ +5.30%
Child::pub_inc_value_internal +37 ❌ +5.26%
AvmTest::u128_from_integer_overflow +37 ❌ +5.12%
DocsExample::initialize_public_immutable +37 ❌ +4.71%
DocsExample::initialize_shared_immutable +37 ❌ +4.71%
StaticParent::public_get_value_from_child +33 ❌ +4.65%
DocsExample::get_shared_immutable_constrained_public_multiple +33 ❌ +4.61%
Parent::pub_entry_point +33 ❌ +4.60%
StaticParent::public_call +33 ❌ +4.60%
AvmTest::test_get_contract_instance +37 ❌ +4.40%
AuthWitTest::consume_public +37 ❌ +4.21%
Delegator::public_delegate_set_value +37 ❌ +4.21%
Child::set_value_twice_with_nested_last +37 ❌ +4.02%
Child::set_value_twice_with_nested_first +37 ❌ +4.02%
AvmTest::nested_call_to_add_with_gas +33 ❌ +3.94%
AvmTest::nested_static_call_to_add +33 ❌ +3.82%
AvmTest::nested_call_to_assert_same +33 ❌ +3.82%
AvmTest::nested_call_to_add +33 ❌ +3.82%
Test::create_l2_to_l1_message_public +85 ❌ +3.65%
AvmTest::get_args_hash +55 ❌ +3.38%
Parent::public_static_call +33 ❌ +3.36%
StaticParent::public_static_call +33 ❌ +3.36%
TokenBridge::_call_mint_on_token +37 ❌ +2.95%
DelegatedOn::public_dispatch +37 ❌ +2.95%
Crowdfunding::_publish_donation_receipts +37 ❌ +2.90%
AvmTest::debug_logging +37 ❌ +2.78%
AvmTest::pedersen_hash_with_index +81 ❌ +2.38%
AvmTest::pedersen_hash +81 ❌ +2.38%
Delegator::public_dispatch +48 ❌ +2.37%
AvmTest::poseidon2_hash +37 ❌ +2.37%
Test::emit_unencrypted +37 ❌ +2.28%
ImportTest::public_dispatch +37 ❌ +2.14%
Uniswap::swap_public +290 ❌ +1.89%
FeeJuice::check_balance +41 ❌ +1.88%
AvmTest::emit_unencrypted_log +37 ❌ +1.26%
AvmTest::keccak_hash +33 ❌ +1.21%
AvmInitializerTest::constructor +14 ❌ +0.49%
AuthWitTest::public_dispatch +8 ❌ +0.36%
CardGame::on_cards_claimed +21 ❌ +0.28%
AvmInitializerTest::public_dispatch +10 ❌ +0.27%
FPC::prepare_fee -5 ✅ -0.39%
Lending::borrow_public -5 ✅ -0.41%
Lending::withdraw_public -5 ✅ -0.41%
StaticParent::public_nested_static_call -9 ✅ -0.66%
Lending::get_assets -6 ✅ -0.71%
Auth::get_authorized_delay -22 ✅ -0.99%
Lending::get_asset -25 ✅ -1.20%
NFT::set_minter -35 ✅ -1.73%
Token::set_minter -35 ✅ -1.73%
CardGame::on_game_joined -83 ✅ -1.74%
StatefulTest::increment_public_value -35 ✅ -1.76%
TokenBlacklist::balance_of_public -35 ✅ -1.78%
Token::balance_of_public -35 ✅ -1.78%
StatefulTest::increment_public_value_no_init_check -35 ✅ -1.80%
FeeJuice::balance_of_public -35 ✅ -1.83%
NFT::is_minter -35 ✅ -1.86%
Token::is_minter -35 ✅ -1.86%
Benchmarking::broadcast -35 ✅ -1.87%
PriceFeed::get_price -35 ✅ -1.89%
AuthRegistry::is_reject_all -35 ✅ -1.91%
StatefulTest::get_public_value -35 ✅ -1.92%
AvmTest::read_storage_map -35 ✅ -1.93%
PriceFeed::set_price -35 ✅ -1.93%
NFT::_finish_transfer_to_public -35 ✅ -1.96%
AuthRegistry::set_reject_all -35 ✅ -2.03%
Token::assert_minter_and_mint -56 ✅ -2.28%
FeeJuice::set_portal -32 ✅ -3.15%
NFT::finalize_transfer_to_private -209 ✅ -3.38%
Lending::_deposit -94 ✅ -3.77%
CardGame::on_card_played -232 ✅ -4.05%
Auth::get_authorized -105 ✅ -5.27%
Auth::get_scheduled_authorized -101 ✅ -5.34%
AvmTest::u128_addition_overflow -77 ✅ -5.67%
DocsExample::public_dispatch -346 ✅ -5.97%
Lending::repay_public -133 ✅ -7.14%
TestLog::public_dispatch -260 ✅ -7.53%
TokenBridge::exit_to_l1_public -722 ✅ -8.98%
Lending::deposit_public -190 ✅ -9.34%
CardGame::start_game -681 ✅ -9.35%
AvmTest::sha256_hash -388 ✅ -10.94%
Parent::public_nested_static_call -529 ✅ -11.76%
TestLog::emit_unencrypted_events -313 ✅ -14.69%
TokenBridge::constructor -676 ✅ -15.97%
PrivateFPC::public_dispatch -847 ✅ -16.15%
PrivateFPC::constructor -684 ✅ -16.71%
StatefulTest::public_constructor -804 ✅ -17.64%
AvmTest::bulk_testing -5,654 ✅ -17.69%
StaticChild::public_dispatch -657 ✅ -17.86%
Auth::constructor -758 ✅ -18.11%
FPC::constructor -758 ✅ -18.21%
Uniswap::constructor -758 ✅ -18.21%
Test::consume_message_from_arbitrary_sender_public -1,612 ✅ -18.66%
FPC::public_dispatch -2,203 ✅ -18.77%
EasyPrivateVoting::constructor -864 ✅ -19.46%
InclusionProofs::public_dispatch -1,121 ✅ -19.78%
Claim::public_dispatch -1,132 ✅ -19.84%
Crowdfunding::public_dispatch -1,673 ✅ -20.39%
Token::mint_private -912 ✅ -20.80%
Spam::public_dispatch -956 ✅ -20.98%
Benchmarking::increment_balance -842 ✅ -21.17%
StaticParent::public_dispatch -1,646 ✅ -21.17%
NFT::owner_of -696 ✅ -21.23%
Claim::constructor -974 ✅ -21.38%
TokenBlacklist::_increase_public_balance -734 ✅ -21.71%
Token::_increase_public_balance -734 ✅ -21.71%
TokenBlacklist::get_roles -728 ✅ -21.75%
InclusionProofs::constructor -824 ✅ -21.89%
Parent::public_dispatch -2,538 ✅ -22.51%
PriceFeed::public_dispatch -1,120 ✅ -22.72%
Spam::public_spam -793 ✅ -23.39%
Router::public_dispatch -905 ✅ -23.52%
Crowdfunding::init -1,241 ✅ -24.20%
Uniswap::public_dispatch -8,344 ✅ -24.92%
TokenBlacklist::mint_private -1,524 ✅ -26.01%
Benchmarking::public_dispatch -1,910 ✅ -27.23%
TokenBridge::claim_public -4,089 ✅ -27.60%
FeeJuice::_increase_public_balance -927 ✅ -27.79%
EasyPrivateVoting::public_dispatch -2,794 ✅ -30.35%
EasyPrivateVoting::add_to_tally_public -1,027 ✅ -30.35%
Token::constructor -2,383 ✅ -30.41%
NFT::constructor -2,256 ✅ -30.71%
Test::consume_mint_public_message -4,113 ✅ -30.74%
NFT::transfer_in_public -1,743 ✅ -31.32%
Token::complete_refund -1,513 ✅ -31.81%
AppSubscription::public_dispatch -2,634 ✅ -32.76%
AppSubscription::constructor -2,024 ✅ -33.34%
Token::burn_public -2,493 ✅ -34.06%
Uniswap::_approve_bridge_and_exit_input_asset_to_L1 -3,263 ✅ -34.74%
Lending::get_position -2,648 ✅ -34.79%
TokenBridge::public_dispatch -11,224 ✅ -34.82%
AuthRegistry::is_consumable -1,064 ✅ -35.06%
AvmTest::set_storage_map -994 ✅ -35.53%
AuthRegistry::_set_authorized -1,064 ✅ -36.09%
StatefulTest::public_dispatch -4,536 ✅ -36.24%
Token::mint_public -1,910 ✅ -36.40%
AuthRegistry::set_authorized -1,064 ✅ -36.43%
Token::shield -3,288 ✅ -37.01%
AvmTest::public_dispatch -34,748 ✅ -37.12%
FeeJuice::public_dispatch -3,820 ✅ -38.73%
Lending::_withdraw -5,411 ✅ -40.55%
Lending::_repay -3,889 ✅ -41.53%
TokenBlacklist::burn_public -4,298 ✅ -41.80%
Auth::set_authorized_delay -4,151 ✅ -41.93%
CardGame::public_dispatch -11,725 ✅ -42.14%
Auth::set_authorized -4,259 ✅ -42.19%
Test::public_dispatch -13,862 ✅ -42.26%
NFT::public_dispatch -16,945 ✅ -42.43%
TokenBlacklist::shield -5,088 ✅ -42.95%
TokenBlacklist::constructor -6,553 ✅ -44.44%
NFT::mint -2,794 ✅ -47.07%
Lending::_borrow -7,460 ✅ -48.66%
TokenBlacklist::update_roles -7,144 ✅ -49.00%
Token::transfer_public -4,797 ✅ -49.28%
AvmTest::add_storage_map -2,081 ✅ -49.51%
TokenBlacklist::mint_public -5,164 ✅ -53.83%
Token::public_dispatch -37,793 ✅ -56.25%
Lending::update_accumulator -7,328 ✅ -57.17%
TokenBlacklist::transfer_public -9,156 ✅ -58.81%
AuthRegistry::consume -5,173 ✅ -62.78%
Auth::public_dispatch -18,815 ✅ -63.03%
AuthRegistry::public_dispatch -14,928 ✅ -64.32%
Lending::public_dispatch -51,150 ✅ -65.14%
TokenBlacklist::public_dispatch -104,697 ✅ -79.98%

Full diff report 👇
Program Bytecode size in bytes (+/-) %
AvmTest::elliptic_curve_add_and_double 693 (+522) +305.26%
AvmTest::assertion_failure 181 (+97) +115.48%
Child::set_value_with_two_nested_calls 1,359 (+621) +84.15%
AvmTest::get_transaction_fee 106 (+37) +53.62%
AvmTest::get_sender 106 (+37) +53.62%
AvmTest::get_storage_address 106 (+37) +53.62%
AvmTest::get_version 106 (+37) +53.62%
AvmTest::get_fee_per_da_gas 106 (+37) +53.62%
AvmTest::get_block_number 106 (+37) +53.62%
AvmTest::get_address 106 (+37) +53.62%
AvmTest::get_da_gas_left 106 (+37) +53.62%
AvmTest::get_chain_id 106 (+37) +53.62%
AvmTest::set_opcode_u8 106 (+37) +53.62%
AvmTest::get_fee_per_l2_gas 106 (+37) +53.62%
AvmTest::get_timestamp 106 (+37) +53.62%
AvmTest::get_l2_gas_left 106 (+37) +53.62%
AvmTest::new_note_hash 107 (+37) +52.86%
AvmTest::new_nullifier 107 (+37) +52.86%
Test::emit_nullifier_public 107 (+37) +52.86%
AvmTest::set_opcode_u32 110 (+37) +50.68%
AvmTest::nullifier_collision 113 (+37) +48.68%
AvmTest::set_opcode_u64 114 (+37) +48.05%
DocsExample::spend_public_authwit 116 (+37) +46.84%
AvmTest::send_l2_to_l1_msg 117 (+37) +46.25%
Test::create_l2_to_l1_message_arbitrary_recipient_public 117 (+37) +46.25%
Test::dummy_public_call 121 (+37) +44.05%
AvmTest::set_opcode_small_field 122 (+37) +43.53%
AvmTest::add_args_return 123 (+37) +43.02%
AvmTest::nullifier_exists 141 (+41) +41.00%
AvmTest::modulo2 128 (+37) +40.66%
AvmTest::l1_to_l2_msg_exists 142 (+41) +40.59%
AvmTest::note_hash_exists 142 (+41) +40.59%
AvmTest::assert_timestamp 129 (+37) +40.22%
Test::is_time_equal 135 (+37) +37.76%
AvmTest::set_opcode_big_field 138 (+37) +36.63%
AvmTest::set_opcode_really_big_field 138 (+37) +36.63%
AvmTest::assert_nullifier_exists 141 (+37) +35.58%
AvmTest::emit_nullifier_and_check 147 (+37) +33.64%
AvmTest::assert_same 134 (+33) +32.67%
InclusionProofs::push_nullifier_public 152 (+37) +32.17%
Child::pub_get_value 156 (+33) +26.83%
InclusionProofs::test_nullifier_inclusion_from_public 181 (+37) +25.69%
AvmTest::get_function_selector 186 (+37) +24.83%
AvmTest::check_selector 201 (+37) +22.56%
StaticChild::pub_get_value 182 (+33) +22.15%
AvmTest::add_u128 222 (+33) +17.46%
Parent::pub_entry_point_twice 1,228 (+179) +17.06%
AvmTest::set_storage_single 259 (+37) +16.67%
Test::assert_public_global_vars 264 (+37) +16.30%
DelegatedOn::public_set_value 265 (+37) +16.23%
AvmTest::to_radix_le 267 (+37) +16.09%
AvmTest::set_storage_list 280 (+37) +15.23%
DocsExample::update_leader 318 (+37) +13.17%
Router::_check_block_number 1,324 (+144) +12.20%
Router::_check_timestamp 1,341 (+144) +12.03%
Child::pub_set_value 351 (+37) +11.78%
StaticChild::pub_set_value 351 (+37) +11.78%
AvmTest::return_oracle 365 (+37) +11.28%
NFT::_store_point_in_transient_storage 380 (+37) +10.79%
FPC::pay_refund_with_shielded_rebate 1,706 (+164) +10.64%
AvmTest::pedersen_commit 387 (+37) +10.57%
AvmTest::test_get_contract_instance_raw 402 (+37) +10.14%
DocsExample::get_shared_immutable_constrained_public_indirect 462 (+41) +9.74%
TokenBlacklist::_reduce_total_supply 962 (+80) +9.07%
Token::_reduce_total_supply 962 (+80) +9.07%
AvmTest::assert_calldata_copy 464 (+37) +8.67%
Lending::init 2,999 (+234) +8.46%
AvmTest::read_storage_single 477 (+37) +8.41%
AvmTest::variable_base_msm 479 (+37) +8.37%
AvmTest::keccak_f1600 502 (+37) +7.96%
Uniswap::_assert_token_is_same 504 (+37) +7.92%
AvmInitializerTest::read_storage_immutable 522 (+37) +7.63%
Child::public_dispatch 5,907 (+413) +7.52%
NFT::public_get_symbol 543 (+37) +7.31%
TokenBridge::get_token 543 (+37) +7.31%
Token::get_admin 543 (+37) +7.31%
NFT::get_admin 548 (+37) +7.24%
NFT::public_get_name 548 (+37) +7.24%
Token::public_get_symbol 548 (+37) +7.24%
Token::public_get_name 548 (+37) +7.24%
AvmTest::elliptic_curve_add 558 (+37) +7.10%
DocsExample::get_shared_immutable_constrained_public 559 (+37) +7.09%
TokenBridge::_assert_token_is_same 560 (+37) +7.07%
Token::public_get_decimals 563 (+37) +7.03%
TokenBridge::get_portal_address_public 580 (+37) +6.81%
FPC::pay_refund 1,774 (+107) +6.42%
AvmTest::set_read_storage_single 626 (+37) +6.28%
TokenBlacklist::total_supply 645 (+37) +6.09%
Token::total_supply 645 (+37) +6.09%
EasyPrivateVoting::end_vote 681 (+37) +5.75%
NFT::set_admin 682 (+37) +5.74%
Token::set_admin 682 (+37) +5.74%
AvmTest::nested_static_call_to_set_storage 713 (+37) +5.47%
Child::pub_inc_value 714 (+37) +5.47%
ImportTest::pub_call_public_fn 714 (+37) +5.47%
StaticChild::pub_inc_value 714 (+37) +5.47%
AvmTest::create_same_nullifier_in_nested_call 721 (+37) +5.41%
AvmTest::create_different_nullifier_in_nested_call 732 (+37) +5.32%
AvmTest::read_storage_list 654 (+33) +5.31%
StaticChild::pub_illegal_inc_value 735 (+37) +5.30%
Child::pub_inc_value_internal 740 (+37) +5.26%
AvmTest::u128_from_integer_overflow 760 (+37) +5.12%
DocsExample::initialize_public_immutable 823 (+37) +4.71%
DocsExample::initialize_shared_immutable 823 (+37) +4.71%
StaticParent::public_get_value_from_child 742 (+33) +4.65%
DocsExample::get_shared_immutable_constrained_public_multiple 749 (+33) +4.61%
Parent::pub_entry_point 751 (+33) +4.60%
StaticParent::public_call 751 (+33) +4.60%
AvmTest::test_get_contract_instance 878 (+37) +4.40%
AuthWitTest::consume_public 915 (+37) +4.21%
Delegator::public_delegate_set_value 916 (+37) +4.21%
Child::set_value_twice_with_nested_last 957 (+37) +4.02%
Child::set_value_twice_with_nested_first 957 (+37) +4.02%
AvmTest::nested_call_to_add_with_gas 871 (+33) +3.94%
AvmTest::nested_static_call_to_add 896 (+33) +3.82%
AvmTest::nested_call_to_assert_same 896 (+33) +3.82%
AvmTest::nested_call_to_add 896 (+33) +3.82%
Test::create_l2_to_l1_message_public 2,415 (+85) +3.65%
AvmTest::get_args_hash 1,684 (+55) +3.38%
Parent::public_static_call 1,015 (+33) +3.36%
StaticParent::public_static_call 1,015 (+33) +3.36%
TokenBridge::_call_mint_on_token 1,292 (+37) +2.95%
DelegatedOn::public_dispatch 1,293 (+37) +2.95%
Crowdfunding::_publish_donation_receipts 1,313 (+37) +2.90%
AvmTest::debug_logging 1,368 (+37) +2.78%
AvmTest::pedersen_hash_with_index 3,482 (+81) +2.38%
AvmTest::pedersen_hash 3,482 (+81) +2.38%
Delegator::public_dispatch 2,073 (+48) +2.37%
AvmTest::poseidon2_hash 1,600 (+37) +2.37%
Test::emit_unencrypted 1,660 (+37) +2.28%
ImportTest::public_dispatch 1,769 (+37) +2.14%
Uniswap::swap_public 15,612 (+290) +1.89%
FeeJuice::check_balance 2,217 (+41) +1.88%
AvmTest::emit_unencrypted_log 2,964 (+37) +1.26%
AvmTest::keccak_hash 2,752 (+33) +1.21%
AvmInitializerTest::constructor 2,891 (+14) +0.49%
AuthWitTest::public_dispatch 2,209 (+8) +0.36%
CardGame::on_cards_claimed 7,493 (+21) +0.28%
AvmInitializerTest::public_dispatch 3,692 (+10) +0.27%
FPC::prepare_fee 1,292 (-5) -0.39%
Lending::borrow_public 1,219 (-5) -0.41%
Lending::withdraw_public 1,219 (-5) -0.41%
StaticParent::public_nested_static_call 1,365 (-9) -0.66%
Lending::get_assets 844 (-6) -0.71%
Auth::get_authorized_delay 2,194 (-22) -0.99%
Lending::get_asset 2,050 (-25) -1.20%
NFT::set_minter 1,986 (-35) -1.73%
Token::set_minter 1,986 (-35) -1.73%
CardGame::on_game_joined 4,681 (-83) -1.74%
StatefulTest::increment_public_value 1,954 (-35) -1.76%
TokenBlacklist::balance_of_public 1,932 (-35) -1.78%
Token::balance_of_public 1,932 (-35) -1.78%
StatefulTest::increment_public_value_no_init_check 1,909 (-35) -1.80%
FeeJuice::balance_of_public 1,882 (-35) -1.83%
NFT::is_minter 1,850 (-35) -1.86%
Token::is_minter 1,850 (-35) -1.86%
Benchmarking::broadcast 1,840 (-35) -1.87%
PriceFeed::get_price 1,821 (-35) -1.89%
AuthRegistry::is_reject_all 1,800 (-35) -1.91%
StatefulTest::get_public_value 1,790 (-35) -1.92%
AvmTest::read_storage_map 1,779 (-35) -1.93%
PriceFeed::set_price 1,775 (-35) -1.93%
NFT::_finish_transfer_to_public 1,751 (-35) -1.96%
AuthRegistry::set_reject_all 1,691 (-35) -2.03%
Token::assert_minter_and_mint 2,399 (-56) -2.28%
FeeJuice::set_portal 985 (-32) -3.15%
NFT::finalize_transfer_to_private 5,968 (-209) -3.38%
Lending::_deposit 2,400 (-94) -3.77%
CardGame::on_card_played 5,491 (-232) -4.05%
Auth::get_authorized 1,886 (-105) -5.27%
Auth::get_scheduled_authorized 1,789 (-101) -5.34%
AvmTest::u128_addition_overflow 1,280 (-77) -5.67%
DocsExample::public_dispatch 5,454 (-346) -5.97%
Lending::repay_public 1,731 (-133) -7.14%
TestLog::public_dispatch 3,195 (-260) -7.53%
TokenBridge::exit_to_l1_public 7,319 (-722) -8.98%
Lending::deposit_public 1,844 (-190) -9.34%
CardGame::start_game 6,601 (-681) -9.35%
AvmTest::sha256_hash 3,158 (-388) -10.94%
Parent::public_nested_static_call 3,971 (-529) -11.76%
TestLog::emit_unencrypted_events 1,817 (-313) -14.69%
TokenBridge::constructor 3,556 (-676) -15.97%
PrivateFPC::public_dispatch 4,397 (-847) -16.15%
PrivateFPC::constructor 3,410 (-684) -16.71%
StatefulTest::public_constructor 3,754 (-804) -17.64%
AvmTest::bulk_testing 26,310 (-5,654) -17.69%
StaticChild::public_dispatch 3,022 (-657) -17.86%
Auth::constructor 3,427 (-758) -18.11%
FPC::constructor 3,405 (-758) -18.21%
Uniswap::constructor 3,405 (-758) -18.21%
Test::consume_message_from_arbitrary_sender_public 7,026 (-1,612) -18.66%
FPC::public_dispatch 9,535 (-2,203) -18.77%
EasyPrivateVoting::constructor 3,576 (-864) -19.46%
InclusionProofs::public_dispatch 4,545 (-1,121) -19.78%
Claim::public_dispatch 4,573 (-1,132) -19.84%
Crowdfunding::public_dispatch 6,533 (-1,673) -20.39%
Token::mint_private 3,472 (-912) -20.80%
Spam::public_dispatch 3,600 (-956) -20.98%
Benchmarking::increment_balance 3,136 (-842) -21.17%
StaticParent::public_dispatch 6,128 (-1,646) -21.17%
NFT::owner_of 2,582 (-696) -21.23%
Claim::constructor 3,581 (-974) -21.38%
TokenBlacklist::_increase_public_balance 2,647 (-734) -21.71%
Token::_increase_public_balance 2,647 (-734) -21.71%
TokenBlacklist::get_roles 2,619 (-728) -21.75%
InclusionProofs::constructor 2,941 (-824) -21.89%
Parent::public_dispatch 8,738 (-2,538) -22.51%
PriceFeed::public_dispatch 3,809 (-1,120) -22.72%
Spam::public_spam 2,597 (-793) -23.39%
Router::public_dispatch 2,942 (-905) -23.52%
Crowdfunding::init 3,888 (-1,241) -24.20%
Uniswap::public_dispatch 25,144 (-8,344) -24.92%
TokenBlacklist::mint_private 4,336 (-1,524) -26.01%
Benchmarking::public_dispatch 5,105 (-1,910) -27.23%
TokenBridge::claim_public 10,725 (-4,089) -27.60%
FeeJuice::_increase_public_balance 2,409 (-927) -27.79%
EasyPrivateVoting::public_dispatch 6,413 (-2,794) -30.35%
EasyPrivateVoting::add_to_tally_public 2,357 (-1,027) -30.35%
Token::constructor 5,452 (-2,383) -30.41%
NFT::constructor 5,090 (-2,256) -30.71%
Test::consume_mint_public_message 9,265 (-4,113) -30.74%
NFT::transfer_in_public 3,822 (-1,743) -31.32%
Token::complete_refund 3,243 (-1,513) -31.81%
AppSubscription::public_dispatch 5,406 (-2,634) -32.76%
AppSubscription::constructor 4,047 (-2,024) -33.34%
Token::burn_public 4,826 (-2,493) -34.06%
Uniswap::_approve_bridge_and_exit_input_asset_to_L1 6,130 (-3,263) -34.74%
Lending::get_position 4,963 (-2,648) -34.79%
TokenBridge::public_dispatch 21,010 (-11,224) -34.82%
AuthRegistry::is_consumable 1,971 (-1,064) -35.06%
AvmTest::set_storage_map 1,804 (-994) -35.53%
AuthRegistry::_set_authorized 1,884 (-1,064) -36.09%
StatefulTest::public_dispatch 7,980 (-4,536) -36.24%
Token::mint_public 3,337 (-1,910) -36.40%
AuthRegistry::set_authorized 1,857 (-1,064) -36.43%
Token::shield 5,595 (-3,288) -37.01%
AvmTest::public_dispatch 58,853 (-34,748) -37.12%
FeeJuice::public_dispatch 6,043 (-3,820) -38.73%
Lending::_withdraw 7,934 (-5,411) -40.55%
Lending::_repay 5,475 (-3,889) -41.53%
TokenBlacklist::burn_public 5,985 (-4,298) -41.80%
Auth::set_authorized_delay 5,749 (-4,151) -41.93%
CardGame::public_dispatch 16,097 (-11,725) -42.14%
Auth::set_authorized 5,837 (-4,259) -42.19%
Test::public_dispatch 18,937 (-13,862) -42.26%
NFT::public_dispatch 22,988 (-16,945) -42.43%
TokenBlacklist::shield 6,759 (-5,088) -42.95%
TokenBlacklist::constructor 8,192 (-6,553) -44.44%
NFT::mint 3,142 (-2,794) -47.07%
Lending::_borrow 7,872 (-7,460) -48.66%
TokenBlacklist::update_roles 7,437 (-7,144) -49.00%
Token::transfer_public 4,937 (-4,797) -49.28%
AvmTest::add_storage_map 2,122 (-2,081) -49.51%
TokenBlacklist::mint_public 4,429 (-5,164) -53.83%
Token::public_dispatch 29,392 (-37,793) -56.25%
Lending::update_accumulator 5,490 (-7,328) -57.17%
TokenBlacklist::transfer_public 6,412 (-9,156) -58.81%
AuthRegistry::consume 3,067 (-5,173) -62.78%
Auth::public_dispatch 11,035 (-18,815) -63.03%
AuthRegistry::public_dispatch 8,281 (-14,928) -64.32%
Lending::public_dispatch 27,377 (-51,150) -65.14%
TokenBlacklist::public_dispatch 26,199 (-104,697) -79.98%

Copy link
Contributor

github-actions bot commented Oct 3, 2024

Changes to circuit sizes

Generated at commit: 16635ab8d162ecb1a568a2f4920d81e865bc1a32, compared to commit: 2aac1fb78790eb4472529146ab5ef562abe1d0fc

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
private_kernel_tail -96 ✅ -2.02% -20 ✅ -0.22%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
private_kernel_tail 4,646 (-96) -2.02% 9,003 (-20) -0.22%

@sirasistant
Copy link
Contributor Author

Will fix transpiler now

@sirasistant sirasistant added e2e-all CI: Enables this CI job. bench-all CI: Enables this CI job. labels Oct 4, 2024
@sirasistant
Copy link
Contributor Author

At this point all e2e tests are passing and the only two things missing is the implementation of proving relative addressing and this issue #9020

@TomAFrench TomAFrench changed the title feat: Brillig with a stack and conditional inlining [WIP] feat!: Brillig with a stack and conditional inlining [WIP] Oct 4, 2024
Copy link
Contributor

@vezenovm vezenovm left a comment

Choose a reason for hiding this comment

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

Looks good on the Noir/Brillig side of things. Some minor nits, but nothing blocking and they can all be addressed in follow-ups.

avm-transpiler/src/instructions.rs Outdated Show resolved Hide resolved
noir/noir-repo/acvm-repo/brillig_vm/src/lib.rs Outdated Show resolved Hide resolved
noir/noir-repo/acvm-repo/brillig_vm/src/lib.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bench-all CI: Enables this CI job. e2e-all CI: Enables this CI job.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants