Merged
Conversation
There was a problem hiding this comment.
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.WaitForTxto return both success status and a failure/revert reason string. - Add logic to replay failed transactions with
eth_calland decodeError(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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
eth_callat the mined block to extract the revert reasonError(string)revert messages into human-readable outputtee,role,heartbeat,types,pcr,cert) to display the revert reason on failureBefore
After
Test plan
tee registeragainst an enclave that will fail (e.g. unapproved PCR) and verify the revert reason is printedrole grant-admin,pcr approve, etc.) to confirm revert reasons display correctly