hardhat
hardhat copied to clipboard
Handle large JSON payloads
- [ ] Because this PR includes a bug fix, relevant tests have been included.
- [ ] Because this PR includes a new feature, the change was previously discussed on an Issue or with someone from the team.
- [x] I didn't do anything of this.
⚠️ No Changeset found
Latest commit: e8a42d796dfa10061420ee88510a3c85c054e2fe
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
This PR was marked as stale because it didn't have any activity in the last 30 days. Please excuse us if we didn't have enough time to review it and get it merged. If you are still interested in getting these changes applied, please leave a comment indicating so. Otherwise, it will be closed in 7 days.
Hey @Dzejkop, this PR is interesting, but can you give more info on the motivation behind it? When did you encounter a problem with the existing code?
Thanks!
@alcuadrado sure, it's the same case as https://github.com/NomicFoundation/hardhat/issues/2165.
We're working on a private depoloyment with large limits for contract size. We encountered an error with the JSON.stringify
method which would crash if the contract was too large.
This PR was marked as stale because it didn't have any activity in the last 30 days. Please excuse us if we didn't have enough time to review it and get it merged. If you are still interested in getting these changes applied, please leave a comment indicating so. Otherwise, it will be closed in 7 days.
Not stale
This PR was marked as stale because it didn't have any activity in the last 30 days. Please excuse us if we didn't have enough time to review it and get it merged. If you are still interested in getting these changes applied, please leave a comment indicating so. Otherwise, it will be closed in 7 days.
This PR was closed because it has been stalled for 7 days with no activity.
@fvictorio Could you please re-open it?
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
hardhat | ❌ Failed (Inspect) | Jul 11, 2022 at 9:42AM (UTC) | |
hardhat-storybook | ❌ Failed (Inspect) | Jul 11, 2022 at 9:42AM (UTC) |
Hey @Dzejkop, I'm (finally) looking into this PR, and something I would like to do is to actually test it in a scenario that hits the JSON.stringify
/JSON.parse
limits.
I tried to create some synthetic examples with a lot of data, but I made solc crash while compiling those. Do you have an example of a scenario where this happens?
Hello @fvictorio , there's a repo with crafted example: https://github.com/citizen-stig/hardhat-large-contracts-compilation
I've just checked it with commands from READM.md and it reproduces the issue.
Please let me know if you have been able to reproduce it.
Also details are available in the corresponding issue: https://github.com/NomicFoundation/hardhat/issues/2165
Thanks a lot @citizen-stig, I thought I had seen a reproduction repo in some issue but couldn't find it :man_facepalming:
Oh, I see. I couldn't reproduce this because it's actually fixed in the latest versions, which save the build info files in a more piece-wise way. We did that for performance reasons, but as a side-effect, it fixed #2165. That's also why there are a lot of merge conflicts in this PR.
I'm going to close this PR now. Sorry for throwing away your work @Dzejkop :disappointed: But the alternative here is to do this from scratch, and that also means adding a new dependency, which we normally try not to do.
@gitpoap-bot @Dzejkop deserves a gitpoap
Congrats, @Dzejkop ! You've earned a GitPOAP for your contribution!
GitPOAP: 2022 Hardhat Contributor:

Head to gitpoap.io & connect your GitHub account to mint!
Learn more about GitPOAPs here.
Thanks for the fix @fvictorio!
And thanks for keeping track of this @citizen-stig