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

Improve the static analyzer to understand that some resources are not returned in invocations #2063

Conversation

0xOmarA
Copy link
Member

@0xOmarA 0xOmarA commented Jan 21, 2025

Summary

This PR improves the static analyzer so that it understands that some invocations will return resources that we know are not the input resources. This is particularly useful in staking transactions.

Tests

Tested that the XRD state is known in the worktop after a stake.

@0xOmarA 0xOmarA requested a review from a team as a code owner January 21, 2025 20:20
Copy link

Docker tags
docker.io/radixdlt/private-scrypto-builder:17c40570af

Copy link

Docker tags
docker.io/radixdlt/private-scrypto-dev-container:17c40570af

Copy link

Benchmark for 17c4057

Click to view benchmark
Test Base PR %
costing::bench_prepare_wasm 44.8±0.22ms 45.4±0.28ms +1.34%
costing::decode_encoded_i8_array_to_manifest_raw_value 19.3±0.02ms 19.3±0.01ms 0.00%
costing::decode_encoded_i8_array_to_manifest_value 41.7±0.06ms 42.6±0.07ms +2.16%
costing::decode_encoded_tuple_array_to_manifest_raw_value 70.6±0.09ms 72.0±0.08ms +1.98%
costing::decode_encoded_tuple_array_to_manifest_value 98.8±0.23ms 98.5±0.29ms -0.30%
costing::decode_encoded_u8_array_to_manifest_raw_value 31.8±0.11µs 25.7±0.10µs -19.18%
costing::decode_encoded_u8_array_to_manifest_value 41.7±0.29ms 42.5±0.03ms +1.92%
costing::decode_rpd_to_manifest_raw_value 14.6±0.05µs 14.6±0.03µs 0.00%
costing::decode_rpd_to_manifest_value 10.8±0.02µs 11.3±0.03µs +4.63%
costing::deserialize_wasm 1219.3±4.35µs 1239.0±6.78µs +1.62%
costing::execute_transaction_creating_big_vec_substates 705.1±9.78ms 698.2±9.09ms -0.98%
costing::execute_transaction_reading_big_vec_substates 583.9±1.70ms 630.2±1.56ms +7.93%
costing::instantiate_flash_loan 1030.2±1459.43µs 965.7±1174.75µs -6.26%
costing::instantiate_radiswap 936.8±409.02µs 944.5±581.14µs +0.82%
costing::scrypto_malloc 671.9±3.27ms 642.8±1.44ms -4.33%
costing::scrypto_sbor_decode 668.7±1.26ms 646.1±1.10ms -3.38%
costing::scrypto_sha256 591.3±0.95ms 579.7±0.96ms -1.96%
costing::spin_loop_v1 522.4±1.64ms 509.9±1.07ms -2.39%
costing::spin_loop_v2 595.4±1.07ms 607.6±1.09ms +2.05%
costing::validate_sbor_payload 29.4±0.07µs 29.5±0.09µs +0.34%
costing::validate_sbor_payload_bytes 259.2±0.65ns 257.2±1.59ns -0.77%
costing::validate_secp256k1 76.7±0.05µs 76.7±0.11µs 0.00%
costing::validate_wasm 33.9±0.05ms 33.6±0.04ms -0.88%
decimal::add/0 8.4±0.00ns 8.4±0.00ns 0.00%
decimal::add/rust-native 9.8±0.00ns 9.8±0.00ns 0.00%
decimal::add/wasmi 312.7±3.06ns 308.9±2.06ns -1.22%
decimal::add/wasmi-call-native 3.0±0.01µs 3.0±0.00µs 0.00%
decimal::div/0 174.2±0.31ns 167.0±0.18ns -4.13%
decimal::from_string/0 166.4±0.15ns 157.0±0.10ns -5.65%
decimal::mul/0 128.4±0.18ns 128.3±0.10ns -0.08%
decimal::mul/rust-native 128.4±0.19ns 125.2±0.16ns -2.49%
decimal::mul/wasmi 19.7±0.06µs 19.7±0.05µs 0.00%
decimal::mul/wasmi-call-native 3.1±0.01µs 3.2±0.01µs +3.23%
decimal::pow/0 592.6±0.43ns 592.5±0.28ns -0.02%
decimal::pow/rust-native 591.3±0.14ns 591.0±0.28ns -0.05%
decimal::pow/wasmi 92.2±0.24µs 94.1±0.16µs +2.06%
decimal::pow/wasmi-call-native 4.9±0.02µs 4.9±0.01µs 0.00%
decimal::root/0 8.1±0.01µs 8.1±0.01µs 0.00%
decimal::sub/0 8.2±0.00ns 8.2±0.06ns 0.00%
decimal::to_string/0 449.3±1.44ns 445.1±0.64ns -0.93%
large_transaction_processing::prepare 2.6±0.00ms 2.5±0.00ms -3.85%
large_transaction_processing::prepare_and_decompile 6.2±0.03ms 6.4±0.03ms +3.23%
large_transaction_processing::prepare_and_decompile_and_recompile 32.0±0.30ms 32.2±0.27ms +0.62%
metadata_validation::validate_urls 4.7±0.00µs 4.7±0.01µs 0.00%
precise_decimal::add/0 8.7±0.06ns 8.7±0.02ns 0.00%
precise_decimal::add/rust-native 10.7±0.01ns 10.7±0.01ns 0.00%
precise_decimal::add/wasmi 417.8±2.25ns 421.9±1.71ns +0.98%
precise_decimal::add/wasmi-call-native 3.9±0.01µs 4.0±0.02µs +2.56%
precise_decimal::div/0 289.7±0.34ns 290.3±0.21ns +0.21%
precise_decimal::from_string/0 206.7±0.15ns 200.9±0.21ns -2.81%
precise_decimal::mul/0 331.4±0.37ns 331.4±0.24ns 0.00%
precise_decimal::mul/rust-native 284.5±0.37ns 286.2±0.67ns +0.60%
precise_decimal::mul/wasmi 49.0±0.13µs 49.7±0.12µs +1.43%
precise_decimal::mul/wasmi-call-native 4.2±0.01µs 4.4±0.01µs +4.76%
precise_decimal::pow/0 1728.7±1.97ns 1728.1±1.78ns -0.03%
precise_decimal::pow/rust-native 1358.4±1.03ns 1363.3±2.12ns +0.36%
precise_decimal::pow/wasmi 233.0±0.34µs 238.2±0.63µs +2.23%
precise_decimal::pow/wasmi-call-native 7.5±0.03µs 7.6±0.02µs +1.33%
precise_decimal::root/0 59.3±0.04µs 58.4±0.05µs -1.52%
precise_decimal::sub/0 9.0±0.05ns 9.0±0.02ns 0.00%
precise_decimal::to_string/0 719.6±0.89ns 695.4±0.71ns -3.36%
schema::validate_payload 379.6±0.44µs 387.6±0.31µs +2.11%
transaction::radiswap 5.0±0.02ms 5.0±0.02ms 0.00%
transaction::transfer 1804.0±3.47µs 1814.9±4.04µs +0.60%
transaction_validation::validate_manifest 43.2±0.06µs 43.2±0.04µs 0.00%
transaction_validation::verify_bls_2KB 1006.4±16.62µs 1064.3±11.94µs +5.75%
transaction_validation::verify_bls_32B 1004.7±13.08µs 1012.0±22.01µs +0.73%
transaction_validation::verify_ecdsa 74.7±0.16µs 74.6±0.06µs -0.13%
transaction_validation::verify_ed25519 42.3±0.10µs 46.3±0.12µs +9.46%

@0xOmarA 0xOmarA merged commit 921c342 into release/cuttlefish Jan 22, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants