Skip to content

Log revert reason in CLI#40

Merged
adambalogh merged 2 commits intomainfrom
aba/revert
Mar 11, 2026
Merged

Log revert reason in CLI#40
adambalogh merged 2 commits intomainfrom
aba/revert

Conversation

@adambalogh
Copy link
Contributor

@adambalogh adambalogh commented Mar 11, 2026

Summary

  • When a transaction reverts, the CLI now replays the failed tx via eth_call at the mined block to extract the revert reason
  • Decodes Solidity Error(string) revert messages into human-readable output
  • Updates all command call sites (tee, role, heartbeat, types, pcr, cert) to display the revert reason on failure

Before

Registration failed

After

Registration failed: PCR hash not approved

Test plan

  • Run tee register against an enclave that will fail (e.g. unapproved PCR) and verify the revert reason is printed
  • Run a successful registration and verify no regression
  • Test with other commands (role grant-admin, pcr approve, etc.) to confirm revert reasons display correctly
  • Verify timeout case still prints "timed out waiting for receipt"

@adambalogh adambalogh requested a review from Copilot March 11, 2026 21:59
@adambalogh adambalogh added the run-ci Run ETE Testing Suite label Mar 11, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the tee-mgmt-cli UX by surfacing Ethereum transaction revert reasons in CLI output by replaying failed transactions via eth_call at the mined block and decoding Solidity Error(string) messages.

Changes:

  • Extend Client.WaitForTx to return both success status and a failure/revert reason string.
  • Add logic to replay failed transactions with eth_call and decode Error(string) revert data.
  • Update CLI command call sites to display revert reasons on transaction failures.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/tee-mgmt-cli/registry/client.go Adds receipt block tracking, revert-reason extraction/decoding, and updates tx result printing API.
scripts/tee-mgmt-cli/cmd/types.go Adapts type commands to the new WaitForTx/PrintTxResult signatures.
scripts/tee-mgmt-cli/cmd/tee.go Prints revert reason (when available) for TEE registration and other TEE tx flows.
scripts/tee-mgmt-cli/cmd/role.go Adapts role commands to print revert reasons on failure.
scripts/tee-mgmt-cli/cmd/pcr.go Adapts PCR commands to print revert reasons on failure.
scripts/tee-mgmt-cli/cmd/heartbeat.go Adapts heartbeat commands to print revert reasons on failure.
scripts/tee-mgmt-cli/cmd/cert.go Adapts cert commands to print revert reasons on failure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@adambalogh adambalogh merged commit a63dd64 into main Mar 11, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci Run ETE Testing Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants