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

[Consensus] Update disabled integration tests

Open durkmurder opened this issue 2 years ago • 2 comments

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

Context

This PR enables previously disabled integration tests. Test suits were extended to support new functionality(support for timeout aggregator for instance). Also some changes were made to the actual logic to address some discovered issues.

Important changes:

  • EventHandler now stores newly created proposal in forks and has extra logic to check if he has already proposed in this round. Due to async design it could happen that event handler tries to create proposal twice for same round. Maybe we will be able to update compliance engine in future to pass each proposal only once for but now it appears to me as a good solution.
  • Updated compliance engine to accept block ranges, this code is on master but I have made a mistake when merging so now it's fixed.

durkmurder avatar Aug 05 '22 11:08 durkmurder

Codecov Report

Merging #2935 (4c603db) into feature/active-pacemaker (76440a7) will decrease coverage by 0.02%. The diff coverage is 50.80%.

@@                     Coverage Diff                      @@
##           feature/active-pacemaker    #2935      +/-   ##
============================================================
- Coverage                     56.70%   56.68%   -0.03%     
============================================================
  Files                           695      695              
  Lines                         64890    64929      +39     
============================================================
+ Hits                          36797    36803       +6     
- Misses                        24998    25025      +27     
- Partials                       3095     3101       +6     
Flag Coverage Δ
unittests 56.68% <50.80%> (-0.03%) :arrow_down:

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

Impacted Files Coverage Δ
storage/badger/blocks.go 51.76% <0.00%> (ø)
engine/collection/compliance/engine.go 63.56% <34.61%> (-0.55%) :arrow_down:
engine/consensus/compliance/engine.go 63.58% <42.85%> (-2.89%) :arrow_down:
consensus/hotstuff/eventhandler/event_handler.go 74.09% <88.88%> (-0.56%) :arrow_down:
utils/debug/profiler.go 78.12% <0.00%> (-6.25%) :arrow_down:
engine/access/ingestion/engine.go 62.67% <0.00%> (-0.20%) :arrow_down:
fvm/handler/contract.go 89.93% <0.00%> (+1.34%) :arrow_up:

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 Aug 05 '22 11:08 codecov-commenter

FVM Benchstat comparison

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

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

Bench tests were run a total of 10 times on each branch.

Collapsed results for better readability

old.txtnew.txt
time/opdelta
RuntimeTransaction/reference_tx-226.6ms ± 1%28.4ms ±17%+6.76%(p=0.010 n=9+10)
RuntimeTransaction/convert_int_to_string-227.9ms ± 2%28.5ms ± 1%+1.95%(p=0.001 n=8+9)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-229.6ms ± 1%30.1ms ± 4%+1.73%(p=0.003 n=10+8)
RuntimeTransaction/copy_array_from_storage-2107ms ± 2%109ms ± 2%+1.59%(p=0.022 n=9+10)
RuntimeTransaction/get_signer_address-227.0ms ± 1%27.5ms ± 5%+1.55%(p=0.036 n=8+9)
RuntimeTransaction/get_public_account-229.7ms ± 1%30.1ms ± 1%+1.43%(p=0.000 n=9+10)
RuntimeTransaction/emit_event-243.4ms ± 1%44.0ms ± 1%+1.42%(p=0.000 n=9+8)
RuntimeTransaction/create_new_account-21.05s ± 2%1.06s ± 1%+1.35%(p=0.004 n=10+10)
RuntimeTransaction/get_account_and_get_available_balance-2367ms ± 1%372ms ± 2%+1.29%(p=0.005 n=10+10)
RuntimeNFTBatchTransfer-2113ms ± 2%114ms ± 2%+1.16%(p=0.019 n=10+10)
RuntimeTransaction/load_and_save_long_string_on_signers_address-274.9ms ± 1%75.7ms ± 3%+1.08%(p=0.028 n=9+10)
RuntimeTransaction/get_account_and_get_balance-2457ms ± 2%461ms ± 1%+0.78%(p=0.022 n=9+10)
RuntimeTransaction/transfer_tokens-2175ms ± 1%177ms ± 1%+0.68%(p=0.029 n=10+10)
RuntimeTransaction/call_empty_contract_function-229.2ms ± 1%29.4ms ± 1%+0.63%(p=0.043 n=10+8)
RuntimeTransaction/borrow_array_from_storage-2109ms ± 1%109ms ± 1%+0.60%(p=0.043 n=10+10)
RuntimeTransaction/get_account_and_get_storage_used-234.5ms ± 1%34.7ms ± 1%~(p=0.052 n=10+10)
RuntimeTransaction/get_account_and_get_storage_capacity-2342ms ± 1%345ms ± 2%~(p=0.053 n=9+10)
RuntimeTransaction/get_signer_vault-234.2ms ± 2%34.5ms ± 1%~(p=0.089 n=10+10)
RuntimeTransaction/get_signer_receiver-244.1ms ± 2%44.2ms ± 1%~(p=0.796 n=10+10)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-233.5ms ± 2%33.8ms ± 1%~(p=0.065 n=9+10)
 
alloc/opdelta
RuntimeTransaction/get_account_and_get_storage_capacity-2142MB ± 0%142MB ± 0%+0.03%(p=0.010 n=10+9)
RuntimeNFTBatchTransfer-227.9MB ± 0%27.9MB ± 0%~(p=0.515 n=10+8)
RuntimeTransaction/reference_tx-29.21MB ± 1%9.22MB ± 0%~(p=0.497 n=10+9)
RuntimeTransaction/convert_int_to_string-29.67MB ± 0%9.67MB ± 0%~(p=0.684 n=10+10)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-210.2MB ± 0%10.2MB ± 1%~(p=0.436 n=10+10)
RuntimeTransaction/get_signer_address-29.44MB ± 1%9.42MB ± 0%~(p=0.497 n=10+9)
RuntimeTransaction/get_public_account-210.9MB ± 0%10.9MB ± 0%~(p=0.146 n=8+10)
RuntimeTransaction/get_account_and_get_balance-2197MB ± 0%197MB ± 0%~(p=0.123 n=10+10)
RuntimeTransaction/get_account_and_get_available_balance-2147MB ± 0%147MB ± 0%~(p=0.853 n=10+10)
RuntimeTransaction/get_account_and_get_storage_used-212.3MB ± 0%12.3MB ± 0%~(p=0.796 n=10+10)
RuntimeTransaction/get_signer_vault-211.4MB ± 0%11.4MB ± 0%~(p=0.971 n=10+10)
RuntimeTransaction/transfer_tokens-250.6MB ± 0%50.5MB ± 0%~(p=0.780 n=10+9)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-210.9MB ± 0%10.9MB ± 0%~(p=0.436 n=10+10)
RuntimeTransaction/load_and_save_long_string_on_signers_address-225.6MB ± 0%25.6MB ± 0%~(p=0.971 n=10+10)
RuntimeTransaction/create_new_account-2284MB ± 0%284MB ± 0%~(p=0.604 n=9+10)
RuntimeTransaction/emit_event-214.3MB ± 0%14.3MB ± 0%~(p=0.661 n=9+10)
RuntimeTransaction/borrow_array_from_storage-235.6MB ± 0%35.5MB ± 0%~(p=0.063 n=10+10)
RuntimeTransaction/copy_array_from_storage-246.7MB ± 0%46.7MB ± 0%~(p=0.684 n=10+10)
RuntimeTransaction/call_empty_contract_function-210.0MB ± 0%10.0MB ± 0%−0.14%(p=0.035 n=10+10)
RuntimeTransaction/get_signer_receiver-215.2MB ± 0%15.2MB ± 0%−0.35%(p=0.017 n=10+9)
 
allocs/opdelta
RuntimeNFTBatchTransfer-2381k ± 0%381k ± 0%~(p=0.951 n=9+10)
RuntimeTransaction/convert_int_to_string-2162k ± 0%162k ± 0%~(p=0.160 n=10+9)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-2176k ± 0%176k ± 0%~(p=0.344 n=10+9)
RuntimeTransaction/get_signer_address-2152k ± 0%152k ± 0%~(p=0.064 n=9+9)
RuntimeTransaction/get_public_account-2184k ± 0%184k ± 0%~(p=0.741 n=8+9)
RuntimeTransaction/get_account_and_get_balance-23.27M ± 0%3.27M ± 0%~(p=0.156 n=9+10)
RuntimeTransaction/get_account_and_get_available_balance-22.64M ± 0%2.64M ± 0%~(p=0.271 n=10+10)
RuntimeTransaction/get_account_and_get_storage_used-2205k ± 0%205k ± 0%~(p=0.361 n=10+10)
RuntimeTransaction/get_account_and_get_storage_capacity-22.49M ± 0%2.49M ± 0%~(p=0.968 n=9+10)
RuntimeTransaction/get_signer_vault-2200k ± 0%200k ± 0%~(p=0.251 n=9+10)
RuntimeTransaction/get_signer_receiver-2289k ± 0%289k ± 0%~(p=0.403 n=10+10)
RuntimeTransaction/transfer_tokens-21.06M ± 0%1.06M ± 0%~(p=0.108 n=10+9)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-2198k ± 0%198k ± 0%~(p=0.148 n=10+10)
RuntimeTransaction/load_and_save_long_string_on_signers_address-2297k ± 0%297k ± 0%~(p=0.642 n=10+10)
RuntimeTransaction/create_new_account-24.47M ± 0%4.47M ± 0%~(p=0.447 n=9+10)
RuntimeTransaction/call_empty_contract_function-2164k ± 0%164k ± 0%~(p=0.431 n=9+10)
RuntimeTransaction/emit_event-2211k ± 0%211k ± 0%~(p=0.779 n=10+8)
RuntimeTransaction/copy_array_from_storage-2394k ± 0%394k ± 0%~(p=0.753 n=10+10)
RuntimeTransaction/borrow_array_from_storage-2437k ± 0%437k ± 0%−0.00%(p=0.017 n=10+10)
RuntimeTransaction/reference_tx-2147k ± 0%147k ± 0%−0.00%(p=0.027 n=9+9)
 
computationdelta
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.50k ± 0%2.50k ± 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
RuntimeTransaction/reference_tx-247.4k ± 0%47.4k ± 0%~(all equal)
RuntimeTransaction/convert_int_to_string-247.4k ± 0%47.4k ± 0%~(all equal)
RuntimeTransaction/convert_int_to_string_and_concatenate_it-247.4k ± 0%47.4k ± 0%~(all equal)
RuntimeTransaction/get_signer_address-247.4k ± 0%47.4k ± 0%~(all equal)
RuntimeTransaction/get_public_account-247.4k ± 0%47.4k ± 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.30M ± 0%5.30M ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_storage_used-250.2k ± 0%50.2k ± 0%~(all equal)
RuntimeTransaction/get_account_and_get_storage_capacity-25.30M ± 0%5.30M ± 0%~(all equal)
RuntimeTransaction/get_signer_vault-248.6k ± 0%48.6k ± 0%~(all equal)
RuntimeTransaction/get_signer_receiver-249.0k ± 0%49.0k ± 0%~(all equal)
RuntimeTransaction/transfer_tokens-249.8k ± 0%49.8k ± 0%~(all equal)
RuntimeTransaction/load_and_save_empty_string_on_signers_address-250.9k ± 0%50.9k ± 0%~(all equal)
RuntimeTransaction/load_and_save_long_string_on_signers_address-255.9k ± 0%55.9k ± 0%~(all equal)
RuntimeTransaction/create_new_account-28.43M ± 0%8.43M ± 0%~(all equal)
RuntimeTransaction/call_empty_contract_function-247.6k ± 0%47.6k ± 0%~(all equal)
RuntimeTransaction/emit_event-247.6k ± 0%47.6k ± 0%~(all equal)
RuntimeTransaction/borrow_array_from_storage-253.8k ± 0%53.8k ± 0%~(all equal)
RuntimeTransaction/copy_array_from_storage-253.8k ± 0%53.8k ± 0%~(all equal)
 

github-actions[bot] avatar Aug 10 '22 10:08 github-actions[bot]

file https://github.com/onflow/flow-go/blob/c1e478ed0e4366575be43a77d26cd34f5d7b1b80/integration/tests/epochs/suite.go seems to have multiple compiler errors (maybe it is just a local problem in my IDE?). Didn't look into very much, just wanted to add a note for later.

AlexHentschel avatar Aug 26 '22 05:08 AlexHentschel

file https://github.com/onflow/flow-go/blob/c1e478ed0e4366575be43a77d26cd34f5d7b1b80/integration/tests/epochs/suite.go seems to have multiple compiler errors (maybe it is just a local problem in my IDE?). Didn't look into very much, just wanted to add a note for later.

Do they look like this? image

This has been a problem for me as well for a while. The code compiles fine, but GoLand flags it as an error. I also haven't looked into it much. Not new with this PR though (or even this feature branch).

jordanschalm avatar Aug 26 '22 21:08 jordanschalm

@jordanschalm

[Alex] compiler errors in epochs/suite.go [Jordan] Do they look like this?

yep exactly. You are saying it is only a local problem? 👌 Then we'll just leave it.

AlexHentschel avatar Aug 29 '22 19:08 AlexHentschel