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

Improve error logging for TraceCallDetector #135

Merged
merged 3 commits into from
Apr 12, 2022

Conversation

MartinquaXD
Copy link
Contributor

@MartinquaXD MartinquaXD commented Apr 7, 2022

At the moment the vast majority of tokens get rejected by the TraceCallDetector because of no pool or transaction failed. no pool is self explanatory but transaction failed can indicate an error during transfer into or out of the settlement contract.
To better debug why a token got rejected by the TraceCallDetector it makes sense to provide as much information as possible for transaction failed errors.
This could help us identify some low hanging fruit for supporting more tokens (reduce number of false positives).

This PR does 2 things:

  1. Add the underlying error message when a transfer fails.
  2. Have unique error logs for errors during transfer in and transfer out of the settlement contract.

Test Plan

manual test with a token that just returned transaction failed before:

2022-04-07T09:17:08.385Z DEBUG request{id=1}: shared::bad_token::trace_call: token 0x8762db106b2c2a0bccb3a80d1ed41273552616e8 quality Bad { reason: "can't transfer into settlement contract: transaction failed: Reverted" }

@MartinquaXD MartinquaXD requested a review from a team as a code owner April 7, 2022 07:27
@codecov-commenter
Copy link

codecov-commenter commented Apr 7, 2022

Codecov Report

Merging #135 (0330fb3) into main (dcba905) will decrease coverage by 0.03%.
The diff coverage is 10.00%.

❗ Current head 0330fb3 differs from pull request most recent head 67ee66d. Consider uploading reports for the commit 67ee66d to get more accurate results

@@            Coverage Diff             @@
##             main     #135      +/-   ##
==========================================
- Coverage   65.17%   65.14%   -0.04%     
==========================================
  Files         182      182              
  Lines       38108    38119      +11     
==========================================
- Hits        24836    24831       -5     
- Misses      13272    13288      +16     

@MartinquaXD MartinquaXD merged commit 2c2e66e into main Apr 12, 2022
@MartinquaXD MartinquaXD deleted the improve-trace-call-detector-logging branch April 12, 2022 07:53
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.

5 participants