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

Test storage capacity update on FLOW transfer #2193

Merged
merged 6 commits into from
Sep 3, 2022

Conversation

robert-e-davidson3
Copy link
Contributor

@robert-e-davidson3 robert-e-davidson3 commented Mar 23, 2022

Test for verifying the fix for this bug: onflow/cadence#1367

@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2022

FVM Benchstat comparison

This branch with compared with the base branch onflow:master commit 9f2fbd1

The command (for i in {1..10}; do go test ./fvm ./engine/execution/computation --bench . --tags relic -shuffle=on --benchmem --run ^$; done) was used.

Collapsed results for better readability

old.txtnew.txt
time/opdelta
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64
RuntimeNFTBatchTransfer-2112ms ± 1%113ms ± 4%~(p=0.068 n=8+10)
RuntimeTransaction/reference_tx-226.3ms ±13%24.9ms ± 8%~(p=0.095 n=10+9)
RuntimeTransaction/convert_int_to_string-227.2ms ± 7%27.8ms ±10%~(p=0.720 n=9+10)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-228.8ms ± 6%28.9ms ± 3%~(p=1.000 n=8+10)
RuntimeTransaction/get_signer_address-226.0ms ± 7%25.9ms ± 6%~(p=0.730 n=9+9)
RuntimeTransaction/get_public_account-229.0ms ± 4%28.7ms ± 5%~(p=0.436 n=10+10)
RuntimeTransaction/get_account_and_get_balance-2279ms ± 1%277ms ± 2%~(p=0.460 n=8+10)
RuntimeTransaction/get_account_and_get_available_balance-2257ms ± 2%256ms ± 1%~(p=0.796 n=10+10)
RuntimeTransaction/get_account_and_get_storage_used-231.2ms ± 7%30.7ms ± 5%~(p=0.393 n=10+10)
RuntimeTransaction/get_account_and_get_storage_capacity-2230ms ± 2%230ms ± 1%~(p=0.340 n=9+9)
RuntimeTransaction/get_signer_vault-234.9ms ± 3%34.1ms ± 7%~(p=0.079 n=9+10)
RuntimeTransaction/get_signer_receiver-243.2ms ± 4%44.1ms ± 5%~(p=0.218 n=10+10)
RuntimeTransaction/transfer_tokens-2206ms ± 2%206ms ± 2%~(p=0.853 n=10+10)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-234.0ms ± 7%33.8ms ± 4%~(p=0.529 n=10+10)
RuntimeTransaction/load_and_save_long_string_on_signers_address-276.9ms ± 5%77.1ms ± 3%~(p=0.853 n=10+10)
RuntimeTransaction/create_new_account-2843ms ± 1%839ms ± 1%~(p=0.143 n=10+10)
RuntimeTransaction/call_empty_contract_function-229.1ms ± 4%28.8ms ± 4%~(p=0.315 n=9+10)
RuntimeTransaction/emit_event-243.7ms ± 5%44.0ms ± 4%~(p=0.481 n=10+10)
RuntimeTransaction/borrow_array_from_storage-2125ms ± 4%127ms ± 4%~(p=0.247 n=10+10)
RuntimeTransaction/copy_array_from_storage-2129ms ± 3%130ms ± 1%~(p=0.447 n=10+9)
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64
ComputeBlock/16/cols/128/txes-24.68s ± 3%4.69s ± 2%~(p=0.684 n=10+10)
 
alloc/opdelta
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64
RuntimeNFTBatchTransfer-258.3MB ± 3%58.4MB ± 3%~(p=0.739 n=10+10)
RuntimeTransaction/reference_tx-237.5MB ± 4%37.0MB ± 9%~(p=0.579 n=10+10)
RuntimeTransaction/convert_int_to_string-237.0MB ± 5%36.8MB ± 4%~(p=0.739 n=10+10)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-237.5MB ± 6%37.3MB ± 4%~(p=0.549 n=9+10)
RuntimeTransaction/get_signer_address-237.5MB ± 6%36.8MB ± 4%~(p=0.203 n=8+10)
RuntimeTransaction/get_public_account-239.1MB ± 5%38.2MB ± 7%~(p=0.165 n=10+10)
RuntimeTransaction/get_account_and_get_balance-2140MB ± 2%140MB ± 3%~(p=0.684 n=10+10)
RuntimeTransaction/get_account_and_get_available_balance-2124MB ± 2%124MB ± 2%~(p=1.000 n=10+10)
RuntimeTransaction/get_account_and_get_storage_used-238.6MB ± 7%37.9MB ± 2%~(p=0.604 n=10+9)
RuntimeTransaction/get_account_and_get_storage_capacity-2117MB ± 3%118MB ± 2%~(p=0.353 n=10+10)
RuntimeTransaction/get_signer_vault-239.5MB ± 5%38.8MB ± 8%~(p=0.218 n=10+10)
RuntimeTransaction/get_signer_receiver-240.7MB ± 5%41.3MB ± 4%~(p=0.247 n=10+10)
RuntimeTransaction/transfer_tokens-290.2MB ± 4%90.8MB ± 3%~(p=0.684 n=10+10)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-239.2MB ±10%38.7MB ± 6%~(p=0.579 n=10+10)
RuntimeTransaction/load_and_save_long_string_on_signers_address-258.3MB ± 6%57.3MB ± 2%~(p=0.133 n=10+9)
RuntimeTransaction/create_new_account-2208MB ± 3%209MB ± 0%~(p=0.133 n=10+7)
RuntimeTransaction/call_empty_contract_function-238.0MB ± 4%37.8MB ± 3%~(p=1.000 n=9+10)
RuntimeTransaction/emit_event-242.5MB ± 3%42.9MB ± 5%~(p=0.393 n=10+10)
RuntimeTransaction/borrow_array_from_storage-268.6MB ± 3%69.0MB ± 4%~(p=0.529 n=10+10)
RuntimeTransaction/copy_array_from_storage-283.9MB ± 4%84.8MB ± 2%~(p=0.400 n=10+9)
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64
ComputeBlock/16/cols/128/txes-21.32GB ± 1%1.32GB ± 1%~(p=1.000 n=10+10)
 
allocs/opdelta
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64
RuntimeNFTBatchTransfer-2304k ± 0%304k ± 0%+0.25%(p=0.006 n=10+8)
RuntimeTransaction/reference_tx-289.2k ± 0%89.2k ± 0%~(p=0.095 n=10+8)
RuntimeTransaction/convert_int_to_string-2103k ± 0%103k ± 0%~(p=0.794 n=9+10)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-2118k ± 0%118k ± 0%~(p=0.565 n=10+10)
RuntimeTransaction/get_signer_address-294.4k ± 0%94.4k ± 0%~(p=0.382 n=10+10)
RuntimeTransaction/get_public_account-2118k ± 0%118k ± 0%~(p=0.402 n=10+10)
RuntimeTransaction/get_account_and_get_balance-21.70M ± 0%1.70M ± 0%~(p=0.362 n=10+10)
RuntimeTransaction/get_account_and_get_available_balance-21.57M ± 0%1.57M ± 0%~(p=0.631 n=10+10)
RuntimeTransaction/get_account_and_get_storage_used-2139k ± 0%139k ± 0%~(p=0.956 n=10+10)
RuntimeTransaction/get_account_and_get_storage_capacity-21.42M ± 0%1.42M ± 0%~(p=0.288 n=10+10)
RuntimeTransaction/get_signer_receiver-2222k ± 0%222k ± 0%~(p=0.171 n=10+10)
RuntimeTransaction/transfer_tokens-2971k ± 0%971k ± 0%~(p=0.927 n=10+10)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-2139k ± 0%139k ± 0%~(p=0.362 n=10+10)
RuntimeTransaction/load_and_save_long_string_on_signers_address-2242k ± 0%242k ± 0%~(p=0.324 n=10+10)
RuntimeTransaction/create_new_account-22.80M ± 0%2.80M ± 0%~(p=0.436 n=10+10)
RuntimeTransaction/call_empty_contract_function-2106k ± 0%106k ± 0%~(p=0.234 n=9+10)
RuntimeTransaction/emit_event-2151k ± 0%151k ± 0%~(p=0.578 n=10+10)
RuntimeTransaction/borrow_array_from_storage-2378k ± 0%378k ± 0%~(p=0.562 n=10+9)
RuntimeTransaction/copy_array_from_storage-2335k ± 0%335k ± 0%~(p=0.138 n=10+10)
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64
ComputeBlock/16/cols/128/txes-221.0M ± 0%21.0M ± 0%~(p=0.684 n=10+10)
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64
RuntimeTransaction/get_signer_vault-2141k ± 0%141k ± 0%−0.01%(p=0.021 n=10+10)
 
computationdelta
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64
RuntimeTransaction/reference_tx-2202 ± 0%202 ± 0%~(all equal)
RuntimeTransaction/convert_int_to_string-2402 ± 0%402 ± 0%~(all equal)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-2502 ± 0%502 ± 0%~(all equal)
RuntimeTransaction/get_signer_address-2302 ± 0%302 ± 0%~(all equal)
RuntimeTransaction/get_public_account-2402 ± 0%402 ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_balance-21.00k ± 0%1.00k ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_available_balance-22.60k ± 0%2.60k ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_storage_used-2402 ± 0%402 ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_storage_capacity-21.30k ± 0%1.30k ± 0%~(all equal)
RuntimeTransaction/get_signer_vault-2402 ± 0%402 ± 0%~(all equal)
RuntimeTransaction/get_signer_receiver-2602 ± 0%602 ± 0%~(all equal)
RuntimeTransaction/transfer_tokens-23.50k ± 0%3.50k ± 0%~(all equal)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-2602 ± 0%602 ± 0%~(all equal)
RuntimeTransaction/load_and_save_long_string_on_signers_address-2602 ± 0%602 ± 0%~(all equal)
RuntimeTransaction/create_new_account-2202 ± 0%202 ± 0%~(all equal)
RuntimeTransaction/call_empty_contract_function-2402 ± 0%402 ± 0%~(all equal)
RuntimeTransaction/emit_event-2602 ± 0%602 ± 0%~(all equal)
RuntimeTransaction/borrow_array_from_storage-22.60k ± 0%2.60k ± 0%~(all equal)
RuntimeTransaction/copy_array_from_storage-22.60k ± 0%2.60k ± 0%~(all equal)
 
interactionsdelta
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64
RuntimeTransaction/reference_tx-244.4k ± 0%44.4k ± 0%~(all equal)
RuntimeTransaction/convert_int_to_string-244.4k ± 0%44.4k ± 0%~(all equal)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-244.4k ± 0%44.4k ± 0%~(all equal)
RuntimeTransaction/get_signer_address-244.4k ± 0%44.4k ± 0%~(all equal)
RuntimeTransaction/get_public_account-244.4k ± 0%44.4k ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_balance-216.8M ± 0%16.8M ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_available_balance-25.28M ± 0%5.28M ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_storage_used-248.0k ± 0%48.0k ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_storage_capacity-25.27M ± 0%5.27M ± 0%~(all equal)
RuntimeTransaction/get_signer_vault-244.7k ± 0%44.7k ± 0%~(all equal)
RuntimeTransaction/get_signer_receiver-245.0k ± 0%45.0k ± 0%~(all equal)
RuntimeTransaction/transfer_tokens-245.8k ± 0%45.8k ± 0%~(all equal)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-244.8k ± 0%44.8k ± 0%~(all equal)
RuntimeTransaction/load_and_save_long_string_on_signers_address-249.7k ± 0%49.7k ± 0%~(all equal)
RuntimeTransaction/create_new_account-28.53M ± 0%8.53M ± 0%~(all equal)
RuntimeTransaction/call_empty_contract_function-244.6k ± 0%44.6k ± 0%~(all equal)
RuntimeTransaction/emit_event-244.6k ± 0%44.6k ± 0%~(all equal)
RuntimeTransaction/borrow_array_from_storage-249.8k ± 0%49.8k ± 0%~(all equal)
RuntimeTransaction/copy_array_from_storage-249.8k ± 0%49.8k ± 0%~(all equal)
 
us/txdelta
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64
ComputeBlock/16/cols/128/txes-22.28k ± 3%2.29k ± 2%~(p=0.755 n=10+10)
 

@codecov-commenter
Copy link

codecov-commenter commented Jul 14, 2022

Codecov Report

Merging #2193 (de3ea5f) into master (9f2fbd1) will decrease coverage by 0.35%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #2193      +/-   ##
==========================================
- Coverage   54.40%   54.04%   -0.36%     
==========================================
  Files         734      684      -50     
  Lines       67861    62575    -5286     
==========================================
- Hits        36920    33821    -3099     
+ Misses      27871    25864    -2007     
+ Partials     3070     2890     -180     
Flag Coverage Δ
unittests 54.04% <ø> (-0.36%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
consensus/hotstuff/eventloop/event_loop.go 74.82% <0.00%> (-1.37%) ⬇️
engine/consensus/compliance/core.go 75.10% <0.00%> (ø)
fvm/meter/weighted_meter.go
fvm/crypto/hash.go
fvm/transactionEnv.go
fvm/programs/programs.go
fvm/environment/transaction_info.go
fvm/environment/tracer.go
fvm/contractFunctionInvoker.go
fvm/environment/account_creator.go
... and 43 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@robert-e-davidson3 robert-e-davidson3 marked this pull request as ready for review July 14, 2022 17:06
Copy link
Contributor

@janezpodhostnik janezpodhostnik left a comment

Choose a reason for hiding this comment

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

Looks good.

Isn't there a similar test somewhere already. This looks familiar. Maybe it was only in cadence...?

@robert-e-davidson3
Copy link
Contributor Author

Looks good.

Isn't there a similar test somewhere already. This looks familiar. Maybe it was only in cadence...?

You may be remembering this test. I wrote it to verify the original change but it depended on cadence changes that weren't in yet.

@Kay-Zee Kay-Zee requested a review from pattyshack as a code owner September 2, 2022 22:48
@robert-e-davidson3 robert-e-davidson3 merged commit 6341272 into master Sep 3, 2022
@robert-e-davidson3 robert-e-davidson3 deleted the robert/add-test-for-storage-capacity branch September 3, 2022 00:32
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.

5 participants