Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.:
This results in the
smart-order-router/src/providers/tenderly-simulation-provider.ts
Line 784 in e4cd7f9
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](https://camo.githubusercontent.com/e9c9b51b9d9a1da8e1dbd01eda83c86442ebaf7319bb25a95f6fc74bf0c9c862/68747470733a2f2f67726170686974652d757365722d75706c6f616465642d6173736574732d70726f642e73332e616d617a6f6e6177732e636f6d2f42423534664b653659313047767272644b58514e2f34613566343866622d353030312d343464662d393738622d6562386665386533373535352e706e67)
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