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

Support for logging custom errors on tx execution revert in not only real tx execution but also gas estimation #39

Merged
merged 13 commits into from
Apr 26, 2024

Conversation

siburu
Copy link
Contributor

@siburu siburu commented Apr 24, 2024

No description provided.

dongrie and others added 2 commits April 23, 2024 14:27
Signed-off-by: Dongri Jin <[email protected]>

Add defaultError

Signed-off-by: Dongri Jin <[email protected]>

Add test case

Signed-off-by: Dongri Jin <[email protected]>

Add panic error

Signed-off-by: Dongri Jin <[email protected]>

Add abi_paths

Signed-off-by: Dongri Jin <[email protected]>

Fix parse abi files

Signed-off-by: Dongri Jin <[email protected]>

* Move package

Signed-off-by: Dongri Jin <[email protected]>

Add GetRevertReason to after DebugTraceTransaction

Signed-off-by: Dongri Jin <[email protected]>

* Fix erepo create
* Fix add error repo

Signed-off-by: Dongri Jin <[email protected]>
Signed-off-by: Masanori Yoshida <[email protected]>
@siburu siburu changed the title Custom error Support for logging custom errors on tx execution revert in not only real tx execution but also gas estimation Apr 24, 2024
Signed-off-by: Masanori Yoshida <[email protected]>
@siburu siburu requested a review from bluele April 24, 2024 02:16
@siburu siburu marked this pull request as ready for review April 24, 2024 02:16
siburu added 2 commits April 24, 2024 13:14
Signed-off-by: Masanori Yoshida <[email protected]>
Signed-off-by: Masanori Yoshida <[email protected]>
Signed-off-by: Masanori Yoshida <[email protected]>
pkg/relay/ethereum/tx.go Outdated Show resolved Hide resolved
@siburu siburu force-pushed the custom-error branch 5 times, most recently from f057d35 to 9a63ad9 Compare April 25, 2024 07:58
siburu added 2 commits April 25, 2024 17:09
…if the corresponding error ABI is unknown

Signed-off-by: Masanori Yoshida <[email protected]>
@bluele bluele self-requested a review April 25, 2024 10:24
Copy link
Member

@bluele bluele left a comment

Choose a reason for hiding this comment

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

@siburu Thanks, LGTM👍

@siburu siburu requested a review from bluele April 26, 2024 05:00
@@ -113,7 +114,7 @@ func (c *Chain) GetMsgResult(id core.MsgID) (core.MsgResult, error) {
if receipt.Status == gethtypes.ReceiptStatusSuccessful {
return c.makeMsgResultFromReceipt(&receipt.Receipt, "")
}
revertReason, err := c.getRevertReasonFromReceipt(ctx, receipt)
revertReason, _, err := c.getRevertReasonFromReceipt(ctx, receipt)
if err != nil {
logger.Error("failed to get revert reason", err)
Copy link
Member

Choose a reason for hiding this comment

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

Should we also contain errorData in the error log?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 ... sure. I will fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah ... should we also add tx_hash here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added 99492cd

@siburu siburu requested a review from bluele April 26, 2024 06:12
Copy link
Member

@bluele bluele left a comment

Choose a reason for hiding this comment

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

LGTM👍

@bluele bluele merged commit 593dd65 into datachainlab:main Apr 26, 2024
1 check passed
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