hardhat icon indicating copy to clipboard operation
hardhat copied to clipboard

Handle large JSON payloads

Open Dzejkop opened this issue 2 years ago • 10 comments

  • [ ] 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.

Dzejkop avatar Mar 21 '22 09:03 Dzejkop

⚠️ 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

changeset-bot[bot] avatar Mar 21 '22 09:03 changeset-bot[bot]

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.

github-actions[bot] avatar Apr 27 '22 19:04 github-actions[bot]

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 avatar Apr 27 '22 20:04 alcuadrado

@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.

Dzejkop avatar Apr 28 '22 10:04 Dzejkop

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.

github-actions[bot] avatar May 28 '22 11:05 github-actions[bot]

Not stale

fvictorio avatar May 30 '22 14:05 fvictorio

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.

github-actions[bot] avatar Jun 29 '22 14:06 github-actions[bot]

This PR was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Jul 06 '22 15:07 github-actions[bot]

@fvictorio Could you please re-open it?

citizen-stig avatar Jul 08 '22 12:07 citizen-stig

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)

vercel[bot] avatar Jul 11 '22 09:07 vercel[bot]

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?

fvictorio avatar Dec 13 '22 14:12 fvictorio

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.

citizen-stig avatar Dec 14 '22 10:12 citizen-stig

Also details are available in the corresponding issue: https://github.com/NomicFoundation/hardhat/issues/2165

citizen-stig avatar Dec 14 '22 10:12 citizen-stig

Thanks a lot @citizen-stig, I thought I had seen a reproduction repo in some issue but couldn't find it :man_facepalming:

fvictorio avatar Dec 14 '22 10:12 fvictorio

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

fvictorio avatar Dec 14 '22 10:12 fvictorio

Congrats, @Dzejkop ! You've earned a GitPOAP for your contribution!

GitPOAP: 2022 Hardhat Contributor:

GitPOAP: 2022 Hardhat Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

gitpoap-bot[bot] avatar Dec 14 '22 10:12 gitpoap-bot[bot]

Thanks for the fix @fvictorio!

And thanks for keeping track of this @citizen-stig

Dzejkop avatar Dec 14 '22 11:12 Dzejkop