Skip to content

Conversation

serpixel
Copy link
Contributor

@serpixel serpixel commented Oct 2, 2025

Description
Right now the artifacts get recompiled every time when using forge. This is an impediment to completing the forge migration.

  • Downgrade forge to 1.1.0
  • Avoid recompilation
  • Custom tar files
  • Switch compression method to zstd (10x reduction in filesize)

Tests

Additional context

Metadata

@serpixel serpixel requested review from a team as code owners October 2, 2025 15:08
@serpixel serpixel requested review from tynes and bitwiseguy and removed request for a team October 2, 2025 15:08
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.72%. Comparing base (c4edfa4) to head (f1e3270).
⚠️ Report is 6 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #17699      +/-   ##
===========================================
+ Coverage    74.31%   80.72%   +6.41%     
===========================================
  Files          172      117      -55     
  Lines        10955     6170    -4785     
===========================================
- Hits          8141     4981    -3160     
+ Misses        2670     1189    -1481     
+ Partials       144        0     -144     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests 80.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 55 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@serpixel serpixel force-pushed the feat/op-deployer/avoid-embedded-artifacts-recompilation branch from b7c348d to 3495f92 Compare October 2, 2025 15:35
@serpixel serpixel requested review from a team as code owners October 2, 2025 15:35
@serpixel serpixel requested review from stevennevins and ajsutton and removed request for a team October 2, 2025 15:35
@serpixel serpixel changed the base branch from ss/full-foundry-project to develop October 2, 2025 15:36
outFile = flag.String("out", "", "path to output tzst")
)

func main() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add some documentation (via small comment block) explaining what this program does. I'm curious what made you go with the golang program approach instead of via bash commands in the justfile as originally implemented. Maybe the tar cli command didn't provide enough configurability?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly zstd is not available through mise, we would need to ask anyone to install it on their OS using a package manager or recompile it. Using a go dependency is the less troublesome way to get zstd.

Comment on lines 11 to +18
copy-contract-artifacts:
rm -f ./pkg/deployer/artifacts/forge-artifacts/artifacts.tgz
tar -cvzf ./pkg/deployer/artifacts/forge-artifacts/artifacts.tgz -C ../packages/contracts-bedrock/forge-artifacts --exclude="*.t.sol" .
#!/bin/bash
set -euo pipefail

rm -f ./pkg/deployer/artifacts/forge-artifacts/artifacts.tzst
go run ./pkg/deployer/artifacts/cmd/mktar \
-base ../packages/contracts-bedrock \
-out ./pkg/deployer/artifacts/forge-artifacts/artifacts.tzst
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently there is a publish-contract-artifacts job in ci (ref). It expects to store a .tar.gz file type in our gcp bucket (ref). Seems like the filetype update would break that script and anything that expects to download .tar.gz files from that bucket). I'm not sure what downstream tools depend on downloading from that gcp bucket

Copy link
Contributor Author

@serpixel serpixel Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it seems that the script it calls, publish-artifacts.sh, does recompress the files itself so it wouldn't be breaking this. Same for pull-artifacts.sh, it's still also using gzip.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok got it. And op-deployer has code to decompress either file type so seems we're compatible with either on the op-deployer side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants