-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Prefer receipt status to code availability on contract deployment #3298
Conversation
var gethRevert = "code couldn't be stored"; | ||
var revertMessage = "revert"; | ||
var couldNotBeStoredMessage = "code couldn't be stored"; | ||
var creationWithoutDataMessage = "contract creation without any data provided"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message emitted by geth, code ref here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for taking care of web3 related issues from Truffle 💪
Could you extend the CHANGELOG with this applied fix (you can reference this PR or this issue #1477)?
Edit: Updated the CHANGELOG quickly for you.
Description
Addresses problem described in truffle 2257 where the availability of the contract code in the client DB lags the delivery of the tx receipt on deployment. Web3 tries to fetch the code immediately, can't find anything and errors with
At the moment people frequently see successful contract deployments reported as failures
Commit 17f72d7 adds additional tests cases which hit this error, to establish a behavioral baseline for the logic change.
Commit aec5c08 adds logic to allow any deployment which had a 'real' bytecode and a true receipt status to be treated as successful.
The code length check is kept as an alternative for pre-byzantium chains and to preserve current behavior when deploying zero length bytecodes to ganache (e.g should error).
Type of change
Checklist:
npm run dtslint
with success and extended the tests and types if necessary.npm run test:unit
with success and extended the tests if necessary.npm run build-all
and tested the resulting file/'s fromdist
folder in a browser.CHANGELOG.md
file in the root folder.