Skip to content

refactor(storage): extract shared FWSS storage - #608

Merged
wjmelements merged 3 commits into
refactor/fwss-modular-dispatchfrom
refactor/storage-layer
Sep 23, 2026
Merged

wjmelements merged 3 commits into
refactor/fwss-modular-dispatchfrom
refactor/storage-layer

Conversation

@CodeWarriorr

@CodeWarriorr CodeWarriorr commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Future ERC-8167 delegates will execute against the existing FWSS proxy storage. They
need one compiler-visible definition of the legacy layout so they can access existing
state without redeclaring fields in each module.

This PR separates that storage change from dispatcher and module work.

What changed

  • Moved all 24 FWSS application storage fields and the stored DataSetInfo and
    PlannedUpgrade structs into the shared abstract FWSSStorage contract
  • Updated FWSS to inherit the storage contract and changed moved fields from
    private to internal for inherited access
  • Kept the existing layout snapshot stable by normalizing only the declaring
    contract names of the moved structs
  • Updated layout generation to rerun when the shared storage contract changes and
    preserve existing generated files if generation fails
  • Updated PlannedUpgrade.internalType in the generated ABI; tuple and event
    encoding remain unchanged

Part of #614

@FilOzzy FilOzzy added this to FOC Sep 16, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Sep 16, 2026
@FilOzzy FilOzzy moved this from 📌 Triage to 🔎 Awaiting review in FOC Sep 16, 2026
forge inspect --json $< storageLayout | jq -f $(LAYOUT_SNAPSHOT_JQ) > $@
$(LAYOUT_JSON): src/FilecoinWarmStorageService.sol src/storage/FWSSStorage.sol $(LAYOUT_SNAPSHOT_JQ)
bash -o pipefail -c 'forge inspect --out out/storage-layout --cache-path cache/storage-layout --json $< storageLayout | jq -f $(LAYOUT_SNAPSHOT_JQ) > "$@.tmp"'
mv $@.tmp $@

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this fix the issue we've been having where it gets bricked?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think so. This change isolates storage-layout generation from the normal build artifacts and cache. It writes to a temporary file, lets errors propagate, and only replaces the final file on success. I think the normal build and storage-layout artifacts were clashing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why don't you use --no-cache?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

--force might also achieve the goal

I don't want duplicate cache folders. If we go that way though, need to add them to the .gitignore.

@Kubuxu Kubuxu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SGTM, but I'd like Will to approve whenever he has time (things are a bit chaotic given Solstice).
One comment: the storage/README.md is currently a confusing mix of the state-of-the-world description and instructions for an LLM doing the extraction. It could be either significantly trimmed or improved to be more useful.

@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC Sep 17, 2026
Comment on lines +31 to +33
// Each one of these variables is stored in its own storage slot and
// corresponds to the layout defined in
// FilecoinWarmStorageServiceLayout.sol.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The layout is not defined in FilecoinWarmStorageServiceLayout.sol. It is defined here.

@wjmelements wjmelements left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we're gonna need layout files after we get rid of filecoin warm storage view

@wjmelements
wjmelements merged commit 87f3491 into refactor/fwss-modular-dispatch Sep 23, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Sep 23, 2026
@wjmelements
wjmelements deleted the refactor/storage-layer branch September 23, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

4 participants