Replies: 16 comments 12 replies
-
Pinging @alcuadrado and @fvictorio. |
Beta Was this translation helpful? Give feedback.
-
There was a bug prior to ethers 5.6.2 which would send out the wrong error (it emitted "UNPREDICTABLE_GAS_LIMIT" when it was actually a CALL_EXCEPTION, and in ethers CALL_EXCEPTION only occurs during The response for Hardhat was different than Geth/Parity, so things that worked in Geth/Parity (i.e. return the call result bytes, which if decoded using the My goal is to make sure Geth, Parity, Hardhat, MM, etc. all work the same, so that tests written against one are indicative of behaviour across the others and that if you run your app against one backend and switch to another there are no surprises. Suffice to say, it is not easy because the specification really doesn't specify what happens in the case of errors and every backend is different. I'm working with Patricio at Hardhat to get their errors including all the necessary data; currently in the case of I have a feeling the
Ideally, everything stays in the machine-readable realm, so we don't have weird string matching and regular expressions which breaks every time a backend gets creative with their grammar [for example]. :) |
Beta Was this translation helpful? Give feedback.
-
@fvictorio @alcuadrado (tagging Patricio too, since he's working on it)
That's correct. When Geth/Parity throws, the message looks something like:
While currently Hardhat errors seem to look like:
The important thing is the In v5.6.2 I added a spelunk function to help find the error; it searches for any machine readable component (including embedded in JSON; not within strings though) that contains:
This also solved a problem with some versions of MetaMask (which also had their own format), so I'm hoping this is both generic enough to find errors across the diverse collection of backends and also narrow enough not to misinterpret a value as a call exception. |
Beta Was this translation helpful? Give feedback.
-
That makes sense, thanks a lot for the response. We are going to add the |
Beta Was this translation helpful? Give feedback.
-
Another data point: checking for custom errors with |
Beta Was this translation helpful? Give feedback.
-
Hoping this can be helpful to both projects' efforts here - I've got an OSS reproduction where I've bisected ethers versions to understand where I start seeing similar errors. We're using EIP-3668 OffchainLookup errors in a public view func. We've found that while we do receive the custom OffchainError in tests, we cannot easily pull the params out, and apply a regex to the string to get the error params. Using latest hardhat and hardhat-ethers, this works well with When I upgrade ethers to 5.6.2, the error we catch is the same "missing revert data in call exception" reported here
Since we're using a regex against the error name, we still catch that error, but are not now able to pull the args off, and our tests start failing. I'm not able to see any changes between 5.6.1 and 5.6.2 that would cause this, am happy to stay on 5.6.1 until resolved, but hopefully this helps y'all sort these things out! |
Beta Was this translation helpful? Give feedback.
-
same issue. forced the version to remain 5.6.1 as a workaround. In package.json: |
Beta Was this translation helpful? Give feedback.
-
Same issue - going back to ethers@5.6.1 fixed it for me. |
Beta Was this translation helpful? Give feedback.
-
Same issue. However I hat to change
to
to fix it. And also the call in the unit test from
to
Calls that does not raise an error work with the fist variant. |
Beta Was this translation helpful? Give feedback.
-
I am getting this error for some revertedWith tests:
The weird thing is some i can test correctly revertedWith(errors.custom_error) and some i keep getting the error above. Is there a way to see exactly what data is being passed to revert() ? |
Beta Was this translation helpful? Give feedback.
-
Still having errors in solidity external tests. It fails in our CI 1071808 and it is reproducible locally, as shown next. Steps to reproduce:
Output of failing tests:
|
Beta Was this translation helpful? Give feedback.
-
This PR partially fixes this issue: #3308 |
Beta Was this translation helpful? Give feedback.
-
hi, any news on this topic? I have the same problem when I try to get the real revert reason of a tx (as detailed here: https://gist.github.com/gluk64/fdea559472d957f1138ed93bcbc6f78a) |
Beta Was this translation helpful? Give feedback.
-
I am also running into this issue, is there a fix for this problem? |
Beta Was this translation helpful? Give feedback.
-
Hitting same error @6.8.1 ![]() any solutions, downgrade to any previous version? ( was @6.6.0 but there is a issue with getting FeeData for polygon so i upgraded to latest) |
Beta Was this translation helpful? Give feedback.
-
In Solidity we have an array of external projects that we build and test with latest compiler binary on every PR. Most of these projects use Hardhat and ethers.js. Today I have noticed failures in several of these tests. The errors are not identical but in 3 cases they look more or less like this:
I managed to reproduce this outside of our CI and the problem disappears when I switch to ethers@5.6.1. I'm not sure if this is a bug in Ethers or incorrect usage on Hardhat's part. The bug reporting template suggests starting a discussion in that case so I'm posting here first.
Detailed info about failures
Here's the output from the 3 projects that fail this way:
There are 2 more that have completely different messages but started failing at the same time so the underlying cause could be the same:
EDIT: I verified that downgrading ethers.js fixes breakage in these two as well.
How to reproduce
The error is easy to reproduce using Euler:
Beta Was this translation helpful? Give feedback.
All reactions