Add finalized state check as optional interfaces to avoid breaking shared code#100
Conversation
|
…ared code # Conflicts: # multinode/node_test.go
Move this field out of the shared MultiNode struct to avoid imposing it on chains that don't use finalized state checking (e.g. Solana). The EVM side provides this value through its own NodePool config, and the framework's optional FinalizedStateCheckConfig interface handles the type assertion in node_lifecycle.go.
2c72bb8 to
de28b86
Compare
| lggr.Warnw("Finalized state still not available", "err", stateErr) | ||
| continue | ||
| } | ||
| lggr.Warnw("Finalized state check failed with RPC error", "err", stateErr) |
There was a problem hiding this comment.
Same with this one. Should we use error log when it's an error we're not expecting?
| localHighestChainInfo, _ := n.rpc.GetInterceptedChainInfo() | ||
| var pollFailures uint32 | ||
|
|
||
| // Finalized state availability check via optional interfaces |
There was a problem hiding this comment.
Could you add reasonning for why we decided to go with optional interfaces?
There was a problem hiding this comment.
finalized-state probing is EVM-only, but multinode is shared putting it on RPCClient / NodeConfig would force non-EVM consumers (e.g. Solana) into boilerplate + review for code they do not use. Optional FinalizedStateCheckConfig + FinalizedStateChecker keeps it opt-in. I added a brief note in aliveLoop and on those two types now.
…se no-op, gate threshold on poll interval
Summary
Adds optional multinode support for detecting RPC nodes that cannot serve historical state at the latest finalized block.
This reintroduces the finalized-state availability check without adding new requirements to the shared
NodeConfigorRPCClientinterfaces. Instead, chains opt in by implementing optional interfaces:FinalizedStateCheckConfigFinalizedStateCheckerThis keeps the framework generic and avoids forcing non-EVM chains, such as Solana, to add no-op boilerplate.