-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Document workarounds for ECDSA.recover with Ganache #2190
Comments
I want to add a short clarification, given a bit of context is needed to understand this. The current ECDSA code is correct, safe, and will work as intended in all testnets and the main Ethereum network. This is a side-effect of an issue with how a Ganache node behaves on |
This side effect took my 16 hrs of debugging. Without fix Ganache will throw: |
😅 sorry this caused you so much trouble @sarveshwar-singh! |
Hello there. I just stumbled upon this issue and would appreciate any help: I signed a message with
Looking at this commit though it seems that the workaround shouldn't be needed anymore. |
In 2.2.0 we introduced protections against malleability of ECDSA signatures. More details can be found in #1622.
One unfortunate side effect of this has been that
ECDSA.recover
stopped working with Ganache-generated signatures, because they use the signatures parameters that the library rejects. This seems to be a problem with Ganache only. There seems to be plans to fix it in the next major version of Ganache, with an unknown ETA. The relevant issues are trufflesuite/ganache#451, trufflesuite/ganache#556.We evaluated rolling back the changes to ECDSA in Contracts 3.0. Given that we think malleability protection makes sense in general, that the issue only affects the current version of Ganache, and that there are workarounds, we decided to keep the current behavior and instead improve the documentation by including the workarounds that are required to make it work in Ganache, and more details about the issue to understand it.
The workaround can be found in
test/helpers/sign.js: fixSignature
. We should move it to test-helpers to make it available as a complement to the documentation.The text was updated successfully, but these errors were encountered: