flow-go icon indicating copy to clipboard operation
flow-go copied to clipboard

[Consensus] Add `ParentView` to `flow.Header`

Open durkmurder opened this issue 2 years ago • 2 comments

https://github.com/dapperlabs/flow-go/issues/6411

Context

This PR adds ParentView to flow.Header. As part of this PR I have updated our test helpers, util functions, tests and wherever we have converted flow.Header to model.Block and vica versa. Also updated hotstuff.BlockProducer to return flow.Header instead of model.Proposal.

durkmurder avatar Oct 12 '22 17:10 durkmurder

FVM Benchstat comparison

This branch with compared with the base branch onflow:feature/active-pacemaker commit 8bc1222debd0746d9c908ee4c4460f90967fc446

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-2133ms ± 6%145ms ±14%+9.68%(p=0.011 n=10+10)
RuntimeTransaction/emit_event-252.4ms ± 3%55.0ms ± 8%+4.86%(p=0.006 n=8+9)
RuntimeTransaction/reference_tx-232.3ms ± 7%32.7ms ±12%~(p=0.842 n=9+10)
RuntimeTransaction/convert_int_to_string-234.7ms ±12%34.5ms ± 8%~(p=0.971 n=10+10)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-236.8ms ±10%37.9ms ± 9%~(p=0.315 n=10+10)
RuntimeTransaction/get_signer_address-231.9ms ± 7%32.1ms ± 8%~(p=0.968 n=9+10)
RuntimeTransaction/get_public_account-237.1ms ±12%37.2ms ± 9%~(p=0.684 n=10+10)
RuntimeTransaction/get_account_and_get_balance-2356ms ±10%346ms ± 3%~(p=0.190 n=9+9)
RuntimeTransaction/get_account_and_get_available_balance-2331ms ± 8%321ms ± 6%~(p=0.247 n=10+10)
RuntimeTransaction/get_account_and_get_storage_used-239.4ms ± 8%39.7ms ± 5%~(p=0.447 n=10+9)
RuntimeTransaction/get_account_and_get_storage_capacity-2278ms ± 5%287ms ± 7%~(p=0.165 n=10+10)
RuntimeTransaction/get_signer_vault-242.9ms ± 5%42.3ms ± 8%~(p=0.182 n=9+10)
RuntimeTransaction/get_signer_receiver-254.5ms ± 3%55.6ms ± 6%~(p=0.095 n=9+10)
RuntimeTransaction/transfer_tokens-2254ms ± 5%256ms ± 4%~(p=0.897 n=10+8)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-243.1ms ± 9%42.8ms ± 7%~(p=0.971 n=10+10)
RuntimeTransaction/load_and_save_long_string_on_signers_address-293.7ms ± 6%91.5ms ± 4%~(p=0.143 n=10+10)
RuntimeTransaction/create_new_account-21.02s ± 1%1.02s ± 5%~(p=0.573 n=8+10)
RuntimeTransaction/call_empty_contract_function-237.1ms ±16%36.5ms ±10%~(p=0.796 n=10+10)
RuntimeTransaction/borrow_array_from_storage-2160ms ± 6%156ms ± 4%~(p=0.353 n=10+10)
RuntimeTransaction/copy_array_from_storage-2164ms ± 4%167ms ± 2%~(p=0.063 n=9+9)
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64
ComputeBlock/16/cols/128/txes-25.87s ± 3%5.82s ± 5%~(p=0.684 n=10+10)
 
alloc/opdelta
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64
RuntimeNFTBatchTransfer-257.5MB ± 5%58.5MB ± 6%~(p=0.280 n=10+10)
RuntimeTransaction/reference_tx-237.3MB ± 5%36.6MB ± 8%~(p=0.280 n=10+10)
RuntimeTransaction/convert_int_to_string-237.5MB ± 6%37.9MB ± 6%~(p=0.529 n=10+10)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-238.8MB ±10%38.3MB ± 6%~(p=0.353 n=10+10)
RuntimeTransaction/get_signer_address-236.8MB ± 8%36.2MB ± 7%~(p=0.631 n=10+10)
RuntimeTransaction/get_public_account-238.4MB ± 9%39.4MB ± 3%~(p=0.243 n=10+9)
RuntimeTransaction/get_account_and_get_balance-2128MB ± 4%128MB ± 0%~(p=0.220 n=10+6)
RuntimeTransaction/get_account_and_get_available_balance-2113MB ± 4%111MB ± 3%~(p=0.529 n=10+10)
RuntimeTransaction/get_account_and_get_storage_used-238.8MB ± 8%39.4MB ± 7%~(p=0.436 n=10+10)
RuntimeTransaction/get_account_and_get_storage_capacity-2106MB ± 3%106MB ± 3%~(p=0.796 n=10+10)
RuntimeTransaction/get_signer_vault-239.4MB ± 7%39.0MB ± 4%~(p=0.447 n=10+9)
RuntimeTransaction/get_signer_receiver-242.7MB ± 3%42.1MB ± 5%~(p=0.356 n=9+10)
RuntimeTransaction/transfer_tokens-289.8MB ± 3%89.3MB ± 3%~(p=0.393 n=10+10)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-239.6MB ± 8%39.5MB ± 7%~(p=0.971 n=10+10)
RuntimeTransaction/load_and_save_long_string_on_signers_address-256.7MB ± 2%56.5MB ± 2%~(p=0.579 n=10+10)
RuntimeTransaction/create_new_account-2202MB ± 2%201MB ± 3%~(p=0.436 n=10+10)
RuntimeTransaction/call_empty_contract_function-237.8MB ± 5%37.5MB ±10%~(p=0.579 n=10+10)
RuntimeTransaction/emit_event-242.2MB ± 7%43.0MB ± 5%~(p=0.393 n=10+10)
RuntimeTransaction/borrow_array_from_storage-270.3MB ± 3%70.5MB ± 3%~(p=0.842 n=10+9)
RuntimeTransaction/copy_array_from_storage-282.6MB ± 3%83.2MB ± 2%~(p=0.400 n=9+10)
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64
ComputeBlock/16/cols/128/txes-21.34GB ± 1%1.33GB ± 1%~(p=1.000 n=10+9)
 
allocs/opdelta
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64
RuntimeNFTBatchTransfer-2290k ± 0%291k ± 0%~(p=0.161 n=10+7)
RuntimeTransaction/reference_tx-279.0k ± 0%79.0k ± 0%~(p=0.425 n=10+10)
RuntimeTransaction/convert_int_to_string-293.2k ± 0%93.2k ± 0%~(p=0.644 n=10+10)
RuntimeTransaction/get_signer_address-284.2k ± 0%84.2k ± 0%~(p=0.059 n=10+10)
RuntimeTransaction/get_public_account-2107k ± 0%107k ± 0%~(p=0.189 n=9+10)
RuntimeTransaction/get_account_and_get_balance-21.51M ± 0%1.51M ± 0%~(p=0.382 n=10+10)
RuntimeTransaction/get_account_and_get_storage_used-2128k ± 0%128k ± 0%~(p=0.956 n=10+10)
RuntimeTransaction/get_account_and_get_storage_capacity-21.24M ± 0%1.24M ± 0%~(p=0.955 n=10+10)
RuntimeTransaction/get_signer_vault-2127k ± 0%127k ± 0%~(p=0.484 n=10+9)
RuntimeTransaction/get_signer_receiver-2204k ± 0%204k ± 0%~(p=0.753 n=10+10)
RuntimeTransaction/transfer_tokens-2935k ± 0%935k ± 0%~(p=0.395 n=8+10)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-2129k ± 0%129k ± 0%~(p=0.493 n=10+10)
RuntimeTransaction/create_new_account-22.67M ± 0%2.67M ± 0%~(p=0.218 n=10+9)
RuntimeTransaction/call_empty_contract_function-295.9k ± 0%95.9k ± 0%~(p=0.779 n=9+9)
RuntimeTransaction/emit_event-2136k ± 0%136k ± 0%~(p=0.284 n=8+10)
RuntimeTransaction/borrow_array_from_storage-2368k ± 0%368k ± 0%~(p=0.436 n=10+10)
RuntimeTransaction/copy_array_from_storage-2324k ± 0%324k ± 0%~(p=0.541 n=10+10)
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64
ComputeBlock/16/cols/128/txes-220.5M ± 0%20.5M ± 0%~(p=0.315 n=10+10)
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64
RuntimeTransaction/get_account_and_get_available_balance-21.40M ± 0%1.40M ± 0%−0.00%(p=0.018 n=10+9)
RuntimeTransaction/load_and_save_long_string_on_signers_address-2232k ± 0%232k ± 0%−0.01%(p=0.017 n=10+10)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-2107k ± 0%107k ± 0%−0.02%(p=0.020 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.3k ± 0%44.3k ± 0%~(all equal)
RuntimeTransaction/convert_int_to_string-244.3k ± 0%44.3k ± 0%~(all equal)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-244.3k ± 0%44.3k ± 0%~(all equal)
RuntimeTransaction/get_signer_address-244.3k ± 0%44.3k ± 0%~(all equal)
RuntimeTransaction/get_public_account-244.3k ± 0%44.3k ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_balance-216.7M ± 0%16.7M ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_available_balance-25.13M ± 0%5.13M ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_storage_used-244.3k ± 0%44.3k ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_storage_capacity-25.13M ± 0%5.13M ± 0%~(all equal)
RuntimeTransaction/get_signer_vault-244.5k ± 0%44.5k ± 0%~(all equal)
RuntimeTransaction/get_signer_receiver-244.9k ± 0%44.9k ± 0%~(all equal)
RuntimeTransaction/transfer_tokens-245.2k ± 0%45.2k ± 0%~(all equal)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-244.4k ± 0%44.4k ± 0%~(all equal)
RuntimeTransaction/load_and_save_long_string_on_signers_address-247.2k ± 0%47.2k ± 0%~(all equal)
RuntimeTransaction/create_new_account-28.39M ± 0%8.39M ± 0%~(all equal)
RuntimeTransaction/call_empty_contract_function-244.5k ± 0%44.5k ± 0%~(all equal)
RuntimeTransaction/emit_event-244.5k ± 0%44.5k ± 0%~(all equal)
RuntimeTransaction/borrow_array_from_storage-249.7k ± 0%49.7k ± 0%~(all equal)
RuntimeTransaction/copy_array_from_storage-249.7k ± 0%49.7k ± 0%~(all equal)
 
us/txdelta
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64
ComputeBlock/16/cols/128/txes-22.87k ± 3%2.84k ± 5%~(p=0.670 n=10+10)
 

github-actions[bot] avatar Oct 12 '22 18:10 github-actions[bot]

Codecov Report

Merging #3372 (60ec1d8) into feature/active-pacemaker (8bc1222) will decrease coverage by 0.01%. The diff coverage is 74.28%.

@@                     Coverage Diff                      @@
##           feature/active-pacemaker    #3372      +/-   ##
============================================================
- Coverage                     55.54%   55.53%   -0.02%     
============================================================
  Files                           749      749              
  Lines                         69513    69492      -21     
============================================================
- Hits                          38614    38591      -23     
- Misses                        27765    27767       +2     
  Partials                       3134     3134              
Flag Coverage Δ
unittests 55.53% <74.28%> (-0.02%) :arrow_down:

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

Impacted Files Coverage Δ
consensus/participant.go 19.40% <0.00%> (+0.56%) :arrow_up:
consensus/recovery/follower.go 0.00% <0.00%> (ø)
engine/common/rpc/convert/convert.go 14.26% <0.00%> (-0.05%) :arrow_down:
utils/unittest/fixtures.go 0.00% <0.00%> (ø)
consensus/hotstuff/eventhandler/event_handler.go 77.35% <100.00%> (+0.26%) :arrow_up:
consensus/hotstuff/eventloop/event_loop.go 75.84% <100.00%> (+0.24%) :arrow_up:
consensus/recovery/recover.go 40.54% <100.00%> (-6.27%) :arrow_down:
engine/collection/compliance/core.go 86.72% <100.00%> (ø)
engine/collection/message_hub/message_hub.go 78.98% <100.00%> (-0.67%) :arrow_down:
engine/common/follower/engine.go 49.68% <100.00%> (+0.14%) :arrow_up:
... and 14 more

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

codecov-commenter avatar Oct 12 '22 20:10 codecov-commenter

quick request, would you mind clearing up a tiny bit of tech debt as part of this PR 🙏 🙇 👍

  • in this code, the variable is still named finalizer (legacy naming). I think a correct name would be forks

AlexHentschel avatar Oct 26 '22 03:10 AlexHentschel

bors merge

durkmurder avatar Oct 26 '22 11:10 durkmurder