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

fix: tenderly node error response #618

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

jsy1218
Copy link
Member

@jsy1218 jsy1218 commented Jun 26, 2024

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Bug fix

  • What is the current behavior? (You can also link to an open issue here)
    In case of simulated onchain revert from tenderly, e.g.:

INFO:  Tenderly estimate gas bundle request body: {
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tenderly_estimateGasBundle",
  "params": [
    [
      {
        "from": "0x67c231cF2B0E9518aBa46bDea6b10E0D0C5fEd1B",
        "to": "0x0F5D2fB29fb7d3CFeE444a200298f468908cC942",
        "data": "0x095ea7b3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
      },
      {
        "from": "0x67c231cF2B0E9518aBa46bDea6b10E0D0C5fEd1B",
        "to": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
        "data": "0x87517c450000000000000000000000000f5d2fb29fb7d3cfee444a200298f468908cc9420000000000000000000000003fc91a3afd70395cd496c647d5a6cc9d4b2b7fad000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000067153ca9"
      },
      {
        "from": "0x67c231cF2B0E9518aBa46bDea6b10E0D0C5fEd1B",
        "to": "0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD",
        "data": "0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000009184e72a0000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000012000000000000000000000000067c231cf2b0e9518aba46bdea6b10e0d0c5fed1b00000000000000000000000000000000000000000000000022b1c8c1227a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000420f5d2fb29fb7d3cfee444a200298f468908cc942000bb8a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000064dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000"
      }
    ],
    "0x133e8f1"
  ]
} with http status 200 result {
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "gas": "0xb660",
      "gasUsed": "0xb660"
    },
    {
      "gas": "0xbab2",
      "gasUsed": "0xbab2"
    },
    {
      "error": {
        "code": 3,
        "message": "execution reverted",
        "data": "0x316cf0eb"
      }
    }
  ]
}, having latencies 854 in milliseconds.

This results in the

const nodeGas = Number(resp.result[i]!.gas);
getting NaN. In comparison, it shows as gas from both tenderly API and tenderly node reported as different as of now:

But in reality, tenderly API also reverted but also returned gas used in the reverted transaction, meanwhile tenderly node doesn't return the gas used in the reverted transaction
Screenshot 2024-06-26 at 4.43.53 PM.png

  • What is the new behavior (if this is a feature change)?
    We will account for the onchain revert between tenderly API and tenderly node for a particular transaction. We will make sure we classify as gas match in case both endpoints return reverted.

I tested with local SOR CLI, that will make the swap transaction fail with onchain revert: https://app.warp.dev/block/V7gAajjltmHonCGbxpLAp7. Now it shows both tenderly API and tenderly node are matching TenderlyNodeGasEstimateBundleMatch

Copy link
Member Author

jsy1218 commented Jun 26, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @jsy1218 and the rest of your teammates on Graphite Graphite

@jsy1218 jsy1218 marked this pull request as ready for review June 26, 2024 23:46
@jsy1218 jsy1218 requested a review from a team as a code owner June 26, 2024 23:46
@graphite-app graphite-app bot requested review from mikeki, cgkol and xrsv June 26, 2024 23:46
Copy link

graphite-app bot commented Jun 26, 2024

Graphite Automations

"Request reviewers once CI passes on smart-order-router repo" took an action on this PR • (06/26/24)

1 assignee was added and 4 reviewers were added to this PR based on 's automation.

Copy link
Member Author

jsy1218 commented Jun 27, 2024

Merge activity

  • Jun 26, 11:12 PM EDT: @jsy1218 started a stack merge that includes this pull request via Graphite.
  • Jun 26, 11:12 PM EDT: @jsy1218 merged this pull request with Graphite.

@jsy1218 jsy1218 merged commit 17d1133 into main Jun 27, 2024
26 checks passed
@jsy1218 jsy1218 deleted the jsy1218/tenderly-node-error-response branch June 27, 2024 03:12
@jsy1218 jsy1218 mentioned this pull request Jun 27, 2024
jsy1218 added a commit that referenced this pull request Jun 27, 2024
- **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
Release #618
BitAI-dev pushed a commit to BitAI-dev/smart-order-router that referenced this pull request Jan 20, 2025
- **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
Release Uniswap/smart-order-router#618
BitAI-dev pushed a commit to Taiki-ops/smart-order-router that referenced this pull request Jan 20, 2025
- **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
Release Uniswap/smart-order-router#618
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.

2 participants