bug(node): mailbox ack compaction overwrites the identity WAL with envelope records, destroying the identity log on restart
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
Start with the ack path in src/http_relay.rs and WAL compaction in src/s3_wal_maintenance.rs, then trace identity replay in src/storage.rs. Separate the identity and envelope WAL schemas, ensure appends are synced before acknowledgment, and restore both data types during startup replay. Add a regression test for ack, compaction, and restart; done when identities remain intact and queued envelopes are restored.
Written by the indexing model from the issue text.
Description
Context
Full-ecosystem production-readiness audit (2026-11-18). The mailbox-ack path reuses the identity WAL file for envelope records, mixing two incompatible line schemas in kt_log.wal. Milestone 6 (#6, status::review) claims durable WAL recovery; in reality the ack path actively destroys the identity log.
Symptom and mechanism (evidence)
POST /v1/relay/mailboxes/{id}/ackcallscompact_wal_file(wal, &active)wherewalis the identity WAL path (src/http_relay.rs:189-192), andcompact_wal_filerewrites that same file with the surviving envelope records in a second, incompatible schema (src/s3_wal_maintenance.rs:14-39).- On restart,
replay_wal_into_logtries to parse every line as an identityWalEntry(src/storage.rs:53-67); the envelope lines fail,load_wal_entriesreturnsErr, andunwrap_or_default()atsrc/storage.rs:122silently discards the entire identity log (DIDs and key commitments). - The compacted envelopes are never reloaded into the
MailboxStoreeither — replay only reconstructs identities (src/storage.rs:114-143), so envelope data compacted during ack is lost as well.
Impact
High: after any mailbox ack followed by a container restart, all registered identity state vanishes. This is a silent data-loss path in the core node, currently reachable in the deployed sandbox configuration.
Acceptance criteria
- Separate WAL files per domain (identities vs. relay envelopes) — one file, one schema.
-
fsync(sync_all) on WAL append before acknowledging the write. - Replay reconstructs both identities and queued envelopes on startup.
- Regression test: ack → compaction → restart → identity log intact and envelopes restored (this exact scenario is untested today; the existing compaction test uses a separate file,
tests/milestone10_node_test.rs:153-180).
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- Avg merge
- 4m
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from alfonsodg/sonaraim-node
-
bug(node): SigV4 presign date applies the epoch offset twice — media uploads can never validateOpenarea::node effort::s impact::medium priority::medium source::auto status::review type::bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
alfonsodg/sonaraim-node#29 · 1 comment ·
-
area::node effort::xs impact::low priority::low source::auto status::review type::docs
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
alfonsodg/sonaraim-node#28 · 1 comment ·
-
area::node effort::s impact::medium priority::low source::auto status::review type::docs
Difficulty 3/5 1-2 days Newbie friendliness 72/100
alfonsodg/sonaraim-node#27 · 1 comment ·
-
area::node effort::m impact::medium priority::medium source::user status::review type::refactor
Difficulty 1/5 Under an hour Newbie friendliness 20/100
alfonsodg/sonaraim-node#26 · 1 comment ·
-
area::node effort::m impact::high priority::medium source::auto status::review type::bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
alfonsodg/sonaraim-node#25 · 2 comments ·
All issues in alfonsodg/sonaraim-node
Similar issues
-
O-windows relnotes relnotes-needs-review relnotes-tracking-issue T-libs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
marketing
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Maintainers usually reply within 1 day
-
num_ode_rk4_adaptive rejects atol = 0 while accepting rtol = 0 and while num_ode_dopri5 accepts bothOpenarea/ode-pde good first issue help wanted kind/contract severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Apich-Organization/rssn#383 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 1 day
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day