You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chain_bridge: wrap RPC calls with retry logic for robustness
This commit enhances the reliability of chain operations by wrapping
key RPC calls to lnd with the new RetryFuncN retry logic. This change
addresses issues users face when running with load-balanced LND setups
where different backend nodes may temporarily return inconsistent or
unavailable data.
The following RPC operations now include automatic retry with
exponential backoff:
- GetBlock: Fetches full block data by hash
- GetBlockHeader: Retrieves block headers by hash
- GetBlockHash: Gets block hash at a specific height
- CurrentHeight: Queries the current blockchain height
- GetBlockTimestamp: Internal hash lookup for timestamps
- PublishTransaction: Broadcasts transactions to the network
- EstimateFee: Queries fee estimates for confirmation targets
Each operation uses the default retry configuration with 3 retry
attempts, 100ms initial backoff, 2x backoff multiplier, and 5s maximum
backoff. This provides a good balance between quick failure detection
and tolerance for transient issues.
Note that streaming/subscription RPCs like RegisterConfirmationsNtfn
and RegisterBlockEpochNtfn are not wrapped as they require persistent
connections that cannot be simply retried.
0 commit comments