flow-go
flow-go copied to clipboard
Emit Protocol Events after database transaction
This PR modifies protocol events:
- protocol events are emitted after the corresponding database transaction completes successfully
- protocol events may not be delivered, only due to a crash/restart, and only if the corresponding state change (eg. block 100 is finalized) is readable in the Protocol State when the process restarts
- documentation is updated to describe delivery guarantees of protocol events
- adds documentation to all protocol event consumers describing how dropped protocol events due to crashes are handled
- updates
ReactorEngine
to handle missedEpochCommittedPhaseStarted
events (this was the only case where the kind of possible dropped events were not already handled)
More detail in https://github.com/dapperlabs/flow-go/issues/6317
Codecov Report
Merging #2994 (1467c48) into feature/active-pacemaker (fd71d16) will decrease coverage by
0.61%
. The diff coverage is57.50%
.
@@ Coverage Diff @@
## feature/active-pacemaker #2994 +/- ##
============================================================
- Coverage 55.37% 54.75% -0.62%
============================================================
Files 702 688 -14
Lines 66859 64579 -2280
============================================================
- Hits 37020 35361 -1659
+ Misses 26787 26321 -466
+ Partials 3052 2897 -155
Flag | Coverage Δ | |
---|---|---|
unittests | 54.75% <57.50%> (-0.62%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
engine/execution/ingestion/engine.go | 52.32% <ø> (ø) |
|
storage/badger/operation/dkg.go | 78.26% <ø> (ø) |
|
engine/consensus/dkg/reactor_engine.go | 62.88% <28.57%> (-1.61%) |
:arrow_down: |
engine/collection/epochmgr/engine.go | 73.77% <83.33%> (-0.46%) |
:arrow_down: |
state/protocol/badger/mutator.go | 65.80% <100.00%> (-0.06%) |
:arrow_down: |
...sus/approvals/assignment_collector_statemachine.go | 42.75% <0.00%> (-5.80%) |
:arrow_down: |
fvm/environment/contract_updater.go | 66.54% <0.00%> (ø) |
|
...s/hotstuff/signature/randombeacon_reconstructor.go | ||
consensus/hotstuff/verification/staking_signer.go | ||
...tstuff/votecollector/combined_vote_processor_v3.go | ||
... and 105 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
FVM Benchstat comparison
This branch with compared with the base branch onflow:feature/active-pacemaker commit fd71d161aad0331043b64a07b2fcd5ae29f0683a
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.txt | new.txt | |||
---|---|---|---|---|
time/op | delta | |||
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64 | ||||
RuntimeTransaction/call_empty_contract_function-2 | 28.6ms ± 8% | 30.5ms ± 5% | +6.84% | (p=0.001 n=10+10) |
RuntimeTransaction/convert_int_to_string_and_concatenate_it-2 | 29.8ms ± 6% | 31.3ms ± 7% | +5.00% | (p=0.035 n=9+10) |
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64 | ||||
ComputeBlock/16/cols/128/txes-2 | 4.72s ± 1% | 4.90s ± 3% | +3.74% | (p=0.000 n=8+10) |
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64 | ||||
RuntimeNFTBatchTransfer-2 | 115ms ± 3% | 118ms ± 5% | +3.22% | (p=0.004 n=9+9) |
RuntimeTransaction/copy_array_from_storage-2 | 129ms ± 3% | 133ms ± 4% | +3.11% | (p=0.002 n=10+10) |
RuntimeTransaction/get_account_and_get_balance-2 | 263ms ± 3% | 271ms ± 3% | +3.08% | (p=0.001 n=10+9) |
RuntimeTransaction/emit_event-2 | 43.6ms ± 5% | 44.9ms ± 5% | +3.00% | (p=0.019 n=10+10) |
RuntimeTransaction/get_signer_receiver-2 | 46.2ms ± 6% | 47.5ms ± 3% | +2.81% | (p=0.043 n=10+10) |
RuntimeTransaction/create_new_account-2 | 853ms ± 2% | 875ms ± 4% | +2.55% | (p=0.011 n=10+10) |
RuntimeTransaction/get_account_and_get_storage_capacity-2 | 211ms ± 2% | 216ms ± 1% | +2.13% | (p=0.000 n=9+7) |
RuntimeTransaction/borrow_array_from_storage-2 | 130ms ± 4% | 133ms ± 4% | +2.08% | (p=0.029 n=10+10) |
RuntimeTransaction/transfer_tokens-2 | 205ms ± 1% | 207ms ± 3% | +1.36% | (p=0.019 n=9+9) |
RuntimeTransaction/reference_tx-2 | 25.4ms ±15% | 26.0ms ± 9% | ~ | (p=0.247 n=10+10) |
RuntimeTransaction/convert_int_to_string-2 | 27.3ms ± 9% | 28.5ms ± 8% | ~ | (p=0.079 n=9+10) |
RuntimeTransaction/get_signer_address-2 | 26.5ms ± 6% | 26.0ms ±11% | ~ | (p=0.280 n=10+10) |
RuntimeTransaction/get_public_account-2 | 30.6ms ±13% | 30.4ms ±14% | ~ | (p=0.912 n=10+10) |
RuntimeTransaction/get_account_and_get_available_balance-2 | 249ms ± 7% | 244ms ± 3% | ~ | (p=0.481 n=10+10) |
RuntimeTransaction/get_account_and_get_storage_used-2 | 32.8ms ± 5% | 33.5ms ± 6% | ~ | (p=0.190 n=10+10) |
RuntimeTransaction/get_signer_vault-2 | 35.6ms ± 5% | 35.4ms ±10% | ~ | (p=0.853 n=10+10) |
RuntimeTransaction/load_and_save_empty_string_on_signers_address-2 | 34.0ms ± 5% | 34.9ms ± 7% | ~ | (p=0.105 n=10+10) |
RuntimeTransaction/load_and_save_long_string_on_signers_address-2 | 77.9ms ± 1% | 78.5ms ± 5% | ~ | (p=0.315 n=8+10) |
alloc/op | delta | |||
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64 | ||||
RuntimeNFTBatchTransfer-2 | 59.0MB ± 5% | 58.7MB ± 3% | ~ | (p=1.000 n=10+10) |
RuntimeTransaction/reference_tx-2 | 36.2MB ± 6% | 37.0MB ± 5% | ~ | (p=0.218 n=10+10) |
RuntimeTransaction/convert_int_to_string-2 | 37.6MB ± 7% | 38.4MB ± 8% | ~ | (p=0.280 n=10+10) |
RuntimeTransaction/convert_int_to_string_and_concatenate_it-2 | 39.3MB ± 5% | 38.9MB ± 6% | ~ | (p=0.436 n=10+10) |
RuntimeTransaction/get_signer_address-2 | 37.5MB ± 5% | 36.3MB ± 9% | ~ | (p=0.133 n=9+10) |
RuntimeTransaction/get_public_account-2 | 39.7MB ± 2% | 38.6MB ± 7% | ~ | (p=0.237 n=8+10) |
RuntimeTransaction/get_account_and_get_storage_used-2 | 40.0MB ± 4% | 39.8MB ± 6% | ~ | (p=0.912 n=10+10) |
RuntimeTransaction/get_account_and_get_storage_capacity-2 | 107MB ± 2% | 106MB ± 4% | ~ | (p=0.353 n=10+10) |
RuntimeTransaction/get_signer_vault-2 | 41.0MB ± 3% | 39.8MB ± 8% | ~ | (p=0.278 n=9+10) |
RuntimeTransaction/get_signer_receiver-2 | 43.5MB ± 4% | 44.0MB ± 6% | ~ | (p=0.353 n=10+10) |
RuntimeTransaction/transfer_tokens-2 | 88.1MB ± 2% | 89.0MB ± 3% | ~ | (p=0.190 n=10+10) |
RuntimeTransaction/load_and_save_empty_string_on_signers_address-2 | 38.7MB ± 7% | 39.4MB ± 9% | ~ | (p=0.280 n=10+10) |
RuntimeTransaction/load_and_save_long_string_on_signers_address-2 | 56.5MB ± 2% | 56.6MB ± 4% | ~ | (p=0.684 n=10+10) |
RuntimeTransaction/create_new_account-2 | 202MB ± 3% | 204MB ± 2% | ~ | (p=0.481 n=10+10) |
RuntimeTransaction/call_empty_contract_function-2 | 37.8MB ± 8% | 39.0MB ± 5% | ~ | (p=0.143 n=10+10) |
RuntimeTransaction/emit_event-2 | 42.1MB ± 4% | 42.2MB ± 5% | ~ | (p=0.739 n=10+10) |
RuntimeTransaction/borrow_array_from_storage-2 | 69.9MB ± 5% | 69.8MB ± 4% | ~ | (p=0.971 n=10+10) |
RuntimeTransaction/copy_array_from_storage-2 | 82.2MB ± 5% | 82.9MB ± 3% | ~ | (p=0.218 n=10+10) |
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64 | ||||
ComputeBlock/16/cols/128/txes-2 | 1.34GB ± 1% | 1.34GB ± 1% | ~ | (p=0.579 n=10+10) |
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64 | ||||
RuntimeTransaction/get_account_and_get_balance-2 | 130MB ± 2% | 128MB ± 3% | −1.89% | (p=0.007 n=10+10) |
RuntimeTransaction/get_account_and_get_available_balance-2 | 113MB ± 2% | 110MB ± 4% | −2.46% | (p=0.011 n=10+10) |
allocs/op | delta | |||
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64 | ||||
RuntimeNFTBatchTransfer-2 | 293k ± 1% | 292k ± 1% | ~ | (p=0.542 n=10+10) |
RuntimeTransaction/reference_tx-2 | 79.0k ± 0% | 79.0k ± 0% | ~ | (p=0.670 n=10+10) |
RuntimeTransaction/convert_int_to_string-2 | 93.2k ± 0% | 93.2k ± 0% | ~ | (p=0.811 n=10+10) |
RuntimeTransaction/convert_int_to_string_and_concatenate_it-2 | 107k ± 0% | 107k ± 0% | ~ | (p=0.515 n=10+10) |
RuntimeTransaction/get_signer_address-2 | 84.2k ± 0% | 84.2k ± 0% | ~ | (p=0.868 n=10+10) |
RuntimeTransaction/get_public_account-2 | 107k ± 0% | 107k ± 0% | ~ | (p=0.566 n=10+10) |
RuntimeTransaction/get_account_and_get_balance-2 | 1.51M ± 0% | 1.51M ± 0% | ~ | (p=0.089 n=10+10) |
RuntimeTransaction/get_account_and_get_available_balance-2 | 1.40M ± 0% | 1.40M ± 0% | ~ | (p=0.271 n=10+10) |
RuntimeTransaction/get_account_and_get_storage_used-2 | 128k ± 0% | 128k ± 0% | ~ | (p=0.839 n=10+10) |
RuntimeTransaction/get_account_and_get_storage_capacity-2 | 1.24M ± 0% | 1.24M ± 0% | ~ | (p=0.853 n=10+10) |
RuntimeTransaction/get_signer_vault-2 | 127k ± 0% | 127k ± 0% | ~ | (p=0.897 n=10+10) |
RuntimeTransaction/get_signer_receiver-2 | 204k ± 0% | 204k ± 0% | ~ | (p=0.382 n=10+10) |
RuntimeTransaction/transfer_tokens-2 | 935k ± 0% | 935k ± 0% | ~ | (p=0.280 n=10+10) |
RuntimeTransaction/load_and_save_empty_string_on_signers_address-2 | 129k ± 0% | 129k ± 0% | ~ | (p=0.118 n=10+10) |
RuntimeTransaction/load_and_save_long_string_on_signers_address-2 | 232k ± 0% | 232k ± 0% | ~ | (p=0.436 n=10+10) |
RuntimeTransaction/create_new_account-2 | 2.67M ± 0% | 2.67M ± 0% | ~ | (p=0.172 n=10+10) |
RuntimeTransaction/call_empty_contract_function-2 | 95.9k ± 0% | 95.9k ± 0% | ~ | (p=0.362 n=10+10) |
RuntimeTransaction/emit_event-2 | 136k ± 0% | 136k ± 0% | ~ | (p=0.541 n=10+10) |
RuntimeTransaction/borrow_array_from_storage-2 | 368k ± 0% | 368k ± 0% | ~ | (p=0.838 n=10+10) |
RuntimeTransaction/copy_array_from_storage-2 | 324k ± 0% | 324k ± 0% | ~ | (p=0.089 n=9+9) |
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64 | ||||
ComputeBlock/16/cols/128/txes-2 | 20.5M ± 0% | 20.5M ± 0% | ~ | (p=0.912 n=10+10) |
computation | delta | |||
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64 | ||||
RuntimeTransaction/reference_tx-2 | 202 ± 0% | 202 ± 0% | ~ | (all equal) |
RuntimeTransaction/convert_int_to_string-2 | 402 ± 0% | 402 ± 0% | ~ | (all equal) |
RuntimeTransaction/convert_int_to_string_and_concatenate_it-2 | 502 ± 0% | 502 ± 0% | ~ | (all equal) |
RuntimeTransaction/get_signer_address-2 | 302 ± 0% | 302 ± 0% | ~ | (all equal) |
RuntimeTransaction/get_public_account-2 | 402 ± 0% | 402 ± 0% | ~ | (all equal) |
RuntimeTransaction/get_account_and_get_balance-2 | 1.00k ± 0% | 1.00k ± 0% | ~ | (all equal) |
RuntimeTransaction/get_account_and_get_available_balance-2 | 2.60k ± 0% | 2.60k ± 0% | ~ | (all equal) |
RuntimeTransaction/get_account_and_get_storage_used-2 | 402 ± 0% | 402 ± 0% | ~ | (all equal) |
RuntimeTransaction/get_account_and_get_storage_capacity-2 | 1.30k ± 0% | 1.30k ± 0% | ~ | (all equal) |
RuntimeTransaction/get_signer_vault-2 | 402 ± 0% | 402 ± 0% | ~ | (all equal) |
RuntimeTransaction/get_signer_receiver-2 | 602 ± 0% | 602 ± 0% | ~ | (all equal) |
RuntimeTransaction/transfer_tokens-2 | 3.50k ± 0% | 3.50k ± 0% | ~ | (all equal) |
RuntimeTransaction/load_and_save_empty_string_on_signers_address-2 | 602 ± 0% | 602 ± 0% | ~ | (all equal) |
RuntimeTransaction/load_and_save_long_string_on_signers_address-2 | 602 ± 0% | 602 ± 0% | ~ | (all equal) |
RuntimeTransaction/create_new_account-2 | 202 ± 0% | 202 ± 0% | ~ | (all equal) |
RuntimeTransaction/call_empty_contract_function-2 | 402 ± 0% | 402 ± 0% | ~ | (all equal) |
RuntimeTransaction/emit_event-2 | 602 ± 0% | 602 ± 0% | ~ | (all equal) |
RuntimeTransaction/borrow_array_from_storage-2 | 2.60k ± 0% | 2.60k ± 0% | ~ | (all equal) |
RuntimeTransaction/copy_array_from_storage-2 | 2.60k ± 0% | 2.60k ± 0% | ~ | (all equal) |
interactions | delta | |||
pkg:github.com/onflow/flow-go/fvm goos:linux goarch:amd64 | ||||
RuntimeTransaction/reference_tx-2 | 44.3k ± 0% | 44.3k ± 0% | ~ | (all equal) |
RuntimeTransaction/convert_int_to_string-2 | 44.3k ± 0% | 44.3k ± 0% | ~ | (all equal) |
RuntimeTransaction/convert_int_to_string_and_concatenate_it-2 | 44.3k ± 0% | 44.3k ± 0% | ~ | (all equal) |
RuntimeTransaction/get_signer_address-2 | 44.3k ± 0% | 44.3k ± 0% | ~ | (all equal) |
RuntimeTransaction/get_public_account-2 | 44.3k ± 0% | 44.3k ± 0% | ~ | (all equal) |
RuntimeTransaction/get_account_and_get_balance-2 | 16.7M ± 0% | 16.7M ± 0% | ~ | (all equal) |
RuntimeTransaction/get_account_and_get_available_balance-2 | 5.13M ± 0% | 5.13M ± 0% | ~ | (all equal) |
RuntimeTransaction/get_account_and_get_storage_used-2 | 44.3k ± 0% | 44.3k ± 0% | ~ | (all equal) |
RuntimeTransaction/get_account_and_get_storage_capacity-2 | 5.13M ± 0% | 5.13M ± 0% | ~ | (all equal) |
RuntimeTransaction/get_signer_vault-2 | 44.5k ± 0% | 44.5k ± 0% | ~ | (all equal) |
RuntimeTransaction/get_signer_receiver-2 | 44.9k ± 0% | 44.9k ± 0% | ~ | (all equal) |
RuntimeTransaction/transfer_tokens-2 | 45.2k ± 0% | 45.2k ± 0% | ~ | (all equal) |
RuntimeTransaction/load_and_save_empty_string_on_signers_address-2 | 44.4k ± 0% | 44.4k ± 0% | ~ | (all equal) |
RuntimeTransaction/load_and_save_long_string_on_signers_address-2 | 47.2k ± 0% | 47.2k ± 0% | ~ | (all equal) |
RuntimeTransaction/create_new_account-2 | 8.39M ± 0% | 8.39M ± 0% | ~ | (all equal) |
RuntimeTransaction/call_empty_contract_function-2 | 44.5k ± 0% | 44.5k ± 0% | ~ | (all equal) |
RuntimeTransaction/emit_event-2 | 44.5k ± 0% | 44.5k ± 0% | ~ | (all equal) |
RuntimeTransaction/borrow_array_from_storage-2 | 49.7k ± 0% | 49.7k ± 0% | ~ | (all equal) |
RuntimeTransaction/copy_array_from_storage-2 | 49.7k ± 0% | 49.7k ± 0% | ~ | (all equal) |
us/tx | delta | |||
pkg:github.com/onflow/flow-go/engine/execution/computation goos:linux goarch:amd64 | ||||
ComputeBlock/16/cols/128/txes-2 | 2.31k ± 1% | 2.39k ± 3% | +3.74% | (p=0.000 n=8+10) |
bors merge
Build succeeded:
- Integration Tests (make -C integration access-tests)
- Integration Tests (make -C integration bft-tests)
- Integration Tests (make -C integration collection-tests)
- Integration Tests (make -C integration consensus-tests)
- Integration Tests (make -C integration epochs-tests)
- Integration Tests (make -C integration execution-tests)
- Integration Tests (make -C integration ghost-tests)
- Integration Tests (make -C integration mvp-tests)
- Integration Tests (make -C integration network-tests)
- Integration Tests (make -C integration verification-tests)
- Lint (./)
- Lint (./crypto/)
- Lint (./integration/)
- Unit Tests (access)
- Unit Tests (admin)
- Unit Tests (cmd)
- Unit Tests (consensus)
- Unit Tests (engine)
- Unit Tests (fvm)
- Unit Tests (ledger)
- Unit Tests (module)
- Unit Tests (network)
- Unit Tests (others)
- Unit Tests (utils)