Closed arthurgousset closed 2 months ago
Sometimes it's useful to know the bytecode size of core contracts. This PR adds scripts calculate that in two ways:
Writes the output to the console and to csv files in the scripts/bash/out/ directory (which is gitignored).
scripts/bash/out/
package.json
README.md
Nit: Linting in README.md file
[x] Example run size:onchain
size:onchain
$ yarn size:onchain # ... StableTokenEUR,0x434563B0604BE100F04B7Ae485BcafE3c9D8850E,9.180 Validators,0xe52EaC18fB3C1e1713e73d4A5b7dCb12a2f2C697,58.228 Data extraction complete. Results saved to /Users/arthur/Documents/celo-org/celo-monorepo/packages/protocol/out/onchain_bytecode_sizes_20240509_145556.csv ✨ Done in 19.15s.
[x] Example run size:artifacts
size:artifacts
$ yarn size:artifacts # ... ReleaseGold,31.721 OdisPaymentsProxy,2.868 Data extraction complete. Results saved to /Users/arthur/Documents/celo-org/celo-monorepo/packages/protocol/scripts/bash/out/build_artefact_bytecode_sizes_20240509_151111.csv ✨ Done in 9.57s.
[x] CSV output for both scripts looks good 👍
[x] Output in out/ is gitignored
out/
Yes, backwards compatible. The new scripts can be used on-demand, but don't interfere with any existing flows.
Yes, added documentation to the README.md file.
Description
Sometimes it's useful to know the bytecode size of core contracts. This PR adds scripts calculate that in two ways:
Writes the output to the console and to csv files in the
scripts/bash/out/
directory (which is gitignored).Changes
package.json
README.md
Other changes
Nit: Linting in
README.md
fileTested
[x] Example run
size:onchain
[x] Example run
size:artifacts
[x] CSV output for both scripts looks good 👍
[x] Output in
out/
is gitignoredRelated issues
Backwards compatibility
Yes, backwards compatible. The new scripts can be used on-demand, but don't interfere with any existing flows.
Documentation
Yes, added documentation to the
README.md
file.