Skip to content

Conversation

@fbac
Copy link
Collaborator

@fbac fbac commented Oct 4, 2025

Trace failed blockchain transactions and return revert output in pkg/blockchain/client.ExecuteTransaction with a fixed gas limit of 5,000,000 and a 20s wait timeout

  • Add sentinel errors ErrTxFailed, ErrTxFailedNoError, ErrTxNotFound, and ErrTxGenesisNotTraceable in client.go
  • Modify pkg/blockchain/client.ExecuteTransaction to remove gas estimation and NoSend flow, set GasLimit to 5,000,000, extend wait timeout to 20s, and on mined failure trace via debug_traceTransaction to return revert output as a BlockchainError in client.go
  • Update pkg/blockchain/client.WaitForTransaction to return ErrTxFailed on failed receipts, treat ethereum.NotFound as a wait condition, and adjust polling behavior in client.go
  • Add traceTransactionOutput helper to poll debug_traceTransaction with callTracer and return the output field in client.go
  • Change BlockchainError.Error to return only the high-level message in errors.go
  • Update tests to assert human-readable custom error names instead of hex selectors in app_chain_admin_test.go, node_registry_admin_test.go, and settlement_chain_admin_test.go

📍Where to Start

Start with the transaction flow in ExecuteTransaction in client.go, then review WaitForTransaction and traceTransactionOutput in the same file.

Changes since #1211 opened

  • Standardized error handling across blockchain admin components by replacing string-based error detection with IsNoChange() method calls [c5a26ff]
  • Refactored control flow in blockchain client transaction handling functions by replacing switch statements with explicit conditional checks [c5a26ff]
  • Updated test expectations to align with standardized no-change error handling [c5a26ff]

Macroscope summarized c5a26ff.

@fbac fbac requested a review from a team as a code owner October 4, 2025 22:44
@graphite-app
Copy link

graphite-app bot commented Oct 4, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • Queue - adds this PR to the back of the merge queue
  • Hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@fbac fbac force-pushed the 10-05-return_blockchain_error branch from c99b4e3 to b99890a Compare October 4, 2025 22:46
@fbac fbac force-pushed the 10-05-return_blockchain_error branch from 8ad4927 to 2651129 Compare October 4, 2025 23:17
@fbac fbac changed the title Replay failed transactions with trace level Trace failed transactions Oct 4, 2025
@fbac fbac force-pushed the 10-05-return_blockchain_error branch 2 times, most recently from c3de788 to 717613e Compare October 6, 2025 14:57
@fbac fbac force-pushed the 10-05-return_blockchain_error branch from 717613e to 059a81b Compare October 6, 2025 15:42
@fbac fbac requested a review from mkysel October 7, 2025 09:20
@fbac fbac merged commit 270676a into main Oct 7, 2025
11 checks passed
@fbac fbac deleted the 10-05-return_blockchain_error branch October 7, 2025 14:47
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.

3 participants