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 error code search. #3776

Merged
merged 1 commit into from
Jan 6, 2023
Merged

Improve error code search. #3776

merged 1 commit into from
Jan 6, 2023

Conversation

pattyshack
Copy link
Contributor

Don't rely on As() to unwrap errors when searching for a non-fatal error code since multierror.Error's As() will only inspects the first error in the list (other error codes in the errors list are ignored).

@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2023

Codecov Report

Merging #3776 (c92aafc) into master (69f0be7) will decrease coverage by 0.13%.
The diff coverage is 76.14%.

@@            Coverage Diff             @@
##           master    #3776      +/-   ##
==========================================
- Coverage   55.50%   55.37%   -0.14%     
==========================================
  Files         765      768       +3     
  Lines       69798    70208     +410     
==========================================
+ Hits        38739    38875     +136     
- Misses      27881    28147     +266     
- Partials     3178     3186       +8     
Flag Coverage Δ
unittests 55.37% <76.14%> (-0.14%) ⬇️

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

Impacted Files Coverage Δ
cmd/scaffold.go 15.75% <0.00%> (-0.02%) ⬇️
cmd/util/ledger/reporters/account_reporter.go 0.00% <0.00%> (ø)
...gine/execution/computation/computer/spock_relic.go 0.00% <0.00%> (ø)
fvm/context.go 53.47% <0.00%> (-1.47%) ⬇️
fvm/environment/account_creator.go 41.98% <0.00%> (ø)
fvm/environment/account_info.go 11.60% <0.00%> (ø)
fvm/environment/account_key_updater.go 19.68% <0.00%> (ø)
fvm/environment/block_info.go 24.63% <0.00%> (ø)
fvm/environment/env.go 100.00% <ø> (ø)
fvm/transaction.go 93.02% <ø> (+8.40%) ⬆️
... and 64 more

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2023

FVM Benchstat comparison

This branch with compared with the base branch onflow:master commit c7082c9

The command (for i in {1..7}; 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
RuntimeTransaction/reference_tx-237.8ms ± 3%38.0ms ± 5%~(p=0.535 n=7+7)
RuntimeTransaction/convert_int_to_string-241.2ms ±17%39.7ms ± 6%~(p=0.445 n=7+6)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-241.5ms ± 4%44.0ms ±16%~(p=0.138 n=6+7)
RuntimeTransaction/get_signer_address-238.9ms ± 3%38.5ms ± 5%~(p=0.902 n=7+7)
RuntimeTransaction/get_public_account-242.6ms ±11%42.2ms ± 1%~(p=0.731 n=7+6)
RuntimeTransaction/get_account_and_get_balance-2370ms ± 4%370ms ± 5%~(p=0.805 n=7+7)
RuntimeTransaction/get_account_and_get_available_balance-2355ms ± 5%350ms ± 3%~(p=0.383 n=7+7)
RuntimeTransaction/get_account_and_get_storage_capacity-2317ms ± 3%314ms ± 3%~(p=0.456 n=7+7)
RuntimeTransaction/get_signer_vault-246.8ms ± 1%47.7ms ± 3%~(p=0.138 n=6+7)
RuntimeTransaction/get_signer_receiver-262.6ms ± 6%63.6ms ± 6%~(p=0.456 n=7+7)
RuntimeTransaction/transfer_tokens-2268ms ± 4%268ms ± 3%~(p=0.836 n=7+6)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-246.1ms ± 2%47.2ms ± 8%~(p=0.731 n=6+7)
RuntimeTransaction/load_and_save_long_string_on_signers_address-292.8ms ± 3%93.2ms ± 7%~(p=0.902 n=7+7)
RuntimeTransaction/create_new_account-21.01s ± 2%1.00s ± 2%~(p=0.234 n=7+6)
RuntimeTransaction/call_empty_contract_function-242.3ms ± 1%41.8ms ± 5%~(p=0.792 n=5+6)
RuntimeTransaction/emit_event-257.0ms ± 4%59.5ms ± 6%~(p=0.366 n=6+7)
RuntimeTransaction/borrow_array_from_storage-2156ms ± 2%159ms ± 7%~(p=0.836 n=6+7)
RuntimeTransaction/copy_array_from_storage-2160ms ± 3%160ms ± 2%~(p=1.000 n=7+6)
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64
ComputeBlock/16/cols/128/txes-25.97s ± 1%5.85s ± 2%−1.98%(p=0.018 n=5+7)
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64
RuntimeNFTBatchTransfer-2139ms ± 3%135ms ± 3%−3.15%(p=0.026 n=6+6)
RuntimeTransaction/get_account_and_get_storage_used-244.3ms ± 5%42.4ms ± 2%−4.35%(p=0.035 n=7+6)
 
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-23.10k ± 0%3.10k ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_storage_used-2402 ± 0%402 ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_storage_capacity-21.70k ± 0%1.70k ± 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-2331k ± 0%331k ± 0%~(all equal)
RuntimeTransaction/convert_int_to_string-2331k ± 0%331k ± 0%~(all equal)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-2331k ± 0%331k ± 0%~(all equal)
RuntimeTransaction/get_signer_address-2331k ± 0%331k ± 0%~(all equal)
RuntimeTransaction/get_public_account-2331k ± 0%331k ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_balance-224.3M ± 0%24.3M ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_available_balance-25.64M ± 0%5.64M ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_storage_used-2331k ± 0%331k ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_storage_capacity-25.64M ± 0%5.64M ± 0%~(all equal)
RuntimeTransaction/get_signer_vault-2331k ± 0%331k ± 0%~(all equal)
RuntimeTransaction/get_signer_receiver-2331k ± 0%331k ± 0%~(all equal)
RuntimeTransaction/transfer_tokens-2331k ± 0%331k ± 0%~(all equal)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-2331k ± 0%331k ± 0%~(all equal)
RuntimeTransaction/load_and_save_long_string_on_signers_address-2334k ± 0%334k ± 0%~(all equal)
RuntimeTransaction/create_new_account-212.3M ± 0%12.3M ± 0%~(all equal)
RuntimeTransaction/call_empty_contract_function-2331k ± 0%331k ± 0%~(all equal)
RuntimeTransaction/emit_event-2331k ± 0%331k ± 0%~(all equal)
RuntimeTransaction/borrow_array_from_storage-2336k ± 0%336k ± 0%~(p=0.385 n=7+6)
RuntimeTransaction/copy_array_from_storage-2336k ± 0%336k ± 0%~(all equal)
 
alloc/opdelta
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64
RuntimeTransaction/get_signer_receiver-241.0MB ±10%43.0MB ± 3%+4.85%(p=0.035 n=7+6)
RuntimeTransaction/reference_tx-234.6MB ± 3%34.5MB ± 2%~(p=0.620 n=7+7)
RuntimeTransaction/convert_int_to_string-235.1MB ± 3%34.8MB ± 2%~(p=0.259 n=7+7)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-235.8MB ± 3%35.9MB ± 4%~(p=0.902 n=7+7)
RuntimeTransaction/get_signer_address-235.1MB ± 4%34.6MB ± 4%~(p=0.456 n=7+7)
RuntimeTransaction/get_public_account-235.9MB ± 5%36.2MB ± 3%~(p=0.710 n=7+7)
RuntimeTransaction/get_account_and_get_balance-2121MB ± 3%122MB ± 1%~(p=0.836 n=7+6)
RuntimeTransaction/get_account_and_get_available_balance-2105MB ± 3%106MB ± 3%~(p=1.000 n=7+7)
RuntimeTransaction/get_account_and_get_storage_used-236.2MB ± 4%36.0MB ± 4%~(p=0.710 n=7+7)
RuntimeTransaction/get_account_and_get_storage_capacity-2103MB ± 2%103MB ± 3%~(p=0.902 n=7+7)
RuntimeTransaction/get_signer_vault-236.7MB ± 4%36.9MB ± 4%~(p=1.000 n=7+7)
RuntimeTransaction/transfer_tokens-281.8MB ± 1%83.1MB ± 5%~(p=0.445 n=6+7)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-236.1MB ± 5%36.1MB ± 4%~(p=1.000 n=7+7)
RuntimeTransaction/load_and_save_long_string_on_signers_address-252.6MB ± 5%52.7MB ± 3%~(p=0.620 n=7+7)
RuntimeTransaction/create_new_account-2182MB ± 4%183MB ± 2%~(p=0.535 n=7+7)
RuntimeTransaction/call_empty_contract_function-235.8MB ± 2%36.1MB ± 2%~(p=0.620 n=7+7)
RuntimeTransaction/emit_event-240.5MB ± 5%40.0MB ± 3%~(p=0.445 n=7+6)
RuntimeTransaction/borrow_array_from_storage-269.3MB ± 3%69.7MB ± 3%~(p=0.902 n=7+7)
RuntimeTransaction/copy_array_from_storage-281.9MB ± 3%81.4MB ± 1%~(p=0.318 n=7+7)
RuntimeNFTBatchTransfer-255.0MB ± 6%53.1MB ± 4%~(p=0.073 n=7+7)
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64
ComputeBlock/16/cols/128/txes-21.20GB ± 1%1.20GB ± 1%~(p=0.534 n=7+6)
 
allocs/opdelta
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64
RuntimeTransaction/reference_tx-282.3k ± 0%82.3k ± 0%~(p=0.558 n=7+7)
RuntimeTransaction/convert_int_to_string-294.5k ± 0%94.5k ± 0%~(p=0.286 n=6+7)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-2106k ± 0%106k ± 0%~(p=0.101 n=7+7)
RuntimeTransaction/get_signer_address-286.5k ± 0%86.5k ± 0%~(p=0.803 n=7+6)
RuntimeTransaction/get_public_account-2109k ± 0%109k ± 0%~(p=1.000 n=7+7)
RuntimeTransaction/get_account_and_get_balance-21.30M ± 0%1.30M ± 0%~(p=0.333 n=7+7)
RuntimeTransaction/get_account_and_get_available_balance-21.23M ± 0%1.23M ± 0%~(p=0.147 n=6+7)
RuntimeTransaction/get_account_and_get_storage_used-2119k ± 0%119k ± 0%~(p=0.686 n=7+7)
RuntimeTransaction/get_account_and_get_storage_capacity-21.10M ± 0%1.10M ± 0%~(p=0.902 n=7+7)
RuntimeTransaction/get_signer_vault-2123k ± 0%123k ± 0%~(p=0.926 n=7+7)
RuntimeTransaction/get_signer_receiver-2197k ± 0%197k ± 0%~(p=0.765 n=7+6)
RuntimeTransaction/transfer_tokens-2842k ± 0%842k ± 0%~(p=0.780 n=7+7)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-2121k ± 0%121k ± 0%~(p=0.929 n=7+7)
RuntimeTransaction/load_and_save_long_string_on_signers_address-2193k ± 0%193k ± 0%~(p=0.302 n=6+7)
RuntimeTransaction/create_new_account-22.27M ± 0%2.27M ± 0%~(p=0.558 n=6+7)
RuntimeTransaction/call_empty_contract_function-297.7k ± 0%97.7k ± 0%~(p=0.430 n=7+7)
RuntimeTransaction/emit_event-2137k ± 0%137k ± 0%~(p=0.710 n=7+7)
RuntimeTransaction/copy_array_from_storage-2292k ± 0%292k ± 0%~(p=0.364 n=7+7)
RuntimeNFTBatchTransfer-2264k ± 1%264k ± 0%~(p=0.445 n=7+6)
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64
ComputeBlock/16/cols/128/txes-217.2M ± 0%17.2M ± 0%~(p=0.445 n=7+6)
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64
RuntimeTransaction/borrow_array_from_storage-2336k ± 0%336k ± 0%−0.00%(p=0.026 n=7+7)
 
us/txdelta
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64
ComputeBlock/16/cols/128/txes-22.91k ± 1%2.86k ± 2%−1.98%(p=0.018 n=5+7)
 

fvm/errors/errors.go Outdated Show resolved Hide resolved
Don't rely on As() to unwrap errors when searching for a non-fatal error code
since multierror.Error's As() will only inspects the first error in the list
(other error codes in the errors list are ignored).
@pattyshack
Copy link
Contributor Author

bors merge

@bors bors bot merged commit f2cc5ab into master Jan 6, 2023
@bors bors bot deleted the patrick/find-multierror branch January 6, 2023 18:08
This pull request was closed.
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.

4 participants