feat(wallet-toolbox): add prepared BEEF fast path - #506
Merged
Conversation
BraydenLangley
force-pushed
the
codex/prepared-beef-cook
branch
from
September 1, 2026 01:30
d913d59 to
090c92f
Compare
BraydenLangley
force-pushed
the
codex/prepared-beef-cook
branch
6 times, most recently
from
September 1, 2026 02:28
68ddfca to
178727b
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
BraydenLangley
force-pushed
the
codex/prepared-beef-cook
branch
from
September 1, 2026 03:11
178727b to
64857f4
Compare
BraydenLangley
marked this pull request as ready for review
September 1, 2026 03:29
BraydenLangley
requested review from
sirdeggen,
tonesnotes and
ty-everett
as code owners
September 1, 2026 03:29
…o codex/prepared-beef-cook # Conflicts: # docs/packages/wallet/wallet-toolbox-mobile.md # docs/reference/package-api-migrations.md # governance/package-release-notes.json # packages/wallet/wallet-toolbox/CHANGELOG.md # packages/wallet/wallet-toolbox/client/README.md # packages/wallet/wallet-toolbox/client/platform-budget.json # packages/wallet/wallet-toolbox/mobile/platform-budget.json # packages/wallet/wallet-toolbox/src/storage/StorageKnex.ts # packages/wallet/wallet-toolbox/src/storage/methods/createAction.ts # packages/wallet/wallet-toolbox/src/storage/schema/KnexMigrations.ts
ty-everett
approved these changes
Sep 2, 2026
|
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.



Program and scope
createActionlatency optimization; no public issue was provided.0cc390359dc193b79b704ac3f2a3be2894a53d19.Impact
Affected packages remain in the existing unpublished
2.11.0minor release:@bsv/wallet-toolbox: prepared-BEEF options, Knex persistence, coordinator, read path, migration, and security controls.@bsv/wallet-toolbox-clientand@bsv/wallet-toolbox-mobile: shared sync hardening and platform-budget accounting; IndexedDB/mobile storage remains canonical-only.What changed
preparedBeef; a prepared BEEF is already reduced, verified, serialized, checksummed, stored, and ready to merge.createActionandprocessActionfinish foreground result assembly before queuing identifiers and never await proof reload, graph traversal, verification, serialization, or persistence.maxLookupBytes(2 MiB by default). Calls above 32 roots also bypass.prepared_beefsandprepared_beef_metadatatables. A transactionally advanced proof epoch fences in-flight worker writes across processes.Security and correctness hardening
proven_txsauthority without server verification. The server parses the raw transaction and Merkle path, recomputes txid/root, checks height and leaf position, and matches the active header and chain tracker.EntityProvenTx.mergeExisting. A candidate preflighted as a new insert cannot become an unvalidated replacement if another process inserts the txid before the merge transaction.unconfirmed; an oversized no-sendinputBEEFis rejected before load or parse.{userId, rootTxids}identifiers, enforces global and per-user admission (32/4 by default), and rejects source graphs over byte/transaction limits before verification or serialization.Proof epoch and read isolation
The proof epoch fences background writes, not ordinary reads. A lookup begun after invalidation commits cannot read an old ready artifact. A lookup overlapping that transaction may observe the preceding database snapshot and is ordered before invalidation, as the canonical proof builder may be. Copying the epoch into each artifact does not strengthen a same-snapshot read where both metadata and artifact belong to the previous snapshot. Reorg notification adds the separate synchronous local read gate so new requests do not wait for database invalidation to acquire locks.
Verification
Local validation across the final change series (the final helper-only refactor was rerun through build, lint, and its 36 focused tests):
git diff --check: passed.33647784347: completed successfully for this head, including build/lint/typecheck, full affected tests and coverage, wallet browser/mobile platform contracts, exact-head Sonar zero-findings, CodeQL, dependency review, conformance, Socket, Codecov patch coverage at 90.49%, and merge-gate checks.Coverage includes prepared hit/fallback/corruption, async foreground timing, real
processActionwarming, root-count and aggregate-byte lookup bypass, identifier-only queue retention, per-user fairness,unconfirmedsource rejection before BEEF load, authenticated proof rejection/acceptance/replacement, stale direct-sync rejection, lowercase canonicalization, replacement authorization at the entity boundary, immediate reorg fencing/failure recovery, parameterized slice behavior, migration, and purge behavior.Release and operations
All COOK flags default off. MySQL/PXC evidence remains a hard rollout gate because this host does not expose a deployment-equivalent MySQL/PXC test environment:
prepared_beefs.beefisLONGBLOB, and exercise insert/upsert, lookup, aggregate byte preflight, invalidation, and rebuild.This is not a merge blocker while the feature remains default-off, but it is a documented hard gate before production activation. Rollback is to disable read/write/backfill. Derived rows may remain; before downgrading to code that cannot advance the epoch, remove the prepared-BEEF tables or data.