Skip to content

refactor(pxe): introduce openPxeStores factory for backing sub-stores#23028

Merged
Thunkar merged 1 commit into
nextfrom
claudebox/8a13135d95b87e96-6
May 7, 2026
Merged

refactor(pxe): introduce openPxeStores factory for backing sub-stores#23028
Thunkar merged 1 commit into
nextfrom
claudebox/8a13135d95b87e96-6

Conversation

@AztecBot

@AztecBot AztecBot commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Land the openPxeStores(store, initialBlockHash) factory on next. Originally introduced on merge-train/fairies as part of #22872 (pxe db schema compatibility test); porting just the factory + its pxe.ts caller is the right fix to converge both branches and stop the recurring next → merge-train/fairies merge-train conflict at the source.

Diff

  • add yarn-project/pxe/src/storage/open_pxe_stores.ts (49 lines, byte-identical to the fairies copy). Defines the PxeStores return type and the factory that constructs the canonical set of sub-stores PXE opens against the backing KV store.
  • modify yarn-project/pxe/src/pxe.ts: replace the inline new AddressStore(store) / ... / new L2TipsKVStore(store, 'pxe', initialBlockHash) block inside PXE.create with a destructure off openPxeStores(store, initialBlockHash). Drop the now-unused L2TipsKVStore import. Local variable name aligns with the factory return (l2TipsStore); class field is unchanged.

vs next: 2 files, +65/-14. vs merge-train/fairies for these two files: empty (byte-identical).

Why

Greg's call — the factory is the desired direction. After this lands on next, the next merge-next.sh run (next → merge-train/fairies) auto-merges these files with zero conflicts. The pxe-db schema-compatibility test that lives on fairies (and uses openPxeStores for inventory snapshotting) regains its intended invariant — pxe.ts actually goes through the factory.

Scope

Only the production factory + pxe.ts caller. The full schema-compatibility test suite (backwards_compatibility_tests/) stays on fairies for now; bringing it over is a separate decision.

Details: https://gist.github.com/AztecBot/23b7603e153bcd7687a60de6bcc32b7e

ClaudeBox log: https://claudebox.work/s/8a13135d95b87e96?run=6

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels May 7, 2026
@Thunkar Thunkar requested a review from benesjan May 7, 2026 09:47
@Thunkar Thunkar marked this pull request as ready for review May 7, 2026 09:48
@Thunkar Thunkar added this pull request to the merge queue May 7, 2026
Merged via the queue into next with commit c8ad9c0 May 7, 2026
47 of 53 checks passed
@Thunkar Thunkar deleted the claudebox/8a13135d95b87e96-6 branch May 7, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants