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(avm): relative addressing in avm circuit #9155

Merged

Conversation

jeanmon
Copy link
Contributor

@jeanmon jeanmon commented Oct 10, 2024

Resolves #9043

@jeanmon jeanmon marked this pull request as ready for review October 10, 2024 14:09
@sirasistant
Copy link
Contributor

:shipit: :shipit: :shipit: :shipit: :shipit: :shipit: :shipit: :shipit: :shipit:

Copy link
Contributor

Changes to circuit sizes

Generated at commit: c29a3ed4dc9220e467af361e9974c6541f7a8727, compared to commit: f5fd1c31da99a445f12357cedb79a0705598816a

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_merge +42 ❌ +0.08% +42 ❌ +0.00%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_merge 53,532 (+42) +0.08% 1,103,602 (+42) +0.00%

Copy link
Contributor

Changes to public function bytecode sizes

Generated at commit: c29a3ed4dc9220e467af361e9974c6541f7a8727, compared to commit: f5fd1c31da99a445f12357cedb79a0705598816a

🧾 Summary (100% most significant diffs)

Program Bytecode size in bytes (+/-) %
Lending::_withdraw -1 ✅ -0.01%
Lending::_borrow -1 ✅ -0.01%
TokenBridge::exit_to_l1_public -1 ✅ -0.01%
Lending::_repay -1 ✅ -0.02%
Token::public_dispatch -6 ✅ -0.02%
Lending::public_dispatch -6 ✅ -0.02%
TokenBlacklist::public_dispatch -6 ✅ -0.02%
Uniswap::public_dispatch -6 ✅ -0.02%
NFT::public_dispatch -6 ✅ -0.03%
Uniswap::swap_public -6 ✅ -0.04%
Lending::get_position -2 ✅ -0.04%
Lending::deposit_public -1 ✅ -0.05%
Auth::public_dispatch -6 ✅ -0.05%
FPC::pay_refund -1 ✅ -0.06%
Lending::repay_public -1 ✅ -0.06%
FPC::pay_refund_with_shielded_rebate -1 ✅ -0.06%
FPC::public_dispatch -6 ✅ -0.06%
Test::public_dispatch -12 ✅ -0.06%
StatefulTest::public_dispatch -6 ✅ -0.08%
FPC::prepare_fee -1 ✅ -0.08%
Lending::borrow_public -1 ✅ -0.08%
Lending::withdraw_public -1 ✅ -0.08%
TokenBridge::public_dispatch -18 ✅ -0.09%
TokenBlacklist::shield -6 ✅ -0.09%
TokenBlacklist::transfer_public -6 ✅ -0.09%
Uniswap::_approve_bridge_and_exit_input_asset_to_L1 -6 ✅ -0.10%
TokenBlacklist::burn_public -6 ✅ -0.10%
Token::shield -6 ✅ -0.11%
TokenBridge::claim_public -13 ✅ -0.12%
Token::transfer_public -6 ✅ -0.12%
Token::burn_public -6 ✅ -0.12%
Test::consume_mint_public_message -12 ✅ -0.13%
TokenBlacklist::update_roles -11 ✅ -0.15%
NFT::transfer_in_public -6 ✅ -0.16%
Crowdfunding::public_dispatch -11 ✅ -0.17%
Test::consume_message_from_arbitrary_sender_public -12 ✅ -0.17%
NFT::finalize_transfer_to_private -11 ✅ -0.18%
Token::complete_refund -6 ✅ -0.19%
Auth::set_authorized -11 ✅ -0.19%
Auth::set_authorized_delay -11 ✅ -0.19%
Uniswap::_assert_token_is_same -1 ✅ -0.20%
Lending::update_accumulator -11 ✅ -0.20%
TokenBlacklist::_increase_public_balance -6 ✅ -0.23%
Token::_increase_public_balance -6 ✅ -0.23%
TokenBlacklist::get_roles -6 ✅ -0.23%
TokenBlacklist::mint_public -11 ✅ -0.25%
Lending::_deposit -6 ✅ -0.25%
TokenBlacklist::mint_private -11 ✅ -0.25%
EasyPrivateVoting::add_to_tally_public -6 ✅ -0.25%
AvmInitializerTest::public_dispatch -11 ✅ -0.30%
AvmTest::public_dispatch -181 ✅ -0.31%
Token::mint_private -11 ✅ -0.32%
Token::mint_public -11 ✅ -0.33%
NFT::mint -11 ✅ -0.35%
Lending::init -11 ✅ -0.37%
NFT::owner_of -11 ✅ -0.43%
Crowdfunding::_publish_donation_receipts -6 ✅ -0.46%
Token::assert_minter_and_mint -11 ✅ -0.46%
TokenBridge::_call_mint_on_token -6 ✅ -0.46%
Auth::get_authorized_delay -11 ✅ -0.50%
Lending::get_asset -11 ✅ -0.54%
NFT::set_minter -11 ✅ -0.55%
Token::set_minter -11 ✅ -0.55%
StatefulTest::increment_public_value -11 ✅ -0.56%
TokenBlacklist::balance_of_public -11 ✅ -0.57%
Token::balance_of_public -11 ✅ -0.57%
Auth::get_authorized -11 ✅ -0.58%
NFT::is_minter -11 ✅ -0.59%
Token::is_minter -11 ✅ -0.59%
Auth::get_scheduled_authorized -11 ✅ -0.61%
TokenBlacklist::_reduce_total_supply -6 ✅ -0.62%
Token::_reduce_total_supply -6 ✅ -0.62%
NFT::_finish_transfer_to_public -11 ✅ -0.63%
Lending::get_assets -6 ✅ -0.71%
EasyPrivateVoting::public_dispatch -50 ✅ -0.78%
NFT::set_admin -6 ✅ -0.88%
Token::set_admin -6 ✅ -0.88%
EasyPrivateVoting::end_vote -6 ✅ -0.88%
TokenBlacklist::total_supply -6 ✅ -0.93%
Token::total_supply -6 ✅ -0.93%
TokenBridge::get_portal_address_public -6 ✅ -1.03%
Token::public_get_decimals -6 ✅ -1.07%
TokenBridge::_assert_token_is_same -6 ✅ -1.07%
NFT::public_get_name -6 ✅ -1.09%
NFT::get_admin -6 ✅ -1.09%
Token::public_get_symbol -6 ✅ -1.09%
Token::public_get_name -6 ✅ -1.09%
NFT::public_get_symbol -6 ✅ -1.10%
TokenBridge::get_token -6 ✅ -1.10%
Token::get_admin -6 ✅ -1.10%
AvmInitializerTest::read_storage_immutable -6 ✅ -1.15%
InclusionProofs::public_dispatch -66 ✅ -1.45%
NFT::_store_point_in_transient_storage -6 ✅ -1.58%
InclusionProofs::push_nullifier_public -6 ✅ -3.95%
AvmTest::emit_nullifier_and_check -6 ✅ -4.08%
AvmTest::assert_nullifier_exists -6 ✅ -4.26%
InclusionProofs::test_nullifier_inclusion_from_public -12 ✅ -6.63%
AvmTest::note_hash_exists -11 ✅ -7.75%
AvmTest::l1_to_l2_msg_exists -11 ✅ -7.75%
AvmTest::nullifier_exists -11 ✅ -7.80%

Full diff report 👇
Program Bytecode size in bytes (+/-) %
Lending::_withdraw 7,933 (-1) -0.01%
Lending::_borrow 7,871 (-1) -0.01%
TokenBridge::exit_to_l1_public 7,318 (-1) -0.01%
Lending::_repay 5,474 (-1) -0.02%
Token::public_dispatch 29,386 (-6) -0.02%
Lending::public_dispatch 27,371 (-6) -0.02%
TokenBlacklist::public_dispatch 26,193 (-6) -0.02%
Uniswap::public_dispatch 25,138 (-6) -0.02%
NFT::public_dispatch 22,982 (-6) -0.03%
Uniswap::swap_public 15,606 (-6) -0.04%
Lending::get_position 4,961 (-2) -0.04%
Lending::deposit_public 1,843 (-1) -0.05%
Auth::public_dispatch 11,029 (-6) -0.05%
FPC::pay_refund 1,773 (-1) -0.06%
Lending::repay_public 1,730 (-1) -0.06%
FPC::pay_refund_with_shielded_rebate 1,705 (-1) -0.06%
FPC::public_dispatch 9,529 (-6) -0.06%
Test::public_dispatch 18,925 (-12) -0.06%
StatefulTest::public_dispatch 7,974 (-6) -0.08%
FPC::prepare_fee 1,291 (-1) -0.08%
Lending::borrow_public 1,218 (-1) -0.08%
Lending::withdraw_public 1,218 (-1) -0.08%
TokenBridge::public_dispatch 20,992 (-18) -0.09%
TokenBlacklist::shield 6,753 (-6) -0.09%
TokenBlacklist::transfer_public 6,406 (-6) -0.09%
Uniswap::_approve_bridge_and_exit_input_asset_to_L1 6,124 (-6) -0.10%
TokenBlacklist::burn_public 5,979 (-6) -0.10%
Token::shield 5,589 (-6) -0.11%
TokenBridge::claim_public 10,712 (-13) -0.12%
Token::transfer_public 4,931 (-6) -0.12%
Token::burn_public 4,820 (-6) -0.12%
Test::consume_mint_public_message 9,253 (-12) -0.13%
TokenBlacklist::update_roles 7,426 (-11) -0.15%
NFT::transfer_in_public 3,816 (-6) -0.16%
Crowdfunding::public_dispatch 6,522 (-11) -0.17%
Test::consume_message_from_arbitrary_sender_public 7,014 (-12) -0.17%
NFT::finalize_transfer_to_private 5,957 (-11) -0.18%
Token::complete_refund 3,237 (-6) -0.19%
Auth::set_authorized 5,826 (-11) -0.19%
Auth::set_authorized_delay 5,738 (-11) -0.19%
Uniswap::_assert_token_is_same 503 (-1) -0.20%
Lending::update_accumulator 5,479 (-11) -0.20%
TokenBlacklist::_increase_public_balance 2,641 (-6) -0.23%
Token::_increase_public_balance 2,641 (-6) -0.23%
TokenBlacklist::get_roles 2,613 (-6) -0.23%
TokenBlacklist::mint_public 4,418 (-11) -0.25%
Lending::_deposit 2,394 (-6) -0.25%
TokenBlacklist::mint_private 4,325 (-11) -0.25%
EasyPrivateVoting::add_to_tally_public 2,351 (-6) -0.25%
AvmInitializerTest::public_dispatch 3,681 (-11) -0.30%
AvmTest::public_dispatch 58,672 (-181) -0.31%
Token::mint_private 3,461 (-11) -0.32%
Token::mint_public 3,326 (-11) -0.33%
NFT::mint 3,131 (-11) -0.35%
Lending::init 2,988 (-11) -0.37%
NFT::owner_of 2,571 (-11) -0.43%
Crowdfunding::_publish_donation_receipts 1,307 (-6) -0.46%
Token::assert_minter_and_mint 2,388 (-11) -0.46%
TokenBridge::_call_mint_on_token 1,286 (-6) -0.46%
Auth::get_authorized_delay 2,183 (-11) -0.50%
Lending::get_asset 2,039 (-11) -0.54%
NFT::set_minter 1,975 (-11) -0.55%
Token::set_minter 1,975 (-11) -0.55%
StatefulTest::increment_public_value 1,943 (-11) -0.56%
TokenBlacklist::balance_of_public 1,921 (-11) -0.57%
Token::balance_of_public 1,921 (-11) -0.57%
Auth::get_authorized 1,875 (-11) -0.58%
NFT::is_minter 1,839 (-11) -0.59%
Token::is_minter 1,839 (-11) -0.59%
Auth::get_scheduled_authorized 1,778 (-11) -0.61%
TokenBlacklist::_reduce_total_supply 956 (-6) -0.62%
Token::_reduce_total_supply 956 (-6) -0.62%
NFT::_finish_transfer_to_public 1,740 (-11) -0.63%
Lending::get_assets 838 (-6) -0.71%
EasyPrivateVoting::public_dispatch 6,363 (-50) -0.78%
NFT::set_admin 676 (-6) -0.88%
Token::set_admin 676 (-6) -0.88%
EasyPrivateVoting::end_vote 675 (-6) -0.88%
TokenBlacklist::total_supply 639 (-6) -0.93%
Token::total_supply 639 (-6) -0.93%
TokenBridge::get_portal_address_public 574 (-6) -1.03%
Token::public_get_decimals 557 (-6) -1.07%
TokenBridge::_assert_token_is_same 554 (-6) -1.07%
NFT::public_get_name 542 (-6) -1.09%
NFT::get_admin 542 (-6) -1.09%
Token::public_get_symbol 542 (-6) -1.09%
Token::public_get_name 542 (-6) -1.09%
NFT::public_get_symbol 537 (-6) -1.10%
TokenBridge::get_token 537 (-6) -1.10%
Token::get_admin 537 (-6) -1.10%
AvmInitializerTest::read_storage_immutable 516 (-6) -1.15%
InclusionProofs::public_dispatch 4,479 (-66) -1.45%
NFT::_store_point_in_transient_storage 374 (-6) -1.58%
InclusionProofs::push_nullifier_public 146 (-6) -3.95%
AvmTest::emit_nullifier_and_check 141 (-6) -4.08%
AvmTest::assert_nullifier_exists 135 (-6) -4.26%
InclusionProofs::test_nullifier_inclusion_from_public 169 (-12) -6.63%
AvmTest::note_hash_exists 131 (-11) -7.75%
AvmTest::l1_to_l2_msg_exists 131 (-11) -7.75%
AvmTest::nullifier_exists 130 (-11) -7.80%

@jeanmon jeanmon added the e2e-all CI: Enables this CI job. label Oct 10, 2024
Copy link
Contributor

@fcarreiro fcarreiro left a comment

Choose a reason for hiding this comment

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

LGTM if green! Thank you!

@jeanmon jeanmon merged commit 14d527a into arv/stack_implementation Oct 10, 2024
9 of 45 checks passed
@jeanmon jeanmon deleted the jm/9043-relative-addressing-avm-circuit branch October 10, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e-all CI: Enables this CI job.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants