Refactor storage into four per-phase structs to fix Yul stack-too-deep - #10
Merged
Merged
Conversation
Replace per-auction flat mappings with four scoped storage structs: ClockPhaseState, ProxyPhaseState, AllocationPhaseState, SettlementPhaseState. Each library function now receives only the struct(s) it needs, reducing simultaneous live stack variables below the Yul 16-slot limit. Also fixes test_SubmitBundle_WrongAuctionIdInBundle regression by adding explicit auctionId validation in CPAProxyPhase._isValidBundle. https://claude.ai/code/session_01ETwaVj9w3YcML7GDGavvjU
…tics The test was ported from V4 (which tracked lastOversoldTick) to non-V4 without correctly adapting the price-reversion assertion. When the clock phase ends with an undersold asset, revertUndersoldPrices() sets its price back to lastOversoldPrice (the price before the round that caused oversell), not the incremented price. Update the assertion and comments accordingly. https://claude.ai/code/session_01ETwaVj9w3YcML7GDGavvjU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
CPAStoragewith four scoped per-phase storage structs:ClockPhaseState,ProxyPhaseState,AllocationPhaseState,SettlementPhaseStateCPAClock6Decimals.t.solstack-too-deep compilation errorauctionIdvalidation inCPAProxyPhase._isValidBundle(fixes regression intest_SubmitBundle_WrongAuctionIdInBundle)NumeraireLibfor native ETH support in all numeraire transfersTest plan
forge buildcompiles cleanly with no errorsforge test— 136/138 tests pass (1 pre-existing failure:test_RevertUndersoldPriceslogic issue predating this PR)CPAClock6Decimalstests pass (was the failing suite)test_SubmitBundle_WrongAuctionIdInBundlepasseshttps://claude.ai/code/session_01ETwaVj9w3YcML7GDGavvjU
Generated by Claude Code