What you’ll be able to do
- Monitor chain progress against your application.
- Recover interrupted operations using saved application records.
- Run recovery drills for outages, lost responses, and duplicate delivery.
Record the monitored configuration
Use the database from Verify and reconcile payments. Record the chain ID, endpoint label, token addresses, application contract addresses and ABI versions, signing account address, and selected gas token. Use endpoint labels in reports and keep credentials and signing keys in the application’s secret storage. Resolve protocol addresses through Contract addresses and application addresses through their deployment records. Verify code and configured permissions before enabling writes. Probe the methods required by the flow, includingeth_chainId, eth_getCode, eth_call, eth_getLogs,
eth_getTransactionReceipt, and consensus_status. Record access restrictions,
log-range limits, history availability, and timeout behavior on the endpoint.
Resolve failed checks before relying on the affected operation.
For each workflow, identify the evidence that establishes its completion. A
direct payment needs a finalized transfer to the intended recipient. A payment
using a MIP20 hold also needs its capture result. Shielded payments, Clearing
payments, and bridged payments need their procedure’s resolution, settlement,
or credit on the destination chain.
Compare chain progress with application progress
Compare the latest executed block, the latest finalized block, and the last block your application processed. The gap between execution and finality shows how many blocks await finalization. Processing lag is the number of finalized blocks your application still needs to process. If Metal has finalized block 100 and your application has processed through block 95, the processing lag is five blocks. Thesample function measures these gaps in blocks. Pass the full endpoint URL
and the saved cursor’s block number for the configured chain and token. Use the
cursor committed with the application’s database updates to measure completed
processing.
Verify the block hash stored with each cursor against the canonical block at
that height. A reset testnet can reuse a chain ID, so retain the network’s
genesis block hash with the deployment configuration and compare it on
reconnect. Reconcile a reset explicitly before replaying records from an older
chain.
Recover by the saved operation state
Load the saved instruction and transaction attempt from the database. Compare its chain ID, signing account, destination address, call data, token, amount, and transaction nonce with the intended operation. Read the receipt and canonical block from the same endpoint.
For an RPC timeout, missing transaction or
nonce too low response, follow the
uncertain-submission procedure
to resolve the original transaction before deciding whether another is needed.
Classify admission and execution failures using
Error codes and
Transactions. A deterministic policy rejection
requires correcting the instruction, policy or evidence before trying again.
Repeated execution failures can charge fees for each attempt.
Run controlled failure drills
Use dedicated test accounts and a processor database on persistent storage. Keep a known finalized payment and its receipt to test repeated processing. Simulate network failures with controlled RPC responses in the test process, and record which results came from those fixtures.
Pair the failure tests with the original finalized transaction and the
verification evidence retained by the processor.
Restore a consistent database backup
For the SQLite store, create a consistent snapshot outside an active write transaction.VACUUM INTO includes committed data from the database’s journal
and requires a destination file that does not already exist:
Produce the operational report
Record the configuration, observations and recovery results:- Chain ID and genesis hash, endpoint label, contract and ABI versions, and signing account roles.
- Capability probes with command, time, result, and access or history limits.
- Progress samples, alert thresholds, cursor hashes, and the last verified payment.
- Each drill’s trigger, expected result, observed database state, and retained transaction hash.
- Backup location and creation time, restored cursor, replay range, and comparison of application records.
- Missing services, unavailable proof artifacts, untested live paths, and the next action required to resolve each one.