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

Add get_transaction_status to chain_plugin #145

Merged

Conversation

oschwaldp-oci
Copy link
Contributor

@oschwaldp-oci oschwaldp-oci commented Apr 27, 2022

Adding a feature that allows querying the status of a transaction on the chain.

Support for the feature added in cleos via subcommand: get transaction-status <transaction_id>

Feature takes a transaction_id as input and outputs chain status and, if available, transaction status in the following format:

{ "state": "IN_BLOCK", "block_number": 90, "block_id": "0000005accfd59ba80a05380f60d51687406337b2aedd28b7daa33fdb8c16b5a", "block_timestamp": "2022-04-27T16:11:26.500", "expiration": "2022-04-27T16:11:56.000", "head_number": 186, "head_id": "000000bab27da51f76f483bb629b532510c22e2eb1acc632f5b37b421adecf63", "head_timestamp": "2022-04-27T16:12:14.500", "irreversible_number": 25, "irreversible_id": "0000001922118216bc16bf2c60d950598d80af3beca820eab751f7beecdb29e4", "irreversible_timestamp": "2022-04-27T16:10:54.000", "last_tracked_block_id": "000000129cee97f3e27312f0184d52d006a470f0e620553dfb4c5b4f3c856ab2" }

Transaction Status:

  • If the transaction is unknown, failed (expired), in a block, rolled back, finalized, or limited in block (this would be for unknown trans ids that the controller knows about). This will be reported as state with values of: UNKNOWN, FAILED, FORKED_OUT, LOCALLY_APPLIED, IN_BLOCK, IRREVERSIBLE.
  • The transaction’s block number, id, and timestamp, if they are applicable, will be reported as block_number, block_id, and block_timestamp. The transaction’s expiration date as expiration

Chain Status:

  • The current head block number, id, and timestamp will be reported as head_number, head_id, and head_timestamp.
  • The irreversible block number, id, and timestamp will be reported as irreversible_number, irreversible_id, and irreversible_timestamp.
  • The _last_tracked_block_id, from the chain state object as last_tracked_block_id

Update finality status to have timestamps and trx expiration

Enable trx finality status processing feature

Update test

Update chain_plugin to make use of actual chain_state and trx_state

Fix unit tests
@oschwaldp-oci oschwaldp-oci changed the base branch from main to feature/oci_api_phase1 April 27, 2022 03:32
Callback registration lambdas are now wired fully from the initial stubs.

Updated docs with example transaction status output
Remove enabling transaction finality status feature from previous feature testing effort.
@brianjohnson5972 brianjohnson5972 merged commit bed209c into feature/oci_api_phase1 Apr 27, 2022
@brianjohnson5972 brianjohnson5972 deleted the enfs-30-pwo-get-transaction-status branch April 27, 2022 19:43
@heifner heifner added the OCI OCI working this issue... label May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI OCI working this issue...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants