feat(archive): add state archive prototype implementation - #54
Draft
bladehan1 wants to merge 159 commits into
Draft
feat(archive): add state archive prototype implementation#54bladehan1 wants to merge 159 commits into
bladehan1 wants to merge 159 commits into
Conversation
Capture canonical block metadata and materialize reverse diffs from completed block snapshots. Classify archive state stores explicitly and project account-asset companion mutations before root merge.
Add deterministic history body and index records, ordered durable commit markers, and bounded asynchronous persistence. Gate checkpoint advancement on committed archive history and cover crash, corruption, backpressure, and reorg behavior.
Persist reverse state history with bounded append-only body, index, and commit structures. Wire an opt-in archive writer into snapshot flush and add restart-safe account change indexing. Expose an experimental historical account balance endpoint for trace comparison.
Persist bounded restart checkpoints, truncation recovery, H/C/D/R progress authorities, and immutable serving generations. Pin committed history resources and fail closed on identity or durability drift.
Add durable engine identities and native LevelDB/RocksDB snapshot leases. Assemble exact Store generations under the SnapshotManager barrier and release partial acquisitions on authority drift.
Apply business mutations with participant progress in native sync batches. Freshly validate H/C/D authorities under the archive barrier and advance reader visibility only after exact convergence.
Unify LevelDB and RocksDB participants behind one recovery contract. Persist canonical mutation plans and bind checkpoint, participant, and reader progress to the same digest.
Collect exact ordinary and AccountAsset post-state without Store scans. Enforce target identity, bounded ownership, one-shot sealing, abort, and terminal payload release.
Drive an exact-27 capture batch through mixed native participants, inject a partial apply failure, and verify durable-plan replay, digest propagation, ownership, and restart convergence.
Apply two capture-produced targets through exact-27 participants. Verify per-target plan digests, overwrite and delete semantics, partial replay boundaries, reader publication, and restart convergence.
Prepare one target-bound Account and AccountAsset projection before snapshot merge, retain its forward payload through the revoking lifecycle, and seal it only against durable history markers. Keep the integration default-off and preserve the existing proposal 66 physical layout.
Classify ABI as mutable auxiliary metadata outside the versioned state participant set while retaining an explicit tombstone classification.
Exercise proposal-bound projection, layer-to-flush ownership, durable marker sealing, retry and reorg boundaries, exact participant coverage, and ABI exclusion.
Expose durable marker receipt creation through direct and asynchronous history sinks, then gate forward payload sealing on the exact committed flush range. Retain submitted frozen ranges across durability or receipt failures so retries do not resubmit history.
Verify direct and asynchronous receipt authority, disabled behavior, and retry ordering across durable wait and receipt failures without duplicate history submission.
rename private F/N/M keyspace constants to describe flat state, trie nodes, and metadata while preserving their persisted byte values.
Avoid rebuilding a full materialized-node index when compacting retained trie snapshots. Fail deferred capture on worker errors and bound producer waits so a dead worker cannot stall block synchronization.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Simplify common path state preparation and fail stop on required artifact errors. Append finalized history before checkpoint flush while retaining common publication authority. Preserve published durability markers during startup recovery and retain frame locations instead of all history payloads to avoid archive reopen heap exhaustion.
Reuse prepared encoded nodes when rebasing retained PathState snapshots and preserve root checks and native read accounting. Add finalized archive append timing and checkpoint continuation coverage.
Expose explicit block-final stages with lightweight session commit. Sample account node reads, hash verification, decoding and native reads behind an opt-in flag, and export prepared-attempt metrics with bounded labels.
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.
What does this PR do?
Adds the current State Archive, PathState, state-root, Chainbase RocksDB, recovery, serving-index, and observability implementation to the origin/develop-based comparison branch. The branch history was rebuilt so the 18 local
.helpergovernance files are not tracked or present in Git history.Why are these changes required?
This provides a reviewable comparison point for the State Archive prototype while keeping local execution governance and evidence files outside the product branch.
This PR has been tested by:
sh .helper/ai-archive/execution/scripts/check_workspace.shpython3 .helper/ai-archive/execution/scripts/check_workspace_links.py --allgit diff --checkgit rev-list HEAD -- .helperreturns zeroFollow up
Complete the remaining prototype review, recovery, serving-worker, performance, capacity, and production-operation gates under the local State Archive execution contracts.
Extra details
This Draft PR targets
feature/archive_compare_base, which was created fromorigin/develop. Repository workflows filtered todevelop,master, orrelease_*are therefore not selected by this base branch; GitHub may still run generic pull-request-target review automation.Summary by cubic
Adds the opt-in State Archive prototype on
feature/archive_compare_base, cut fromorigin/develop. It's off by default, so existing current-store execution keeps its behavior.State Archive
chainbaseadds durable checkpoint WAL history, restart recovery with H/C/D/R progress authorities, engine-identity snapshot leases, partitioned history body lanes for account, storage-row, account-asset, and delegation, an exact-27 serving-key index, and an async archive writer sink.Path state and tooling
build.gradleallows RocksDB version pinning and a Java 17 override; the 18 local.helpergovernance files are intentionally untracked.Written for commit 59fb272. Summary will update on new commits.