Skip to content

refactor(pxe): migrate CapsuleStore to BaseStagingStore - #101

Open
nchamo wants to merge 2 commits into
mainfrom
nchamo/capsule-store-base-staging
Open

refactor(pxe): migrate CapsuleStore to BaseStagingStore#101
nchamo wants to merge 2 commits into
mainfrom
nchamo/capsule-store-base-staging

Conversation

@nchamo

@nchamo nchamo commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Migrates CapsuleStore onto the BaseStagingStore, following refactor(pxe): migrate RecipientTaggingStore to BaseStagingStore #94 and refactor(pxe): migrate FactStore to BaseStagingStore #98. The base supplies the staging buffer, the operation lock and the commit/discard lifecycle; the Map<slot, Buffer | null> tombstone model carries over unchanged as the change set, and applyRollback is a no-op since capsules are not anchored to a block.
  • setCapsule and deleteCapsule become async, since every base-store operation goes through withChangeSet. This ripples to CapsuleService and UtilityExecutionOracle; the oracle dispatcher already awaits handler results, so the Noir boundary is unaffected.
  • Operations that read-modify-write an array (appendToCapsuleArray, setCapsuleArray, copyCapsule) no longer call the public setters from inside their own transaction, which would deadlock on the base's non-reentrant lock. They use private helpers instead, so each operation takes the lock exactly once.
  • Behavior-preserving: the on-disk kv schema is byte-identical. Three store tests drop out: two are now base behavior, and one needed two change sets open at once, which the base forbids.

@nchamo nchamo self-assigned this Aug 27, 2026
@nchamo nchamo added ci-draft Run CI on this draft PR ci-no-fail-fast Do not cancel remaining jobs on first failure labels Aug 27, 2026
@nchamo
nchamo marked this pull request as ready for review August 27, 2026 21:26
@nchamo
nchamo requested a review from nventuro August 27, 2026 21:26
@nchamo
nchamo changed the base branch from main to nchamo/fact-store-base-staging August 28, 2026 13:07
@nchamo
nchamo force-pushed the nchamo/capsule-store-base-staging branch from e7c4dd4 to f3a9b99 Compare August 28, 2026 20:04
Base automatically changed from nchamo/fact-store-base-staging to main August 28, 2026 21:17
@nventuro
nventuro force-pushed the nchamo/capsule-store-base-staging branch from f3a9b99 to 6130908 Compare August 28, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on this draft PR ci-no-fail-fast Do not cancel remaining jobs on first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant