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

Propose error #835

Merged
merged 2 commits into from
Apr 1, 2024
Merged

Propose error #835

merged 2 commits into from
Apr 1, 2024

Conversation

mvandeberg
Copy link
Member

Brief description

Throws correct error if non transaction based exception is thrown during apply_block.

Checklist

  • I have built this pull request locally
  • I have ran the unit tests locally
  • I have manually tested this pull request
  • I have reviewed my pull request
  • I have added any relevant tests

Demonstration

Without the fix:

❯ ctest
Test project /home/michael/dev/koinos-chain/build/tests
      Start  1: chain_tests-controller_tests/submission_tests
 1/45 Test  #1: chain_tests-controller_tests/submission_tests ....................   Passed    0.03 sec
      Start  2: chain_tests-controller_tests/propose_block
 2/45 Test  #2: chain_tests-controller_tests/propose_block .......................***Failed    0.03 sec
      Start  3: chain_tests-controller_tests/block_irreversibility
 3/45 Test  #3: chain_tests-controller_tests/block_irreversibility ...............   Passed    0.04 sec
      Start  4: chain_tests-controller_tests/fork_heads
 4/45 Test  #4: chain_tests-controller_tests/fork_heads ..........................   Passed    0.05 sec
      Start  5: chain_tests-controller_tests/read_contract_tests
 5/45 Test  #5: chain_tests-controller_tests/read_contract_tests .................   Passed    0.03 sec
      Start  6: chain_tests-controller_tests/transaction_reversion_test
 6/45 Test  #6: chain_tests-controller_tests/transaction_reversion_test ..........   Passed    0.05 sec
      Start  7: chain_tests-controller_tests/receipt_test
 7/45 Test  #7: chain_tests-controller_tests/receipt_test ........................   Passed    0.03 sec
      Start  8: chain_tests-controller_tests/system_call_override_test
 8/45 Test  #8: chain_tests-controller_tests/system_call_override_test ...........   Passed    0.03 sec
      Start  9: chain_tests-controller_tests/invoke_system_call_test
 9/45 Test  #9: chain_tests-controller_tests/invoke_system_call_test .............   Passed    0.03 sec
      Start 10: chain_tests-stack_tests/simple_user_contract
10/45 Test #10: chain_tests-stack_tests/simple_user_contract .....................   Passed    0.03 sec
      Start 11: chain_tests-stack_tests/syscall_from_user
11/45 Test #11: chain_tests-stack_tests/syscall_from_user ........................   Passed    0.03 sec
      Start 12: chain_tests-stack_tests/user_from_user
12/45 Test #12: chain_tests-stack_tests/user_from_user ...........................   Passed    0.03 sec
      Start 13: chain_tests-stack_tests/syscall_override_from_thunk
13/45 Test #13: chain_tests-stack_tests/syscall_override_from_thunk ..............   Passed    0.03 sec
      Start 14: chain_tests-stack_tests/syscall_override_from_syscall_override
14/45 Test #14: chain_tests-stack_tests/syscall_override_from_syscall_override ...   Passed    0.03 sec
      Start 15: chain_tests-stack_tests/system_contract_from_syscall_override
15/45 Test #15: chain_tests-stack_tests/system_contract_from_syscall_override ....   Passed    0.04 sec
      Start 16: chain_tests-thunk_tests/get_transaction_field
16/45 Test #16: chain_tests-thunk_tests/get_transaction_field ....................   Passed    0.03 sec
      Start 17: chain_tests-thunk_tests/get_block_field
17/45 Test #17: chain_tests-thunk_tests/get_block_field ..........................   Passed    0.05 sec
      Start 18: chain_tests-thunk_tests/get_operation
18/45 Test #18: chain_tests-thunk_tests/get_operation ............................   Passed    0.04 sec
      Start 19: chain_tests-thunk_tests/db_crud
19/45 Test #19: chain_tests-thunk_tests/db_crud ..................................   Passed    0.03 sec
      Start 20: chain_tests-thunk_tests/db_permissions
20/45 Test #20: chain_tests-thunk_tests/db_permissions ...........................   Passed    0.03 sec
      Start 21: chain_tests-thunk_tests/contract_tests
21/45 Test #21: chain_tests-thunk_tests/contract_tests ...........................   Passed    0.03 sec
      Start 22: chain_tests-thunk_tests/override_tests
22/45 Test #22: chain_tests-thunk_tests/override_tests ...........................   Passed    0.03 sec
      Start 23: chain_tests-thunk_tests/thunk_test
23/45 Test #23: chain_tests-thunk_tests/thunk_test ...............................   Passed    0.03 sec
      Start 24: chain_tests-thunk_tests/system_call_test
24/45 Test #24: chain_tests-thunk_tests/system_call_test .........................   Passed    0.03 sec
      Start 25: chain_tests-thunk_tests/get_head_info_thunk_test
25/45 Test #25: chain_tests-thunk_tests/get_head_info_thunk_test .................   Passed    0.03 sec
      Start 26: chain_tests-thunk_tests/hash_thunk_test
26/45 Test #26: chain_tests-thunk_tests/hash_thunk_test ..........................   Passed    0.03 sec
      Start 27: chain_tests-thunk_tests/privileged_calls
27/45 Test #27: chain_tests-thunk_tests/privileged_calls .........................   Passed    0.03 sec
      Start 28: chain_tests-thunk_tests/last_irreversible_block_test
28/45 Test #28: chain_tests-thunk_tests/last_irreversible_block_test .............   Passed    0.03 sec
      Start 29: chain_tests-thunk_tests/stack_tests
29/45 Test #29: chain_tests-thunk_tests/stack_tests ..............................   Passed    0.03 sec
      Start 30: chain_tests-thunk_tests/check_authority
30/45 Test #30: chain_tests-thunk_tests/check_authority ..........................   Passed    0.03 sec
      Start 31: chain_tests-thunk_tests/transaction_nonce_test
31/45 Test #31: chain_tests-thunk_tests/transaction_nonce_test ...................   Passed    0.03 sec
      Start 32: chain_tests-thunk_tests/get_contract_id_test
32/45 Test #32: chain_tests-thunk_tests/get_contract_id_test .....................   Passed    0.03 sec
      Start 33: chain_tests-thunk_tests/token_tests
33/45 Test #33: chain_tests-thunk_tests/token_tests ..............................   Passed    0.03 sec
      Start 34: chain_tests-thunk_tests/call_contract_operation_failure
34/45 Test #34: chain_tests-thunk_tests/call_contract_operation_failure ..........   Passed    0.03 sec
      Start 35: chain_tests-thunk_tests/tick_limit
35/45 Test #35: chain_tests-thunk_tests/tick_limit ...............................   Passed    0.03 sec
      Start 36: chain_tests-thunk_tests/disk_usage
36/45 Test #36: chain_tests-thunk_tests/disk_usage ...............................   Passed    0.03 sec
      Start 37: chain_tests-thunk_tests/transaction_reversion
37/45 Test #37: chain_tests-thunk_tests/transaction_reversion ....................   Passed    0.03 sec
      Start 38: chain_tests-thunk_tests/authorize_tests
38/45 Test #38: chain_tests-thunk_tests/authorize_tests ..........................   Passed    0.04 sec
      Start 39: chain_tests-thunk_tests/get_chain_id
39/45 Test #39: chain_tests-thunk_tests/get_chain_id .............................   Passed    0.03 sec
      Start 40: chain_tests-thunk_tests/system_resources
40/45 Test #40: chain_tests-thunk_tests/system_resources .........................   Passed    0.03 sec
      Start 41: chain_tests-thunk_tests/system_rc
41/45 Test #41: chain_tests-thunk_tests/system_rc ................................   Passed    0.03 sec
      Start 42: chain_tests-thunk_tests/contract_exit
42/45 Test #42: chain_tests-thunk_tests/contract_exit ............................   Passed    0.03 sec
      Start 43: chain_tests-thunk_tests/syscall_override_return
43/45 Test #43: chain_tests-thunk_tests/syscall_override_return ..................   Passed    0.03 sec
      Start 44: chain_tests-thunk_tests/thunk_time
44/45 Test #44: chain_tests-thunk_tests/thunk_time ...............................   Passed    0.26 sec
      Start 45: chain_tests-thunk_tests/null_bytes_written_test
45/45 Test #45: chain_tests-thunk_tests/null_bytes_written_test ..................   Passed    0.03 sec

98% tests passed, 1 tests failed out of 45

Total Test time (real) =   1.74 sec

The following tests FAILED:
          2 - chain_tests-controller_tests/propose_block (Failed)
Errors while running CTest
Output from these tests are in: /home/michael/dev/koinos-chain/build/tests/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.

With the fix:

❯ ctest
Test project /home/michael/dev/koinos-chain/build/tests
      Start  1: chain_tests-controller_tests/submission_tests
 1/45 Test  #1: chain_tests-controller_tests/submission_tests ....................   Passed    0.03 sec
      Start  2: chain_tests-controller_tests/propose_block
 2/45 Test  #2: chain_tests-controller_tests/propose_block .......................   Passed    0.03 sec
      Start  3: chain_tests-controller_tests/block_irreversibility
 3/45 Test  #3: chain_tests-controller_tests/block_irreversibility ...............   Passed    0.04 sec
      Start  4: chain_tests-controller_tests/fork_heads
 4/45 Test  #4: chain_tests-controller_tests/fork_heads ..........................   Passed    0.05 sec
      Start  5: chain_tests-controller_tests/read_contract_tests
 5/45 Test  #5: chain_tests-controller_tests/read_contract_tests .................   Passed    0.03 sec
      Start  6: chain_tests-controller_tests/transaction_reversion_test
 6/45 Test  #6: chain_tests-controller_tests/transaction_reversion_test ..........   Passed    0.05 sec
      Start  7: chain_tests-controller_tests/receipt_test
 7/45 Test  #7: chain_tests-controller_tests/receipt_test ........................   Passed    0.03 sec
      Start  8: chain_tests-controller_tests/system_call_override_test
 8/45 Test  #8: chain_tests-controller_tests/system_call_override_test ...........   Passed    0.03 sec
      Start  9: chain_tests-controller_tests/invoke_system_call_test
 9/45 Test  #9: chain_tests-controller_tests/invoke_system_call_test .............   Passed    0.03 sec
      Start 10: chain_tests-stack_tests/simple_user_contract
10/45 Test #10: chain_tests-stack_tests/simple_user_contract .....................   Passed    0.03 sec
      Start 11: chain_tests-stack_tests/syscall_from_user
11/45 Test #11: chain_tests-stack_tests/syscall_from_user ........................   Passed    0.03 sec
      Start 12: chain_tests-stack_tests/user_from_user
12/45 Test #12: chain_tests-stack_tests/user_from_user ...........................   Passed    0.03 sec
      Start 13: chain_tests-stack_tests/syscall_override_from_thunk
13/45 Test #13: chain_tests-stack_tests/syscall_override_from_thunk ..............   Passed    0.03 sec
      Start 14: chain_tests-stack_tests/syscall_override_from_syscall_override
14/45 Test #14: chain_tests-stack_tests/syscall_override_from_syscall_override ...   Passed    0.03 sec
      Start 15: chain_tests-stack_tests/system_contract_from_syscall_override
15/45 Test #15: chain_tests-stack_tests/system_contract_from_syscall_override ....   Passed    0.03 sec
      Start 16: chain_tests-thunk_tests/get_transaction_field
16/45 Test #16: chain_tests-thunk_tests/get_transaction_field ....................   Passed    0.03 sec
      Start 17: chain_tests-thunk_tests/get_block_field
17/45 Test #17: chain_tests-thunk_tests/get_block_field ..........................   Passed    0.03 sec
      Start 18: chain_tests-thunk_tests/get_operation
18/45 Test #18: chain_tests-thunk_tests/get_operation ............................   Passed    0.03 sec
      Start 19: chain_tests-thunk_tests/db_crud
19/45 Test #19: chain_tests-thunk_tests/db_crud ..................................   Passed    0.03 sec
      Start 20: chain_tests-thunk_tests/db_permissions
20/45 Test #20: chain_tests-thunk_tests/db_permissions ...........................   Passed    0.03 sec
      Start 21: chain_tests-thunk_tests/contract_tests
21/45 Test #21: chain_tests-thunk_tests/contract_tests ...........................   Passed    0.03 sec
      Start 22: chain_tests-thunk_tests/override_tests
22/45 Test #22: chain_tests-thunk_tests/override_tests ...........................   Passed    0.03 sec
      Start 23: chain_tests-thunk_tests/thunk_test
23/45 Test #23: chain_tests-thunk_tests/thunk_test ...............................   Passed    0.03 sec
      Start 24: chain_tests-thunk_tests/system_call_test
24/45 Test #24: chain_tests-thunk_tests/system_call_test .........................   Passed    0.03 sec
      Start 25: chain_tests-thunk_tests/get_head_info_thunk_test
25/45 Test #25: chain_tests-thunk_tests/get_head_info_thunk_test .................   Passed    0.03 sec
      Start 26: chain_tests-thunk_tests/hash_thunk_test
26/45 Test #26: chain_tests-thunk_tests/hash_thunk_test ..........................   Passed    0.03 sec
      Start 27: chain_tests-thunk_tests/privileged_calls
27/45 Test #27: chain_tests-thunk_tests/privileged_calls .........................   Passed    0.03 sec
      Start 28: chain_tests-thunk_tests/last_irreversible_block_test
28/45 Test #28: chain_tests-thunk_tests/last_irreversible_block_test .............   Passed    0.03 sec
      Start 29: chain_tests-thunk_tests/stack_tests
29/45 Test #29: chain_tests-thunk_tests/stack_tests ..............................   Passed    0.03 sec
      Start 30: chain_tests-thunk_tests/check_authority
30/45 Test #30: chain_tests-thunk_tests/check_authority ..........................   Passed    0.03 sec
      Start 31: chain_tests-thunk_tests/transaction_nonce_test
31/45 Test #31: chain_tests-thunk_tests/transaction_nonce_test ...................   Passed    0.03 sec
      Start 32: chain_tests-thunk_tests/get_contract_id_test
32/45 Test #32: chain_tests-thunk_tests/get_contract_id_test .....................   Passed    0.03 sec
      Start 33: chain_tests-thunk_tests/token_tests
33/45 Test #33: chain_tests-thunk_tests/token_tests ..............................   Passed    0.03 sec
      Start 34: chain_tests-thunk_tests/call_contract_operation_failure
34/45 Test #34: chain_tests-thunk_tests/call_contract_operation_failure ..........   Passed    0.03 sec
      Start 35: chain_tests-thunk_tests/tick_limit
35/45 Test #35: chain_tests-thunk_tests/tick_limit ...............................   Passed    0.03 sec
      Start 36: chain_tests-thunk_tests/disk_usage
36/45 Test #36: chain_tests-thunk_tests/disk_usage ...............................   Passed    0.03 sec
      Start 37: chain_tests-thunk_tests/transaction_reversion
37/45 Test #37: chain_tests-thunk_tests/transaction_reversion ....................   Passed    0.03 sec
      Start 38: chain_tests-thunk_tests/authorize_tests
38/45 Test #38: chain_tests-thunk_tests/authorize_tests ..........................   Passed    0.04 sec
      Start 39: chain_tests-thunk_tests/get_chain_id
39/45 Test #39: chain_tests-thunk_tests/get_chain_id .............................   Passed    0.03 sec
      Start 40: chain_tests-thunk_tests/system_resources
40/45 Test #40: chain_tests-thunk_tests/system_resources .........................   Passed    0.03 sec
      Start 41: chain_tests-thunk_tests/system_rc
41/45 Test #41: chain_tests-thunk_tests/system_rc ................................   Passed    0.03 sec
      Start 42: chain_tests-thunk_tests/contract_exit
42/45 Test #42: chain_tests-thunk_tests/contract_exit ............................   Passed    0.03 sec
      Start 43: chain_tests-thunk_tests/syscall_override_return
43/45 Test #43: chain_tests-thunk_tests/syscall_override_return ..................   Passed    0.03 sec
      Start 44: chain_tests-thunk_tests/thunk_time
44/45 Test #44: chain_tests-thunk_tests/thunk_time ...............................   Passed    0.25 sec
      Start 45: chain_tests-thunk_tests/null_bytes_written_test
45/45 Test #45: chain_tests-thunk_tests/null_bytes_written_test ..................   Passed    0.03 sec

100% tests passed, 0 tests failed out of 45

Total Test time (real) =   1.67 sec

@mvandeberg mvandeberg requested a review from sgerbino April 1, 2024 18:12
@mvandeberg mvandeberg merged commit c2d7502 into master Apr 1, 2024
2 checks passed
@mvandeberg mvandeberg deleted the propose-error branch April 1, 2024 21:15
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.

2 participants