Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Better handling for missing transactions in history_plugin #4060

Conversation

wanderingbort
Copy link
Contributor

  • modified history_plugin to throw when the transaction is not found instead of returning a meaningless structure
  • modified history_plugin to accept a block_num_hint optionally which is used to fetch transactions from the block log without any history data
  • created help text for get transaction that better explains the error and suggests solutions

resolves #3887

# given trx ce8fb4a99dedc1dff52eab790df97ddb2a49c45ac396b8f4a978e31468a7819b 
# in block 100 but not in the history_plugin --filter-on parameter

$ cleos get transaction ce8fb4a99dedc1dff52eab790df97ddb2a49c45ac396b8f4a978e31468a7819b
Failed to fetch information for transaction: ce8fb4a9 from the history plugin

If you know the block number which included this transaction you providing it with the --block-hint option may help
Please ensure that the eosio::history_plugin is enabled on the RPC node you are connecting to and that an account involved in this transaction was configured in the filter-on setting.

$ cleos get transaction ce8fb4a99dedc1dff52eab790df97ddb2a49c45ac396b8f4a978e31468a7819b -b 500000
Failed to fetch information for transaction: ce8fb4a9 from the history plugin and the transaction was not present in block 500000

Please ensure that the eosio::history_plugin is enabled on the RPC node you are connecting to and that an account involved in this transaction was configured in the filter-on setting.

$ cleos get transaction ce8fb4a99dedc1dff52eab790df97ddb2a49c45ac396b8f4a978e31468a7819b -b 100
<snip transaction information w/o tracing if the history_plugin had no data>

b1bart and others added 4 commits June 12, 2018 15:48
- modified history_plugin to throw when the transaction is not found instead of returning a meaningless structure
- modified history_plugin to accept a `block_num_hint` optionally which is used to fetch transactions from the block log without any history data
- created help text for get transaction that better explains the error and suggests solutions
@wanderingbort
Copy link
Contributor Author

I merged in the seemingly unrelated fix for #4145, which makes this a PR that will auto close #4146
However, this should fix the test cases.

@heifner heifner changed the base branch from master to release/1.1 June 19, 2018 02:59
@wanderingbort wanderingbort modified the milestone: Version 1.1 Jun 27, 2018
@heifner heifner merged commit f53c112 into EOSIO:release/1.1 Jul 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants