Label: complexity: high
Points: 200
Description
If an off-chain indexer misses events (downtime, RPC issues), there's no on-chain way to "replay" historical state for a given invoice beyond manually re-fetching the audit log, which doesn't carry full payment amounts/structured data.
Technical Context
Involves lib.rs — replay_invoice_events(env, invoice_id), re-emitting invoice_created, each historical payment_received (from invoice.payments), and the current status event (invoice_released/invoice_refunded if applicable) in sequence, allowing an indexer to resync by calling this once and rebuilding state from the replayed event stream.
Acceptance Criteria
Label: complexity: high
Points: 200
Description
If an off-chain indexer misses events (downtime, RPC issues), there's no on-chain way to "replay" historical state for a given invoice beyond manually re-fetching the audit log, which doesn't carry full payment amounts/structured data.
Technical Context
Involves
lib.rs—replay_invoice_events(env, invoice_id), re-emittinginvoice_created, each historicalpayment_received(frominvoice.payments), and the current status event (invoice_released/invoice_refundedif applicable) in sequence, allowing an indexer to resync by calling this once and rebuilding state from the replayed event stream.Acceptance Criteria
payment_received-equivalent event per entry ininvoice.payments, in original orderinvoice.statusif not stillPendingreplay: truetopic marker) so indexers can distinguish them from live events and avoid double-countingcargo clippypasses with zero warnings