Uniswap / smart-order-router

GNU General Public License v3.0
384 stars 387 forks source link

fix: tenderly node error response #618

Closed jsy1218 closed 1 week ago

jsy1218 commented 1 week ago
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 https://github.com/Uniswap/smart-order-router/blob/e4cd7f90609b394c5b1e304f10e58438e18dcc50/src/providers/tenderly-simulation-provider.ts#L784 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

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

jsy1218 commented 1 week ago

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

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

graphite-app[bot] commented 1 week ago

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.

jsy1218 commented 1 week ago

Merge activity