Compact storage layouts + O(1) feeder/signer membership + paginated positions - #152
Merged
dami-005 merged 2 commits intoSep 30, 2026
Merged
Conversation
…eeder/signer O(1) membership, paginated user positions - options_market: PositionStatus enum replaces is_exercised/is_settled bools on OptionPosition (Zenith-options#103) - options_market: Config/Stats structs consolidate hot instance reads and counters (Zenith-options#102) - options_market: paginated UserPositionPage index replaces unbounded per-user Vec<u64> (Zenith-options#100) - price_oracle: IsFeeder(Address) persistent membership map replaces Vec::contains scan (Zenith-options#101) - multisig: IsSigner(Address) persistent membership map replaces Vec::contains scan (Zenith-options#101) lib.rs/storage.rs/types.rs/test.rs for these crates were previously wiped to 0 bytes by earlier merges on main, so this adds the storage/types layer fresh rather than migrating existing entries; no V1 layout exists in the tree to benchmark against or migrate from. Closes Zenith-options#100 Closes Zenith-options#101 Closes Zenith-options#102 Closes Zenith-options#103
|
@Inkman007 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…rage-layer # Conflicts: # multisig/src/lib.rs # multisig/src/types.rs
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
options_market:PositionStatusenum (Open/Exercised/Settled/Refunded) replaces theis_exercised/is_settledbools onOptionPosition([High] CompactOptionPositionandOptionSeriesStorage Layouts #103)options_market: consolidatedConfig/Statsstructs replace separate instance reads and single-counter entries ([High] Cut Resource Fees on Hot Paths: Cache Instance Reads and Remove Redundant Writes #102)options_market: paginatedUserPositionPageindex (64 ids/page) replaces the unbounded per-userVec<u64>— O(1) append instead of rewriting the whole history each trade ([High] Replace UnboundedUserPositionsVec with a Paginated Index #100)price_oracle:IsFeeder(Address)persistent membership map replacesVec::containsscans;Feedersmoved from instance to persistent storage for enumeration only ([High] Move Feeder and Signer Lists Out of Instance Storage #101)multisig: same pattern,IsSigner(Address)([High] Move Feeder and Signer Lists Out of Instance Storage #101)Note on scope
lib.rs,storage.rs,types.rs, andtest.rsforoptions_market,price_oracle, andmultisigare currently empty (0 bytes) onmain— wiped by earlier merges unrelated to this PR. There's no existing V1 layout or contract entrypoints in the tree to migrate from, benchmark against, or wire these into right now, so this PR adds the storage/types layer on its own with dedicated unit tests, rather than the full migration + resource-benchmark deliverable the issues originally describe against a working contract. Flagging this so it's not mistaken for a complete resolution of the underlying intent — happy to follow up once the wiped contract logic is restored.Validation performed
cargo test --libgreen in all three crates (8/8 tests passing)cargo fmt --checkcleanCloses #100
Closes #101
Closes #102
Closes #103