Bump dependencies and automate Cannonfile version bumps #448
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale
The initial purpose of this PR was to fix the Rust bindings build. The issue stems from a breaking change in
serdenot exposing__privateanymore. A quick-and-dirty fix to this issue would be to pinserdeto an older, working version. An arguably more natural and sustainable solution, which I personally have been waiting some time to do, would be to bump Foundry from 1.1.0 to 1.4.2. As you can see, it's a huge bump. Let me explain why we've waited for so long.We've been using Foundry 1.1.0 since the v2 contracts were released on May of this year. When Foundry 1.2.0 came out, it contained a bug on the Rust bindings generation command (
forge bind) that we realized would jeopardize our CI/CD pipeline. This bug was only fixed on Foundry 1.3.0, which was released in late July of this year. At that time, we were too busy drafting the v3 contracts, and had little incentive to bump Foundry. With the upcoming v2.1 release, we finally have a good reason to do the bump.Changes
In the commit history of this PR, you will notice that the Foundry bump is only the first of many changes. Besides Foundry, we have also bumped the Node.js dependencies (Cannon and Changesets CLIs) and Solidity. It is mostly to benefit from bug fixes, but there are some features worth highlighting:
forge lint(which runs onforge buildby default)Because of the new formatter back-end, you will notice some changes to the code format style. I have also turned on import sorting, for a more standardized order for imports.
Finally, I have written a JavaScript file that updates the Cannonfile version to match the Node.js package version. This script is run automatically on the CI every time it opens (or updates) a Changesets PR. This should remove the burden of having to update the Cannonfile version manually before every release.
If you run
forge buildlocally for the first time (orforge lintafter that), you should see some warnings relating to unused imports, formatting, etc. We can address those in another PR, as long as these changes don't introduce breaking changes to the public API of the contracts, as our focus is to release a 2.1 version of the contracts.