chore: prepare release 0.24.0 - #463
Conversation
There was a problem hiding this comment.
Claude Code Review
Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.
Tip: disable this comment in your organization's Code Review settings.
d6a8e01 to
58cc6b8
Compare
58cc6b8 to
12fe7cc
Compare
There was a problem hiding this comment.
Claude Code Review
Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.
Tip: disable this comment in your organization's Code Review settings.
This PR was created automatically. Merging it will create a new release for 0.24.0
Breaking Changes
Support concurrent chain.Manager reads via MVCC snapshots
The Manager previously serialized all of its methods -- including read-only ones -- with a single mutex, so heavy read load (e.g. from the syncer or subscribers) contended with block processing. The Manager now follows an MVCC scheme: writes accumulate in the Store's "scratchpad" -- which includes the tip state -- and are committed by Flush, at which point they become visible to "snapshots": self-contained, read-only captures of the committed state. Read-only Manager methods operate on snapshots, so they proceed concurrently with each other and with block processing, and never stall writers. bbolt supports snapshots natively via read-only transactions;
MemDBnow implements them with pin-aware copy-on-flush generations (CacheDBdelegates to its underlying DB).This is a breaking change for implementors and consumers of the
chain.DBandchain.Storeinterfaces:Storeis nowSnapshot() (StoreSnapshot, func())+Scratchpad() StoreScratchpad.StoreSnapshotcarries the read methods plusTipState;StoreScratchpadembeds it and adds the write methods andFlush, withApplyBlock/RevertBlockupdating the scratchpad's tip. Implementations may flush autonomously between operations (e.g. to bound the size or age of the accumulated writes), handling errors internally; the Manager explicitly calls Flush to publish the new tip after processing blocks, before notifying OnReorg listeners.DBmirrorsStore:Snapshot() (DBSnapshot, release func())+Scratchpad() DBScratchpad. The scratchpad carriesBucket/CreateBucket/Flush/Canceland must not flush autonomously; snapshots are read-only and remain valid until released, even across concurrent Flushes. A singleDBBucketinterface serves both sides; itsPut/Deletemethods may return errors on read-only (snapshot) buckets.NewManagerno longer takes aconsensus.Stateparameter, andNewDBStore/NewDBStoreAtCheckpointno longer return one; the tip state is provided by the Store itself (via a snapshot's or scratchpad'sTipState).AddBlocksreturns and beforeOnReorglisteners fire, so subscribers observe the tip they are notified of.Fixes