refactor(worker): remove AsmState umbrella, persist AnchorState directly - #3
Open
vladb-ai wants to merge 2 commits into
Open
refactor(worker): remove AsmState umbrella, persist AnchorState directly#3vladb-ai wants to merge 2 commits into
vladb-ai wants to merge 2 commits into
Conversation
AsmState bundled an AnchorState with the STF's log entries, but the anchor state DB only ever persisted the AnchorState — the logs live in the manifest store. Every read re-joined the two back into an AsmState. That re-join existed to feed the Moho worker, which now reads logs from the manifest store directly (get_anchor_logs), so the umbrella no longer serves any production path; it only backed the RPC status and two integration tests. Store and thread AnchorState throughout the worker and runner, and have the tests that need logs read them from the recorded manifest (block-keyed, so it stays correct across reorgs) rather than a state-carried copy.
🔒 AI Security ReviewNo security issues found. This PR is a pure mechanical refactor: it removes the Reviewed for the standard categories (injection, auth/access control, crypto/secrets, memory/integer safety, unsafe error handling, DoS) — none apply here:
No findings to report. |
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.
Description
AsmStatebundled anAnchorStatewith the STF's log entries, but the anchor-state DB only ever persisted theAnchorState— the logs live in the manifest store. Every read re-joined the two back into anAsmState. That re-join existed to feed the Moho worker, which now reads logs from the manifest store directly (get_anchor_logs), so the umbrella no longer serves any production path; it only backed the RPC status (via a deadlogs()helper) and two integration tests.This removes the type: the worker and runner store and thread
AnchorStatedirectly, and the tests that need logs read them from the recorded manifest (block-keyed, so it stays correct across reorgs) rather than a state-carried copy.Note:
AsmWorkerStatus.cur_state(returned by the RPCget_status) changes shape — it is now anAnchorStaterather than anAsmStatewrapping{state, logs}. Nothing in this repo read those status logs.Type of Change
Notes to Reviewers
Stacked on alpenlabs#169 (it uses the typed
WorkerErrorvariants), so this PR is based onrefactor/worker-typed-errorsand should merge after it. Rebase ontomainonce alpenlabs#169 lands.The re-join it removes was added to fix a real bug (a re-committed anchor silently dropping a block's export entries, desyncing the persisted MohoState); that path is now covered by the Moho worker reading logs from the manifest store directly, so the invariant is preserved.
Checklist