Repository navigation
refactor(storage): extract shared FWSS storage - #608
Conversation
| 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 $@ |
There was a problem hiding this comment.
Does this fix the issue we've been having where it gets bricked?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Why don't you use --no-cache?
There was a problem hiding this comment.
--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
left a comment
There was a problem hiding this comment.
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.
| // Each one of these variables is stored in its own storage slot and | ||
| // corresponds to the layout defined in | ||
| // FilecoinWarmStorageServiceLayout.sol. |
There was a problem hiding this comment.
The layout is not defined in FilecoinWarmStorageServiceLayout.sol. It is defined here.
wjmelements
left a comment
There was a problem hiding this comment.
I don't think we're gonna need layout files after we get rid of filecoin warm storage view
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
DataSetInfoandPlannedUpgradestructs into the shared abstractFWSSStoragecontractprivatetointernalfor inherited accesscontract names of the moved structs
preserve existing generated files if generation fails
PlannedUpgrade.internalTypein the generated ABI; tuple and eventencoding remain unchanged
Part of #614