feat: harden indexing for production v1 - #1
Conversation
ae5116d to
08c18fb
Compare
|
I reviewed the commit with a focus on reorg handling, finality promotion, storage invariants, RPC hardening, and API security. Overall, I like the direction and the new canonical block model is a significant improvement. However, I found a few issues I would address before merging: High1. Canonical parent/child relationship is not enforced
This means a newly inserted block can theoretically become part of the canonical ledger without being connected to the previous canonical block. I would enforce this invariant transactionally in both PostgreSQL and MongoDB. 2. Finalized sink delivery has a crash window
So this sequence is possible:
This gives us a potential lost finalized event. I think finalized sink delivery needs a durable outbox / delivery state with retry semantics. Medium3. Rollback is height-based rather than block-identity-based Both adapters delete results using:
Now that result identity includes 4. The worker passes I'd rename this to 5. MongoDB is missing the equivalent promotion index Promotion queries:
Postgres has an index for this, but MongoDB appears to only index Minor
Positive notesThe following parts look particularly good:
So overall: strong architectural direction, but I would fix the canonical-chain invariant and finalized sink delivery semantics before merging. |
Summary
Verification
cargo fmt --all -- --checkgit diff --checkOperational follow-up
Before production rollout, revoke/rotate historical credentials, complete an encrypted off-host backup/restore drill with measured RPO/RTO, and configure ingress/TLS/rate-limit/egress policy.