Bug Fixes
Polygon anchoring operations were getting permanently stuck when the writer's local previousRoot diverged from the on-chain DataRegistry contract state. Every submitRoot call would revert with InvalidPreviousRoot, and the recovery system couldn't unstick the pipeline.
The writer now detects this revert, syncs the contract's expected previousRoot as ground truth, resyncs the nonce manager from the chain's pending state, and retries automatically (up to 3 times). Failed batches that became stranded are re-enqueued and driven through the normal anchoring flow. The contract is now the authoritative source for recovery logic.
This resolves production incidents where Polygon anchoring could be blocked indefinitely by state divergence.