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

Add some reference related tests #1971

Merged
merged 3 commits into from
Oct 25, 2024
Merged

Add some reference related tests #1971

merged 3 commits into from
Oct 25, 2024

Conversation

iamyulong
Copy link
Member

Summary

Add some reference related tests.

Copy link

github-actions bot commented Oct 23, 2024

Docker tags
docker.io/radixdlt/private-scrypto-builder:9c775bbd68

Copy link

github-actions bot commented Oct 23, 2024

Benchmark for 9c775bb

Click to view benchmark
Test Base PR %
costing::bench_prepare_wasm 44.7±0.19ms 44.5±0.09ms -0.45%
costing::decode_encoded_i8_array_to_manifest_raw_value 19.4±0.09ms 19.3±0.03ms -0.52%
costing::decode_encoded_i8_array_to_manifest_value 42.7±0.11ms 41.4±0.06ms -3.04%
costing::decode_encoded_tuple_array_to_manifest_raw_value 61.3±0.25ms 70.3±0.08ms +14.68%
costing::decode_encoded_tuple_array_to_manifest_value 98.9±0.24ms 98.9±0.18ms 0.00%
costing::decode_encoded_u8_array_to_manifest_raw_value 32.2±0.14µs 25.6±0.09µs -20.50%
costing::decode_encoded_u8_array_to_manifest_value 42.4±0.06ms 41.4±0.09ms -2.36%
costing::decode_rpd_to_manifest_raw_value 12.8±0.03µs 14.6±0.04µs +14.06%
costing::decode_rpd_to_manifest_value 11.5±0.07µs 10.7±0.02µs -6.96%
costing::deserialize_wasm 1218.3±6.82µs 1213.0±11.77µs -0.44%
costing::execute_transaction_creating_big_vec_substates 687.1±8.89ms 689.4±7.89ms +0.33%
costing::execute_transaction_reading_big_vec_substates 605.8±2.02ms 587.6±0.62ms -3.00%
costing::instantiate_flash_loan 992.7±972.27µs 994.3±924.16µs +0.16%
costing::instantiate_radiswap 988.2±850.42µs 859.0±215.62µs -13.07%
costing::spin_loop 20.3±0.08ms 17.9±0.04ms -11.82%
costing::spin_loop_v2 2.7±0.00s 2.6±0.01s -3.70%
costing::spin_loop_v3 622.1±2.69ms 613.6±3.70ms -1.37%
costing::validate_sbor_payload 29.6±0.09µs 29.4±0.10µs -0.68%
costing::validate_sbor_payload_bytes 262.2±3.54ns 245.8±0.90ns -6.25%
costing::validate_secp256k1 76.8±0.17µs 78.1±0.11µs +1.69%
costing::validate_wasm 34.0±0.05ms 33.5±0.08ms -1.47%
decimal::add/0 8.4±0.00ns 8.4±0.00ns 0.00%
decimal::add/rust-native 9.8±0.01ns 9.8±0.01ns 0.00%
decimal::add/wasmi 216.4±0.26ns 219.1±0.58ns +1.25%
decimal::add/wasmi-call-native 2.1±0.01µs 2.1±0.00µs 0.00%
decimal::div/0 165.5±0.07ns 164.1±0.12ns -0.85%
decimal::from_string/0 165.8±0.27ns 162.2±0.27ns -2.17%
decimal::mul/0 127.4±0.12ns 127.1±0.10ns -0.24%
decimal::mul/rust-native 123.4±0.15ns 122.7±0.16ns -0.57%
decimal::mul/wasmi 11.2±0.17µs 11.4±0.10µs +1.79%
decimal::mul/wasmi-call-native 2.2±0.00µs 2.3±0.00µs +4.55%
decimal::pow/0 579.6±0.43ns 576.1±0.91ns -0.60%
decimal::pow/rust-native 573.3±0.45ns 572.9±0.63ns -0.07%
decimal::pow/wasmi 57.0±0.44µs 57.3±0.32µs +0.53%
decimal::pow/wasmi-call-native 3.2±0.01µs 3.1±0.00µs -3.13%
decimal::root/0 8.0±0.01µs 8.1±0.01µs +1.25%
decimal::sub/0 8.2±0.01ns 8.3±0.03ns +1.22%
decimal::to_string/0 440.3±1.76ns 444.5±1.00ns +0.95%
large_transaction_processing::prepare 2.4±0.00ms 2.4±0.00ms 0.00%
large_transaction_processing::prepare_and_decompile 6.3±0.02ms 6.2±0.02ms -1.59%
large_transaction_processing::prepare_and_decompile_and_recompile 31.8±0.28ms 28.7±2.94ms -9.75%
metadata_validation::validate_urls 4.9±0.01µs N/A N/A
precise_decimal::add/0 8.8±0.01ns 8.8±0.02ns 0.00%
precise_decimal::add/rust-native 10.7±0.06ns 11.0±0.22ns +2.80%
precise_decimal::add/wasmi 275.1±1.56ns 281.8±0.59ns +2.44%
precise_decimal::add/wasmi-call-native 2.8±0.02µs 3.0±0.00µs +7.14%
precise_decimal::div/0 278.3±0.72ns 279.7±0.30ns +0.50%
precise_decimal::from_string/0 206.3±0.45ns 213.8±0.29ns +3.64%
precise_decimal::mul/0 321.7±0.61ns 344.0±1.35ns +6.93%
precise_decimal::mul/rust-native 290.5±1.50ns 275.3±0.44ns -5.23%
precise_decimal::mul/wasmi 32.9±0.32µs 33.4±0.08µs +1.52%
precise_decimal::mul/wasmi-call-native 3.2±0.01µs 3.1±0.00µs -3.13%
precise_decimal::pow/0 1691.6±5.44ns 1720.3±4.53ns +1.70%
precise_decimal::pow/rust-native 1317.9±1.63ns 1318.3±1.87ns +0.03%
precise_decimal::pow/wasmi 163.3±1.04µs 160.5±1.73µs -1.71%
precise_decimal::pow/wasmi-call-native 5.3±0.01µs 5.3±0.01µs 0.00%
precise_decimal::root/0 58.4±0.08µs 58.3±0.04µs -0.17%
precise_decimal::sub/0 9.1±0.04ns 9.0±0.01ns -1.10%
precise_decimal::to_string/0 698.3±1.93ns 712.4±0.84ns +2.02%
schema::validate_payload 379.6±0.54µs 384.7±0.87µs +1.34%
transaction::radiswap 4.8±0.02ms 4.8±0.02ms 0.00%
transaction::transfer 1805.4±4.31µs 1813.5±5.27µs +0.45%
transaction_validation::validate_manifest 43.2±0.12µs 43.2±0.09µs 0.00%
transaction_validation::verify_bls_2KB 1007.4±11.21µs 1064.8±15.73µs +5.70%
transaction_validation::verify_bls_32B 1003.3±7.80µs 1002.4±10.25µs -0.09%
transaction_validation::verify_ecdsa 74.9±0.33µs 74.7±0.12µs -0.27%
transaction_validation::verify_ed25519 46.2±0.07µs 47.8±0.12µs +3.46%

})
.manifest_builder(|builder| {
builder
// Unfortunately, there is no way to grab the received references
Copy link
Contributor

@dhedey dhedey Oct 25, 2024

Choose a reason for hiding this comment

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

This test doesn't show whether we can use those references? Can we try doing a vault freeze here perhaps?

Or wait I assume this just-works because it's already in the subintent manifest? So... passing references doesn't do anything really?

Okay cool no worries :)

@@ -0,0 +1,268 @@
use radix_engine_tests::common::PackageLoader;
use scrypto_test::prelude::*;

Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth a quick comment at the top explaining that these tests mostly just demonstrate existing behaviour, so we can protect ourselves against future regressions? (rather than being concrete product requirements).

Copy link
Member Author

Choose a reason for hiding this comment

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

For sure, to prevent regression and also to make sure relevant code paths are covered.

use scrypto_test::prelude::*;

#[test]
fn can_transfer_locked_bucket_between_threads() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume we have a test elsewhere which Josh added which checks we can't transfer a proof between threads? Maybe that should be moved here?

Copy link
Member Author

@iamyulong iamyulong Oct 25, 2024

Choose a reason for hiding this comment

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

I assumed so, but didn't find any. Let me just add one.

@iamyulong iamyulong merged commit 662f9be into develop Oct 25, 2024
30 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