Skip to content

feat(price-guard): move per-asset state from instance to persistent storage (#96) - #1147

Closed
jeffrey-graham wants to merge 1 commit into
DevTobis:mainfrom
jeffrey-graham:feat/price-guard-persistent-per-asset-state-96
Closed

jeffrey-graham wants to merge 1 commit into
DevTobis:mainfrom
jeffrey-graham:feat/price-guard-persistent-per-asset-state-96

Conversation

@jeffrey-graham

Copy link
Copy Markdown

Closes #96

Summary

  • Moves all per-asset PriceGuard keys (Config(asset), LastGood(asset), RollingReference(asset), RollingReferenceUpdated(asset), Halted(asset), PendingHaltValue(asset), IssuerPubKey(asset), NavRecord(asset), LastStatus(asset), and (Symbol("src_names"), asset)) from .instance() storage to .persistent() storage with ballast_common::ttl::extend_persistent on read and write.
  • Leaves only true contract-wide singletons (Roles, TimelockDataKey::NextId, and RequireNavSignature) in .instance() storage so the instance entry loaded on every invocation does not grow with the number of registered assets.
  • Adds a unit test registering 20 assets and asserting .instance() entry count remains constant, and documents the storage layout migration in contracts/README.md.

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.

Move PriceGuard per-asset state out of the single instance entry

1 participant