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: deduplicate constants across blocks + DIE fix #10152

Closed
wants to merge 10 commits into from

Conversation

asterite
Copy link
Contributor

No description provided.

Copy link
Contributor

github-actions bot commented Nov 22, 2024

Changes to public function bytecode sizes

Generated at commit: a44a2c5ef47d4e357d60161fa377bc8231a0f63b, compared to commit: b51fc43a6fbd07eb89faae5bd518246182fa9d0f

🧾 Summary (100% most significant diffs)

Program Bytecode size in bytes (+/-) %
FPC::constructor +356 ❌ +15.36%
TokenBridge::constructor +356 ❌ +15.10%
Auth::get_scheduled_authorized +271 ❌ +14.95%
AvmTest::get_args_hash +267 ❌ +14.80%
AuthRegistry::set_reject_all +249 ❌ +14.59%
StatefulTest::increment_public_value_no_init_check +249 ❌ +14.59%
AvmTest::read_storage_map +249 ❌ +14.55%
DocsExample::public_dispatch +617 ❌ +14.55%
Claim::constructor +356 ❌ +14.51%
AvmTest::poseidon2_hash +249 ❌ +14.36%
StatefulTest::get_public_value +249 ❌ +14.29%
AuthRegistry::is_reject_all +249 ❌ +14.21%
StatefulTest::increment_public_value +249 ❌ +14.18%
Auth::get_authorized +271 ❌ +14.17%
PriceFeed::get_price +249 ❌ +14.16%
Benchmarking::broadcast +249 ❌ +13.99%
NFT::_finish_transfer_to_public +249 ❌ +13.90%
AvmTest::set_storage_map +249 ❌ +13.80%
NFT::is_minter +249 ❌ +13.79%
Token::is_minter +249 ❌ +13.79%
NFT::set_minter +249 ❌ +13.76%
Token::set_minter +249 ❌ +13.76%
PriceFeed::set_price +249 ❌ +13.76%
FeeJuice::balance_of_public +249 ❌ +13.46%
AuthRegistry::set_authorized +249 ❌ +13.39%
TokenBlacklist::balance_of_public +249 ❌ +13.08%
Token::balance_of_public +249 ❌ +13.08%
AuthRegistry::_set_authorized +249 ❌ +13.06%
AvmTest::add_storage_map +249 ❌ +13.06%
AuthRegistry::is_consumable +249 ❌ +13.02%
AvmInitializerTest::constructor +254 ❌ +13.01%
Claim::public_dispatch +407 ❌ +12.52%
Auth::get_authorized_delay +254 ❌ +12.38%
EasyPrivateVoting::add_to_tally_public +249 ❌ +12.10%
Lending::get_asset +266 ❌ +12.06%
FeeJuice::_increase_public_balance +249 ❌ +11.20%
FeeJuice::check_balance +249 ❌ +11.18%
InclusionProofs::constructor +254 ❌ +11.04%
Uniswap::constructor +254 ❌ +10.74%
Crowdfunding::public_dispatch +501 ❌ +10.72%
EasyPrivateVoting::constructor +254 ❌ +10.57%
Auth::constructor +254 ❌ +10.56%
Benchmarking::increment_balance +249 ❌ +10.42%
Lending::_deposit +261 ❌ +10.24%
NFT::owner_of +249 ❌ +10.23%
Spam::public_spam +249 ❌ +10.23%
TokenBlacklist::_increase_public_balance +249 ❌ +9.99%
Token::_increase_public_balance +249 ❌ +9.99%
TokenBlacklist::get_roles +266 ❌ +9.90%
Crowdfunding::init +267 ❌ +9.83%
PriceFeed::public_dispatch +300 ❌ +9.68%
StatefulTest::public_constructor +267 ❌ +9.57%
AppSubscription::public_dispatch +381 ❌ +9.54%
AvmInitializerTest::public_dispatch +254 ❌ +9.37%
Spam::public_dispatch +300 ❌ +9.23%
Lending::init +266 ❌ +8.99%
AppSubscription::constructor +254 ❌ +8.96%
NFT::mint +249 ❌ +8.75%
Token::mint_to_public +249 ❌ +8.68%
StatefulTest::public_dispatch +517 ❌ +8.42%
Benchmarking::public_dispatch +334 ❌ +8.41%
InclusionProofs::public_dispatch +305 ❌ +8.11%
FeeJuice::public_dispatch +419 ❌ +7.92%
NFT::transfer_in_public +262 ❌ +7.84%
FPC::public_dispatch +539 ❌ +7.43%
AuthRegistry::public_dispatch +576 ❌ +7.25%
TokenBlacklist::mint_private +266 ❌ +7.11%
AuthRegistry::consume +208 ❌ +7.09%
TokenBlacklist::mint_public +266 ❌ +6.65%
Token::burn_public +262 ❌ +6.27%
Token::transfer_in_public +262 ❌ +6.19%
NFT::constructor +249 ❌ +6.14%
EasyPrivateVoting::public_dispatch +317 ❌ +6.09%
Token::constructor +249 ❌ +6.03%
Auth::set_authorized +274 ❌ +6.02%
Auth::set_authorized_delay +279 ❌ +6.01%
Parent::public_nested_static_call +202 ❌ +5.88%
CardGame::on_game_joined +288 ❌ +5.66%
Test::public_dispatch +1,080 ❌ +5.64%
CardGame::on_cards_claimed +390 ❌ +5.34%
TokenBlacklist::burn_public +279 ❌ +5.32%
Lending::get_position +266 ❌ +5.31%
CardGame::on_card_played +314 ❌ +5.23%
Router::public_dispatch +123 ❌ +5.21%
Parent::public_dispatch +396 ❌ +5.13%
AuthWitTest::public_dispatch +85 ❌ +5.11%
NFT::finalize_transfer_to_private +284 ❌ +5.08%
NFT::_finalize_transfer_to_private_unsafe +284 ❌ +5.03%
Token::finalize_transfer_to_private +334 ❌ +5.03%
Token::_finalize_transfer_to_private_unsafe +334 ❌ +5.00%
TokenBlacklist::transfer_public +279 ❌ +4.96%
TokenBlacklist::shield +279 ❌ +4.80%
Lending::_repay +261 ❌ +4.59%
Token::finalize_mint_to_private +284 ❌ +4.52%
TestLog::public_dispatch +107 ❌ +4.50%
Token::_finalize_mint_to_private_unsafe +284 ❌ +4.49%
StaticParent::public_dispatch +258 ❌ +4.46%
Lending::update_accumulator +257 ❌ +4.46%
TokenBlacklist::update_roles +269 ❌ +4.38%
TokenBlacklist::constructor +269 ❌ +4.31%
NFT::public_dispatch +1,013 ❌ +4.25%
Test::consume_message_from_arbitrary_sender_public +329 ❌ +4.15%
Auth::public_dispatch +359 ❌ +4.08%
CardGame::start_game +290 ❌ +4.05%
AvmTest::keccak_hash +85 ❌ +3.54%
Token::public_dispatch +1,119 ❌ +3.54%
CardGame::public_dispatch +571 ❌ +3.53%
Lending::_borrow +261 ❌ +3.52%
AvmTest::public_dispatch +2,056 ❌ +3.38%
Uniswap::_approve_bridge_and_exit_input_asset_to_L1 +210 ❌ +3.37%
Test::emit_unencrypted +47 ❌ +3.17%
Crowdfunding::_publish_donation_receipts +30 ❌ +3.15%
TokenBlacklist::public_dispatch +722 ❌ +3.11%
Lending::_withdraw +269 ❌ +3.10%
Test::create_l2_to_l1_message_public +68 ❌ +3.09%
Lending::public_dispatch +721 ❌ +2.64%
Test::consume_mint_to_public_message +285 ❌ +2.62%
TestLog::emit_unencrypted_events +30 ❌ +2.61%
NFT::_store_payload_in_transient_storage_unsafe +30 ❌ +2.53%
Token::_store_payload_in_transient_storage_unsafe +30 ❌ +2.53%
TokenBridge::claim_public +285 ❌ +2.50%
AvmTest::emit_unencrypted_log +68 ❌ +2.45%
StaticChild::public_dispatch +51 ❌ +2.41%
AvmTest::sha256_hash +94 ❌ +2.40%
AvmTest::returndata_copy_oracle +42 ❌ +2.29%
Uniswap::public_dispatch +516 ❌ +2.23%
AvmTest::pedersen_hash +68 ❌ +2.20%
AvmTest::pedersen_hash_with_index +68 ❌ +2.20%
TokenBridge::public_dispatch +442 ❌ +2.13%
TokenBridge::exit_to_l1_public +128 ❌ +2.02%
Uniswap::swap_public +280 ❌ +1.83%
Token::complete_refund +85 ❌ +1.55%
AvmTest::pedersen_commit +17 ❌ +1.35%
Child::public_dispatch +51 ❌ +1.07%
AvmTest::bulk_testing +212 ❌ +0.92%
Lending::borrow_public +8 ❌ +0.42%
Lending::withdraw_public +8 ❌ +0.42%
FPC::prepare_fee +8 ❌ +0.40%
FPC::pay_refund +8 ❌ +0.39%
StaticParent::public_nested_static_call +8 ❌ +0.39%
Parent::pub_entry_point_twice -5 ✅ -0.51%
Lending::deposit_public -49 ✅ -1.88%
Lending::repay_public -49 ✅ -1.96%

Full diff report 👇
Program Bytecode size in bytes (+/-) %
FPC::constructor 2,674 (+356) +15.36%
TokenBridge::constructor 2,713 (+356) +15.10%
Auth::get_scheduled_authorized 2,084 (+271) +14.95%
AvmTest::get_args_hash 2,071 (+267) +14.80%
AuthRegistry::set_reject_all 1,956 (+249) +14.59%
StatefulTest::increment_public_value_no_init_check 1,956 (+249) +14.59%
AvmTest::read_storage_map 1,960 (+249) +14.55%
DocsExample::public_dispatch 4,857 (+617) +14.55%
Claim::constructor 2,809 (+356) +14.51%
AvmTest::poseidon2_hash 1,983 (+249) +14.36%
StatefulTest::get_public_value 1,991 (+249) +14.29%
AuthRegistry::is_reject_all 2,001 (+249) +14.21%
StatefulTest::increment_public_value 2,005 (+249) +14.18%
Auth::get_authorized 2,184 (+271) +14.17%
PriceFeed::get_price 2,007 (+249) +14.16%
Benchmarking::broadcast 2,029 (+249) +13.99%
NFT::_finish_transfer_to_public 2,040 (+249) +13.90%
AvmTest::set_storage_map 2,053 (+249) +13.80%
NFT::is_minter 2,055 (+249) +13.79%
Token::is_minter 2,055 (+249) +13.79%
NFT::set_minter 2,058 (+249) +13.76%
Token::set_minter 2,058 (+249) +13.76%
PriceFeed::set_price 2,059 (+249) +13.76%
FeeJuice::balance_of_public 2,099 (+249) +13.46%
AuthRegistry::set_authorized 2,108 (+249) +13.39%
TokenBlacklist::balance_of_public 2,153 (+249) +13.08%
Token::balance_of_public 2,153 (+249) +13.08%
AuthRegistry::_set_authorized 2,155 (+249) +13.06%
AvmTest::add_storage_map 2,155 (+249) +13.06%
AuthRegistry::is_consumable 2,162 (+249) +13.02%
AvmInitializerTest::constructor 2,206 (+254) +13.01%
Claim::public_dispatch 3,659 (+407) +12.52%
Auth::get_authorized_delay 2,305 (+254) +12.38%
EasyPrivateVoting::add_to_tally_public 2,307 (+249) +12.10%
Lending::get_asset 2,471 (+266) +12.06%
FeeJuice::_increase_public_balance 2,473 (+249) +11.20%
FeeJuice::check_balance 2,476 (+249) +11.18%
InclusionProofs::constructor 2,555 (+254) +11.04%
Uniswap::constructor 2,619 (+254) +10.74%
Crowdfunding::public_dispatch 5,175 (+501) +10.72%
EasyPrivateVoting::constructor 2,656 (+254) +10.57%
Auth::constructor 2,660 (+254) +10.56%
Benchmarking::increment_balance 2,639 (+249) +10.42%
Lending::_deposit 2,811 (+261) +10.24%
NFT::owner_of 2,683 (+249) +10.23%
Spam::public_spam 2,683 (+249) +10.23%
TokenBlacklist::_increase_public_balance 2,742 (+249) +9.99%
Token::_increase_public_balance 2,742 (+249) +9.99%
TokenBlacklist::get_roles 2,953 (+266) +9.90%
Crowdfunding::init 2,983 (+267) +9.83%
PriceFeed::public_dispatch 3,398 (+300) +9.68%
StatefulTest::public_constructor 3,058 (+267) +9.57%
AppSubscription::public_dispatch 4,376 (+381) +9.54%
AvmInitializerTest::public_dispatch 2,964 (+254) +9.37%
Spam::public_dispatch 3,549 (+300) +9.23%
Lending::init 3,224 (+266) +8.99%
AppSubscription::constructor 3,088 (+254) +8.96%
NFT::mint 3,094 (+249) +8.75%
Token::mint_to_public 3,117 (+249) +8.68%
StatefulTest::public_dispatch 6,658 (+517) +8.42%
Benchmarking::public_dispatch 4,306 (+334) +8.41%
InclusionProofs::public_dispatch 4,067 (+305) +8.11%
FeeJuice::public_dispatch 5,711 (+419) +7.92%
NFT::transfer_in_public 3,602 (+262) +7.84%
FPC::public_dispatch 7,797 (+539) +7.43%
AuthRegistry::public_dispatch 8,519 (+576) +7.25%
TokenBlacklist::mint_private 4,008 (+266) +7.11%
AuthRegistry::consume 3,142 (+208) +7.09%
TokenBlacklist::mint_public 4,267 (+266) +6.65%
Token::burn_public 4,442 (+262) +6.27%
Token::transfer_in_public 4,492 (+262) +6.19%
NFT::constructor 4,304 (+249) +6.14%
EasyPrivateVoting::public_dispatch 5,521 (+317) +6.09%
Token::constructor 4,379 (+249) +6.03%
Auth::set_authorized 4,828 (+274) +6.02%
Auth::set_authorized_delay 4,924 (+279) +6.01%
Parent::public_nested_static_call 3,635 (+202) +5.88%
CardGame::on_game_joined 5,374 (+288) +5.66%
Test::public_dispatch 20,227 (+1,080) +5.64%
CardGame::on_cards_claimed 7,693 (+390) +5.34%
TokenBlacklist::burn_public 5,519 (+279) +5.32%
Lending::get_position 5,275 (+266) +5.31%
CardGame::on_card_played 6,314 (+314) +5.23%
Router::public_dispatch 2,484 (+123) +5.21%
Parent::public_dispatch 8,119 (+396) +5.13%
AuthWitTest::public_dispatch 1,748 (+85) +5.11%
NFT::finalize_transfer_to_private 5,878 (+284) +5.08%
NFT::_finalize_transfer_to_private_unsafe 5,925 (+284) +5.03%
Token::finalize_transfer_to_private 6,973 (+334) +5.03%
Token::_finalize_transfer_to_private_unsafe 7,020 (+334) +5.00%
TokenBlacklist::transfer_public 5,899 (+279) +4.96%
TokenBlacklist::shield 6,087 (+279) +4.80%
Lending::_repay 5,949 (+261) +4.59%
Token::finalize_mint_to_private 6,566 (+284) +4.52%
TestLog::public_dispatch 2,486 (+107) +4.50%
Token::_finalize_mint_to_private_unsafe 6,613 (+284) +4.49%
StaticParent::public_dispatch 6,043 (+258) +4.46%
Lending::update_accumulator 6,021 (+257) +4.46%
TokenBlacklist::update_roles 6,416 (+269) +4.38%
TokenBlacklist::constructor 6,511 (+269) +4.31%
NFT::public_dispatch 24,833 (+1,013) +4.25%
Test::consume_message_from_arbitrary_sender_public 8,260 (+329) +4.15%
Auth::public_dispatch 9,159 (+359) +4.08%
CardGame::start_game 7,455 (+290) +4.05%
AvmTest::keccak_hash 2,483 (+85) +3.54%
Token::public_dispatch 32,753 (+1,119) +3.54%
CardGame::public_dispatch 16,767 (+571) +3.53%
Lending::_borrow 7,678 (+261) +3.52%
AvmTest::public_dispatch 62,818 (+2,056) +3.38%
Uniswap::_approve_bridge_and_exit_input_asset_to_L1 6,434 (+210) +3.37%
Test::emit_unencrypted 1,531 (+47) +3.17%
Crowdfunding::_publish_donation_receipts 983 (+30) +3.15%
TokenBlacklist::public_dispatch 23,935 (+722) +3.11%
Lending::_withdraw 8,933 (+269) +3.10%
Test::create_l2_to_l1_message_public 2,270 (+68) +3.09%
Lending::public_dispatch 28,071 (+721) +2.64%
Test::consume_mint_to_public_message 11,169 (+285) +2.62%
TestLog::emit_unencrypted_events 1,179 (+30) +2.61%
NFT::_store_payload_in_transient_storage_unsafe 1,215 (+30) +2.53%
Token::_store_payload_in_transient_storage_unsafe 1,215 (+30) +2.53%
TokenBridge::claim_public 11,667 (+285) +2.50%
AvmTest::emit_unencrypted_log 2,845 (+68) +2.45%
StaticChild::public_dispatch 2,163 (+51) +2.41%
AvmTest::sha256_hash 4,017 (+94) +2.40%
AvmTest::returndata_copy_oracle 1,875 (+42) +2.29%
Uniswap::public_dispatch 23,652 (+516) +2.23%
AvmTest::pedersen_hash 3,163 (+68) +2.20%
AvmTest::pedersen_hash_with_index 3,163 (+68) +2.20%
TokenBridge::public_dispatch 21,182 (+442) +2.13%
TokenBridge::exit_to_l1_public 6,467 (+128) +2.02%
Uniswap::swap_public 15,550 (+280) +1.83%
Token::complete_refund 5,577 (+85) +1.55%
AvmTest::pedersen_commit 1,280 (+17) +1.35%
Child::public_dispatch 4,825 (+51) +1.07%
AvmTest::bulk_testing 23,316 (+212) +0.92%
Lending::borrow_public 1,911 (+8) +0.42%
Lending::withdraw_public 1,911 (+8) +0.42%
FPC::prepare_fee 2,003 (+8) +0.40%
FPC::pay_refund 2,058 (+8) +0.39%
StaticParent::public_nested_static_call 2,063 (+8) +0.39%
Parent::pub_entry_point_twice 983 (-5) -0.51%
Lending::deposit_public 2,563 (-49) -1.88%
Lending::repay_public 2,446 (-49) -1.96%

@asterite asterite force-pushed the ab/cross-block-deduplication-die-inc_rc-fix branch from 3ab959e to 34d171b Compare November 25, 2024 19:26
Copy link
Contributor

github-actions bot commented Nov 25, 2024

Changes to circuit sizes

Generated at commit: a44a2c5ef47d4e357d60161fa377bc8231a0f63b, compared to commit: b51fc43a6fbd07eb89faae5bd518246182fa9d0f

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
rollup_block_root +539,886 ❌ +12026.87% +1,398,367 ❌ +51.04%
rollup_block_root_empty +576 ❌ +612.77% +576 ❌ +19.92%
rollup_root +3,013 ❌ +25.12% +43,278 ❌ +2.33%
rollup_block_merge +3,013 ❌ +25.09% +43,278 ❌ +2.33%
rollup_merge -1,381 ✅ -40.39% -7,842 ✅ -0.43%
rollup_base_public -32,952 ✅ -7.37% -710,141 ✅ -17.76%
rollup_base_private -17,511 ✅ -8.86% -688,769 ✅ -25.91%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
rollup_block_root 544,375 (+539,886) +12026.87% 4,138,019 (+1,398,367) +51.04%
rollup_block_root_empty 670 (+576) +612.77% 3,467 (+576) +19.92%
rollup_root 15,006 (+3,013) +25.12% 1,901,788 (+43,278) +2.33%
rollup_block_merge 15,022 (+3,013) +25.09% 1,901,802 (+43,278) +2.33%
rollup_merge 2,038 (-1,381) -40.39% 1,819,204 (-7,842) -0.43%
rollup_base_public 414,173 (-32,952) -7.37% 3,287,302 (-710,141) -17.76%
rollup_base_private 180,162 (-17,511) -8.86% 1,969,810 (-688,769) -25.91%

@asterite asterite closed this Nov 28, 2024
@asterite asterite deleted the ab/cross-block-deduplication-die-inc_rc-fix branch November 28, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants