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 Revert Error Detection #860

Merged
merged 2 commits into from
Nov 29, 2022
Merged

Improve Revert Error Detection #860

merged 2 commits into from
Nov 29, 2022

Conversation

nlordell
Copy link
Contributor

Follow up to cowprotocol/ethcontract-rs#872

This PR bumps the version of ethcontract to one that detects additional revert RPC errors from Nethermind that were previously being missed.

This should decrease alert noise as we were alerting on fetching owner token balances in the bad token detector that were reverting, but, now with the newer version of ethcontract, should be categorized as a REVERT and be handled accordingly (basically, it would not find a balance for that token).

Test Plan

Try out with a contract that was causing the issue (basically, it wasn't a token). Previously, trying to get a native token price for a specific address was causing an internal server error (which generates alert noise):

services main % curl -s https://api.cow.fi/mainnet/api/v1/token/0xb975debd497c1cc6cdcb9f4246ef4903e842671f/native_price | jq
{
  "errorType": "InternalServerError",
  "description": ""
}
services main % curl -s http://localhost:8080/api/v1/token/0xb975debd497c1cc6cdcb9f4246ef4903e842671f/native_price | jq
{
  "errorType": "InternalServerError",
  "description": ""
}

With the proposed change, this is no longer the case:


services bump-ethcontract % curl -s http://localhost:8080/api/v1/token/0xb975debd497c1cc6cdcb9f4246ef4903e842671f/native_price | jq    
{
  "errorType": "UnsupportedToken",
  "description": "Token address 0xb975debd497c1cc6cdcb9f4246ef4903e842671f"
}

@nlordell nlordell requested a review from a team as a code owner November 28, 2022 17:02
@nlordell nlordell enabled auto-merge (squash) November 28, 2022 17:02
@nlordell nlordell merged commit a77f041 into main Nov 29, 2022
@nlordell nlordell deleted the bump-ethcontract branch November 29, 2022 09:23
@github-actions github-actions bot locked and limited conversation to collaborators Nov 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants