Skip to content

Xiong/sync remote#9

Merged
louisliu2048 merged 167 commits intodevfrom
xiong/sync-remote
Nov 3, 2025
Merged

Xiong/sync remote#9
louisliu2048 merged 167 commits intodevfrom
xiong/sync-remote

Conversation

@louisliu2048
Copy link
Copy Markdown
Collaborator

No description provided.

mattsse and others added 30 commits September 8, 2025 23:27
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…uced (paradigmxyz#18276)

Co-authored-by: julio4 <30329843+julio4@users.noreply.github.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
…xes (paradigmxyz#18140)

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Federico Gimenez <federico.gimenez@gmail.com>
…ocation + benchmark (paradigmxyz#18072)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
MozirDmitriy and others added 25 commits September 23, 2025 09:03
…NodePrimitives (paradigmxyz#18626)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Brian Picciano <me@mediocregopher.com>
…radigmxyz#18635)

Co-authored-by: Alexey Shekhirin <5773434+shekhirin@users.noreply.github.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Signed-off-by: Delweng <delweng@gmail.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
@louisliu2048 louisliu2048 merged commit 7a8731a into dev Nov 3, 2025
@louisliu2048 louisliu2048 deleted the xiong/sync-remote branch November 19, 2025 09:09
louisliu2048 pushed a commit that referenced this pull request Mar 24, 2026
…ap checklist

Complete implementation of the MPT WAL-First gap checklist (10 items) plus
additional sei-db alignment fixes identified during review.

WAL subsystem (#1):
- Segment-based binary WAL (bincode, mptwal02 format) with CRC32 checksums
- Record header contains version field for O(1) scan without deserialization
- Segment-aware prune/truncate (delete whole segments, rewrite only boundary)
- Corrupted tail detection and recovery on append
- Single fsync per append (removed redundant meta.json fsync)

Snapshot rewrite (#2):
- Per-block incremental publish_generation in persist worker (keeps L3 hot)
- Periodic full rewrite via separate published-rewrite worker thread
- Pre-built segments from materializer's in-memory state (avoids disk reload)
- Staged activation: compact/prune before meta activation (atomic boundary)
- Retry mechanism for dropped rewrite jobs (pending_rewrite tracking)

Backpressure (#3):
- max_durable_lag / max_published_lag config fields
- wait_for_backpressure() blocks frontend commit when lag exceeds threshold
- 60s timeout with warning on backpressure wait

Seek-best-snapshot (#4):
- seek_best_snapshot_version() finds max(snapshot) <= target
- WAL chain validation before replay attempt
- Clear error messages with snapshot version and WAL range

WAL auto-cleanup (#5):
- Auto prune_before after each set_durable_version in both worker paths
- Floor = min(manifest.earliest, published.earliest_snapshot)

Replay parallelism (#6):
- Aggressive parallelism thresholds during replay (storage_tries_min=4)
- Batch WAL pre-fetch (64 entries per batch, amortizes lock + IO)

Temp cleanup (#7): already done by codex

account_root independent (#8):
- CommitWalEntry.account_root now explicitly passed, not copied from state_root

WAL upgrade field (#9):
- CommitWalUpgrade struct (key/value pairs) for schema migrations
- CommitWalEntry.upgrades field (empty for normal commits)

Snapshot rate limiting (#10):
- IoRateLimiter token bucket for background snapshot writes
- snapshot_write_rate_mb_per_sec config (default 0 = unlimited)

COW Arena:
- MutableTrieArena rewritten with frozen base (Arc) + overlay (HashMap)
- clone() is O(1) for frozen base, O(overlay) for mutations
- freeze() uses Arc::make_mut for in-place patch when strong_count=1
- set_committed_base drops old base before snapshot() to ensure O(overlay) freeze

Additional sei-db alignment:
- SetInitialVersion API with validation (version==0, fresh DB)
- nextVersion jump logic matching sei-db's nextVersionU32
- LoadForOverwriting: pre-open truncation (manifest + WAL + published)
- Graceful error recovery: published baseline errors are non-fatal (warn only)
- MemoryStats for in-memory node tracking
- Lazy published view refresh in apply_bundle_state
- Published rewrite timeout (configurable, default 60s)

B4.5 profile (1M accounts, 10 blocks × 5K updates):
- mpt-db per-block: ~370ms (vs reth ~1290ms) = ~3.5x faster
- account_root: ~28ms (COW freeze working correctly)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.