Add configurable historical balance health check for finalized block#420
Add configurable historical balance health check for finalized block#420Krish-vemula wants to merge 3 commits into
Conversation
|
# Conflicts: # go.mod # go.sum
e3f870c to
cb8d39b
Compare
| return | ||
| } | ||
| if p.FinalizedBlockPollInterval.Duration() <= 0 { | ||
| } else if p.FinalizedBlockPollInterval.Duration() <= 0 { |
There was a problem hiding this comment.
I understand why you've removed return. But not sure why you've added else if instead of if
There was a problem hiding this comment.
I used else if so we never call Duration() when the interval is nil. A second standalone if would need an explicit p.FinalizedBlockPollInterval != nil guard; else if encodes that same dependency without duplicating the check.
| } | ||
| } | ||
| if p.FinalizedStateCheckFailureThreshold != nil && *p.FinalizedStateCheckFailureThreshold > 0 { | ||
| if p.Errors.FinalizedStateUnavailable == nil || *p.Errors.FinalizedStateUnavailable == "" { |
There was a problem hiding this comment.
Follow the example of TooManyResults. Right now, you are not setting the default for FinalizedStateUnavailable
There was a problem hiding this comment.
Added fix for this, can you verify if its good
Re-implement the finalized state availability check (originally PR #352) on top of the updated chainlink-framework that uses optional interfaces instead of modifying core NodeConfig/RPCClient interfaces. This avoids forcing unrelated chains (e.g. Solana) to implement boilerplate methods.
Summary
Implements the EVM finalized-state availability check used by multinode.
The check verifies that an RPC can serve historical state at the latest finalized block by calling
BalanceAtfor a configurable probe address. The check is disabled by default and only runs whenFinalizedStateCheckFailureThreshold > 0.Changes
HistoricalBalanceCheckAddressFinalizedStateCheckFailureThresholdErrors.FinalizedStateUnavailable0x0000000000000000000000000000000000000000CheckFinalizedStateAvailabilityon the EVM RPC client.finalizedtag whenFinalityTagEnabled = truelatest - FinalityDepthwhenFinalityTagEnabled = falseBalanceAtat the selected finalized block.multinode.ErrFinalizedStateUnavailable.