-
Notifications
You must be signed in to change notification settings - Fork 30
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
Rework signal handling #189
Conversation
Rework signal handling to handle transactions as they are received. Remove alternate path. Update unit tests for signal handling updates.
A specific test case to test that calling signal_start_block, followed by signal_applied_block, with no calls to signal_accepted_transaction in between, properly sets_head_* parameters.
New parse_params implementation was failing to return when successful.
plugins/chain_interface/include/eosio/chain/signals_processor.hpp
Outdated
Show resolved
Hide resolved
plugins/chain_plugin/test/test_trx_finality_status_processing.cpp
Outdated
Show resolved
Hide resolved
plugins/chain_plugin/test/test_trx_finality_status_processing.cpp
Outdated
Show resolved
Hide resolved
plugins/chain_plugin/test/test_trx_finality_status_processing.cpp
Outdated
Show resolved
Hide resolved
plugins/chain_plugin/test/test_trx_finality_status_processing.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Submitting review prematurely because Github has decided to stop displaying my comments in line, for some reason.
I did stop calling out all individual instances of strings which should be converted to f-strings, and also stopped calling out individual instances of assert
being used incorrectly. All such changes should still be made.
postInfo = None | ||
transferAmount=10 | ||
|
||
# ensuring that prod0's producer is active, which will give sufficient time to identify the transaction as "LOCALLY_APPLIED" before it travels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may give sufficient time, assuming the efficiency of net_plugin doesn't considerably improve.
We should probably come up with a way to label tests like this which are non-deterministic to tell us where to look first if automated tests get flaky in the future.
Remove unnecessary signals_processor and route everything directly to the trx_finality_status_processing handler.
Rework signal handling to handle transactions as they are received
Currently, transactions are accumulated till the block state is accepted and the accumulated transactions are sent along with the block state to be handled. This is a problem because when a user calls the send_transaction api, it will take till the speculative block is aborted and the next block is applied before all the transactions are then recorded. This means that if the user tries to immediately get the status of the transaction, it will get back “UNKNOWN” till the transaction is finally processed (up to 500 ms later).
Integration test work
Added integration tests to verify calls to get_transaction_status for a known transaction progressed from "APPLIED_LOCALLY" to "IN_BLOCK" to "IRREVERSIBLE" and then, after passing the success duration, returning "UNKNOWN". Also added a test to verify that get_transaction_status reported the correct status when a transaction's block was forked out.
Issue Resolution
Also resolves Issue: #176