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 #9972

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TomAFrench
Copy link
Member

Please read contributing guidelines and remove this line.

Copy link
Contributor

Changes to public function bytecode sizes

Generated at commit: 709640d1fc62d4aaecb608707f9fc1d2ef3bfa8c, compared to commit: 8f41beef025b7c28fe09bacdf5fe29d1142a5d74

🧾 Summary (100% most significant diffs)

Program Bytecode size in bytes (+/-) %
AvmTest::public_dispatch -30 ✅ -0.05%
AuthRegistry::public_dispatch -5 ✅ -0.06%
Parent::public_dispatch -5 ✅ -0.06%
FPC::public_dispatch -5 ✅ -0.06%
TokenBlacklist::public_dispatch -15 ✅ -0.06%
Uniswap::public_dispatch -15 ✅ -0.06%
StatefulTest::public_dispatch -5 ✅ -0.06%
AvmTest::bulk_testing -15 ✅ -0.06%
StaticParent::public_dispatch -5 ✅ -0.07%
CardGame::on_cards_claimed -5 ✅ -0.07%
Uniswap::_approve_bridge_and_exit_input_asset_to_L1 -5 ✅ -0.08%
TokenBlacklist::shield -5 ✅ -0.08%
FeeJuice::public_dispatch -5 ✅ -0.08%
TokenBlacklist::transfer_public -5 ✅ -0.08%
EasyPrivateVoting::public_dispatch -5 ✅ -0.08%
Auth::set_authorized_delay -5 ✅ -0.08%
TokenBlacklist::burn_public -5 ✅ -0.08%
Benchmarking::public_dispatch -5 ✅ -0.09%
Auth::public_dispatch -10 ✅ -0.09%
Uniswap::swap_public -15 ✅ -0.10%
Lending::get_position -5 ✅ -0.10%
Token::constructor -5 ✅ -0.10%
Test::public_dispatch -20 ✅ -0.10%
Token::transfer_in_public -5 ✅ -0.10%
NFT::constructor -5 ✅ -0.10%
Token::burn_public -5 ✅ -0.11%
TokenBlacklist::mint_public -5 ✅ -0.11%
TokenBlacklist::mint_private -5 ✅ -0.12%
PriceFeed::public_dispatch -5 ✅ -0.12%
TokenBridge::exit_to_l1_public -10 ✅ -0.13%
Test::consume_message_from_arbitrary_sender_public -10 ✅ -0.13%
NFT::transfer_in_public -5 ✅ -0.13%
Benchmarking::increment_balance -5 ✅ -0.13%
Token::mint_to_public -5 ✅ -0.14%
NFT::mint -5 ✅ -0.15%
AuthRegistry::consume -5 ✅ -0.15%
Lending::public_dispatch -44 ✅ -0.15%
TokenBridge::claim_public -20 ✅ -0.15%
Lending::init -5 ✅ -0.16%
TokenBridge::public_dispatch -35 ✅ -0.16%
Lending::_repay -10 ✅ -0.16%
Child::public_dispatch -10 ✅ -0.16%
Token::public_dispatch -55 ✅ -0.16%
Auth::set_authorized -10 ✅ -0.17%
Lending::_borrow -15 ✅ -0.17%
TokenBlacklist::_increase_public_balance -5 ✅ -0.18%
Token::_increase_public_balance -5 ✅ -0.18%
NFT::owner_of -5 ✅ -0.18%
TokenBlacklist::get_roles -5 ✅ -0.18%
Test::consume_mint_to_public_message -20 ✅ -0.18%
AvmTest::keccak_hash -5 ✅ -0.18%
TokenBlacklist::constructor -15 ✅ -0.19%
FeeJuice::_increase_public_balance -5 ✅ -0.19%
TokenBlacklist::update_roles -15 ✅ -0.19%
Lending::deposit_public -5 ✅ -0.20%
EasyPrivateVoting::add_to_tally_public -5 ✅ -0.20%
FeeJuice::check_balance -5 ✅ -0.20%
Lending::repay_public -5 ✅ -0.21%
NFT::public_dispatch -55 ✅ -0.21%
Lending::_withdraw -20 ✅ -0.22%
AvmTest::add_storage_map -5 ✅ -0.22%
Lending::get_asset -5 ✅ -0.23%
NFT::set_minter -5 ✅ -0.23%
Token::set_minter -5 ✅ -0.23%
StatefulTest::increment_public_value -5 ✅ -0.23%
AuthRegistry::is_consumable -5 ✅ -0.23%
TokenBlacklist::balance_of_public -5 ✅ -0.24%
Token::balance_of_public -5 ✅ -0.24%
StatefulTest::increment_public_value_no_init_check -5 ✅ -0.24%
FeeJuice::balance_of_public -5 ✅ -0.24%
Lending::update_accumulator -14 ✅ -0.24%
AuthRegistry::_set_authorized -5 ✅ -0.24%
FPC::pay_refund -5 ✅ -0.24%
NFT::is_minter -5 ✅ -0.25%
Token::is_minter -5 ✅ -0.25%
AuthRegistry::set_authorized -5 ✅ -0.25%
FPC::prepare_fee -5 ✅ -0.25%
Benchmarking::broadcast -5 ✅ -0.25%
PriceFeed::get_price -5 ✅ -0.25%
AuthRegistry::is_reject_all -5 ✅ -0.25%
StatefulTest::get_public_value -5 ✅ -0.26%
AvmTest::set_storage_map -5 ✅ -0.26%
PriceFeed::set_price -5 ✅ -0.26%
AvmTest::read_storage_map -5 ✅ -0.26%
NFT::_finish_transfer_to_public -5 ✅ -0.26%
Spam::public_dispatch -10 ✅ -0.26%
Lending::withdraw_public -5 ✅ -0.26%
Lending::borrow_public -5 ✅ -0.26%
AuthRegistry::set_reject_all -5 ✅ -0.27%
AvmTest::poseidon2_hash -5 ✅ -0.29%
Lending::_deposit -10 ✅ -0.33%
Spam::public_spam -10 ✅ -0.36%
Child::set_value_twice_with_nested_last -5 ✅ -0.41%
Child::set_value_twice_with_nested_first -5 ✅ -0.41%
StaticParent::public_nested_static_call -10 ✅ -0.41%
DocsExample::get_shared_immutable_constrained_public_indirect -5 ✅ -0.49%
AvmTest::returndata_copy_oracle -10 ✅ -0.50%
Parent::pub_entry_point_twice -5 ✅ -0.51%
AvmTest::nested_call_to_add -5 ✅ -0.51%
AvmTest::nested_static_call_to_add -5 ✅ -0.51%
AvmTest::nested_call_to_assert_same -5 ✅ -0.51%
StaticParent::public_get_value_from_child -5 ✅ -0.52%
AvmTest::nested_call_to_add_with_gas -5 ✅ -0.52%
AvmTest::external_call_to_divide_by_zero -5 ✅ -0.55%
Token::_finalize_transfer_to_private_unsafe -55 ✅ -0.75%
Token::finalize_transfer_to_private -55 ✅ -0.75%
Token::_finalize_mint_to_private_unsafe -55 ✅ -0.77%
Token::finalize_mint_to_private -55 ✅ -0.77%
DocsExample::public_dispatch -51 ✅ -0.84%
NFT::_finalize_transfer_to_private_unsafe -55 ✅ -0.85%
NFT::finalize_transfer_to_private -55 ✅ -0.85%
Token::complete_refund -50 ✅ -0.85%
CardGame::on_card_played -51 ✅ -0.86%
CardGame::on_game_joined -51 ✅ -1.01%
CardGame::public_dispatch -166 ✅ -1.02%
CardGame::start_game -74 ✅ -1.06%

Full diff report 👇
Program Bytecode size in bytes (+/-) %
AvmTest::public_dispatch 61,331 (-30) -0.05%
AuthRegistry::public_dispatch 8,510 (-5) -0.06%
Parent::public_dispatch 8,509 (-5) -0.06%
FPC::public_dispatch 8,468 (-5) -0.06%
TokenBlacklist::public_dispatch 25,351 (-15) -0.06%
Uniswap::public_dispatch 25,061 (-15) -0.06%
StatefulTest::public_dispatch 8,170 (-5) -0.06%
AvmTest::bulk_testing 23,780 (-15) -0.06%
StaticParent::public_dispatch 7,373 (-5) -0.07%
CardGame::on_cards_claimed 7,333 (-5) -0.07%
Uniswap::_approve_bridge_and_exit_input_asset_to_L1 6,468 (-5) -0.08%
TokenBlacklist::shield 6,433 (-5) -0.08%
FeeJuice::public_dispatch 6,344 (-5) -0.08%
TokenBlacklist::transfer_public 6,328 (-5) -0.08%
EasyPrivateVoting::public_dispatch 6,130 (-5) -0.08%
Auth::set_authorized_delay 5,963 (-5) -0.08%
TokenBlacklist::burn_public 5,895 (-5) -0.08%
Benchmarking::public_dispatch 5,655 (-5) -0.09%
Auth::public_dispatch 10,898 (-10) -0.09%
Uniswap::swap_public 15,708 (-15) -0.10%
Lending::get_position 5,233 (-5) -0.10%
Token::constructor 5,160 (-5) -0.10%
Test::public_dispatch 20,344 (-20) -0.10%
Token::transfer_in_public 4,814 (-5) -0.10%
NFT::constructor 4,804 (-5) -0.10%
Token::burn_public 4,706 (-5) -0.11%
TokenBlacklist::mint_public 4,628 (-5) -0.11%
TokenBlacklist::mint_private 4,311 (-5) -0.12%
PriceFeed::public_dispatch 4,067 (-5) -0.12%
TokenBridge::exit_to_l1_public 7,986 (-10) -0.13%
Test::consume_message_from_arbitrary_sender_public 7,967 (-10) -0.13%
NFT::transfer_in_public 3,731 (-5) -0.13%
Benchmarking::increment_balance 3,708 (-5) -0.13%
Token::mint_to_public 3,520 (-5) -0.14%
NFT::mint 3,359 (-5) -0.15%
AuthRegistry::consume 3,239 (-5) -0.15%
Lending::public_dispatch 28,489 (-44) -0.15%
TokenBridge::claim_public 12,936 (-20) -0.15%
Lending::init 3,187 (-5) -0.16%
TokenBridge::public_dispatch 22,157 (-35) -0.16%
Lending::_repay 6,169 (-10) -0.16%
Child::public_dispatch 6,131 (-10) -0.16%
Token::public_dispatch 33,598 (-55) -0.16%
Auth::set_authorized 6,044 (-10) -0.17%
Lending::_borrow 8,994 (-15) -0.17%
TokenBlacklist::_increase_public_balance 2,850 (-5) -0.18%
Token::_increase_public_balance 2,850 (-5) -0.18%
NFT::owner_of 2,791 (-5) -0.18%
TokenBlacklist::get_roles 2,790 (-5) -0.18%
Test::consume_mint_to_public_message 11,084 (-20) -0.18%
AvmTest::keccak_hash 2,744 (-5) -0.18%
TokenBlacklist::constructor 7,923 (-15) -0.19%
FeeJuice::_increase_public_balance 2,581 (-5) -0.19%
TokenBlacklist::update_roles 7,684 (-15) -0.19%
Lending::deposit_public 2,550 (-5) -0.20%
EasyPrivateVoting::add_to_tally_public 2,542 (-5) -0.20%
FeeJuice::check_balance 2,436 (-5) -0.20%
Lending::repay_public 2,433 (-5) -0.21%
NFT::public_dispatch 26,406 (-55) -0.21%
Lending::_withdraw 9,253 (-20) -0.22%
AvmTest::add_storage_map 2,311 (-5) -0.22%
Lending::get_asset 2,204 (-5) -0.23%
NFT::set_minter 2,200 (-5) -0.23%
Token::set_minter 2,195 (-5) -0.23%
StatefulTest::increment_public_value 2,142 (-5) -0.23%
AuthRegistry::is_consumable 2,132 (-5) -0.23%
TokenBlacklist::balance_of_public 2,117 (-5) -0.24%
Token::balance_of_public 2,117 (-5) -0.24%
StatefulTest::increment_public_value_no_init_check 2,093 (-5) -0.24%
FeeJuice::balance_of_public 2,063 (-5) -0.24%
Lending::update_accumulator 5,750 (-14) -0.24%
AuthRegistry::_set_authorized 2,049 (-5) -0.24%
FPC::pay_refund 2,045 (-5) -0.24%
NFT::is_minter 2,019 (-5) -0.25%
Token::is_minter 2,019 (-5) -0.25%
AuthRegistry::set_authorized 2,002 (-5) -0.25%
FPC::prepare_fee 1,990 (-5) -0.25%
Benchmarking::broadcast 1,989 (-5) -0.25%
PriceFeed::get_price 1,983 (-5) -0.25%
AuthRegistry::is_reject_all 1,965 (-5) -0.25%
StatefulTest::get_public_value 1,955 (-5) -0.26%
AvmTest::set_storage_map 1,951 (-5) -0.26%
PriceFeed::set_price 1,941 (-5) -0.26%
AvmTest::read_storage_map 1,924 (-5) -0.26%
NFT::_finish_transfer_to_public 1,924 (-5) -0.26%
Spam::public_dispatch 3,833 (-10) -0.26%
Lending::withdraw_public 1,898 (-5) -0.26%
Lending::borrow_public 1,898 (-5) -0.26%
AuthRegistry::set_reject_all 1,840 (-5) -0.27%
AvmTest::poseidon2_hash 1,729 (-5) -0.29%
Lending::_deposit 3,031 (-10) -0.33%
Spam::public_spam 2,786 (-10) -0.36%
Child::set_value_twice_with_nested_last 1,223 (-5) -0.41%
Child::set_value_twice_with_nested_first 1,223 (-5) -0.41%
StaticParent::public_nested_static_call 2,415 (-10) -0.41%
DocsExample::get_shared_immutable_constrained_public_indirect 1,020 (-5) -0.49%
AvmTest::returndata_copy_oracle 2,000 (-10) -0.50%
Parent::pub_entry_point_twice 983 (-5) -0.51%
AvmTest::nested_call_to_add 974 (-5) -0.51%
AvmTest::nested_static_call_to_add 974 (-5) -0.51%
AvmTest::nested_call_to_assert_same 974 (-5) -0.51%
StaticParent::public_get_value_from_child 960 (-5) -0.52%
AvmTest::nested_call_to_add_with_gas 949 (-5) -0.52%
AvmTest::external_call_to_divide_by_zero 911 (-5) -0.55%
Token::_finalize_transfer_to_private_unsafe 7,307 (-55) -0.75%
Token::finalize_transfer_to_private 7,260 (-55) -0.75%
Token::_finalize_mint_to_private_unsafe 7,097 (-55) -0.77%
Token::finalize_mint_to_private 7,050 (-55) -0.77%
DocsExample::public_dispatch 6,041 (-51) -0.84%
NFT::_finalize_transfer_to_private_unsafe 6,427 (-55) -0.85%
NFT::finalize_transfer_to_private 6,380 (-55) -0.85%
Token::complete_refund 5,798 (-50) -0.85%
CardGame::on_card_played 5,896 (-51) -0.86%
CardGame::on_game_joined 4,995 (-51) -1.01%
CardGame::public_dispatch 16,077 (-166) -1.02%
CardGame::start_game 6,891 (-74) -1.06%

@TomAFrench
Copy link
Member Author

@jfecher Looks like this optimization has some correctness bugs.

@jfecher
Copy link
Contributor

jfecher commented Nov 14, 2024

Difficult to tell what the issue is from the CI failures here since the ones I've seen were all typescript errors.

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