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

Cleanup tests related to transition and finalizer_policy updates. #108

Merged
merged 48 commits into from
May 7, 2024

Conversation

greg7mdp
Copy link
Contributor

@greg7mdp greg7mdp commented May 2, 2024

Resolves #88, #47

  • Add new API in base_tester which returns the transaction traces (including for onblock) in addition to the signed_block_ptr
  • add some APIs in base_tester to validate finalizer policy changes (check_head_finalizer_policy).
  • add finalizer_keys class in tester.hpp which can be used to manage finalizer keys for finalizer_policies, as well as provide APIs for set_node_finalizers, set_finalizer_policy and transition_to_savanna.
  • keep track of lib in base_tester, so that the connection to the irreversible_block signal doesn't have to be repeated in multiple tests.
  • update finality_test_cluster to having a configurable number of nodes (4 or more), use new tester.hpp features, fix multiple issues in tests.
  • update some tests (api_tests.cpp, finalizer_update_tests.cpp, etc... ) to use these new facilities and avoid duplication.

greg7mdp added 28 commits April 18, 2024 16:59
Should not be 3 if we have 3 finalizers.
@ericpassmore
Copy link
Contributor

Note:start
group: IF
category: TEST
summary: Cleanup tests related to transition and finalizer_policy updates.
Note:end

@greg7mdp greg7mdp requested review from heifner and linh2931 May 6, 2024 18:02
libraries/testing/include/eosio/testing/tester.hpp Outdated Show resolved Hide resolved
libraries/testing/include/eosio/testing/tester.hpp Outdated Show resolved Hide resolved
libraries/testing/include/eosio/testing/tester.hpp Outdated Show resolved Hide resolved
libraries/testing/include/eosio/testing/tester.hpp Outdated Show resolved Hide resolved
libraries/testing/include/eosio/testing/tester.hpp Outdated Show resolved Hide resolved
libraries/testing/include/eosio/testing/tester.hpp Outdated Show resolved Hide resolved
unittests/finality_test_cluster.cpp Outdated Show resolved Hide resolved
unittests/finality_test_cluster.cpp Outdated Show resolved Hide resolved
unittests/finality_test_cluster.hpp Outdated Show resolved Hide resolved
unittests/finality_tests.cpp Outdated Show resolved Hide resolved
uint16_t confirm_block_count,
const vector<digest_type>& new_protocol_feature_activations,
block_status bs,
const fc::time_point& deadline = fc::time_point::maximum() );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of modifying controller, seems like the tester should connect to applied_transaction which would include the onblock.

Copy link
Contributor Author

@greg7mdp greg7mdp May 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the drawback of having start_block returning the trace?
push_transaction does return the trace and the same reasoning could apply.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the applied_transaction signal tests that the signal is called appropriately, would be nice to have some tests around that functionality. I don't have a strong rejection to having start_block return the onblock trace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we already get the transaction traces in libtester as a result of control->push_transaction(), I'd rather leave as-is.
I think it seems appropriate for start_block to return the onblock trace.

@ericpassmore
Copy link
Contributor

Note:start
group: IF
category: TESTS
summary: Cleanup tests related to transition and finalizer_policy updates.
Note:end

libraries/chain/controller.cpp Show resolved Hide resolved
libraries/testing/include/eosio/testing/tester.hpp Outdated Show resolved Hide resolved
libraries/testing/include/eosio/testing/tester.hpp Outdated Show resolved Hide resolved
unittests/api_tests.cpp Outdated Show resolved Hide resolved
unittests/finality_test_cluster.hpp Outdated Show resolved Hide resolved
unittests/finality_test_cluster.hpp Outdated Show resolved Hide resolved
unittests/finality_test_cluster.hpp Outdated Show resolved Hide resolved
unittests/finality_test_cluster.hpp Outdated Show resolved Hide resolved
unittests/finality_test_cluster.hpp Outdated Show resolved Hide resolved
unittests/finality_test_cluster.hpp Outdated Show resolved Hide resolved
@greg7mdp greg7mdp merged commit e044793 into main May 7, 2024
36 checks passed
@greg7mdp greg7mdp deleted the gh_47 branch May 7, 2024 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants