Skip to content

Add finalized state check as optional interfaces to avoid breaking shared code#100

Merged
Krish-vemula merged 6 commits into
mainfrom
cre/PLEX-2476-v2
May 21, 2026
Merged

Add finalized state check as optional interfaces to avoid breaking shared code#100
Krish-vemula merged 6 commits into
mainfrom
cre/PLEX-2476-v2

Conversation

@Krish-vemula

@Krish-vemula Krish-vemula commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

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 NodeConfig or RPCClient interfaces. Instead, chains opt in by implementing optional interfaces:

  • FinalizedStateCheckConfig
  • FinalizedStateChecker

This keeps the framework generic and avoids forcing non-EVM chains, such as Solana, to add no-op boilerplate.

@github-actions

github-actions Bot commented Apr 13, 2026

Copy link
Copy Markdown

⚠️ API Diff Results - github.com/smartcontractkit/chainlink-framework/multinode

⚠️ Breaking Changes (2)

nodeMetrics (2)
  • IncrementFinalizedStateFailed — ➕ Added

  • IncrementNodeTransitionsToFinalizedStateNotAvailable — ➕ Added

✅ Compatible Changes (3)

./ (3)
  • ErrFinalizedStateUnavailable — ➕ Added

  • FinalizedStateCheckConfig — ➕ Added

  • FinalizedStateChecker — ➕ Added


📄 View full apidiff report

…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.
@Krish-vemula Krish-vemula marked this pull request as ready for review April 30, 2026 23:26
@Krish-vemula Krish-vemula requested a review from a team as a code owner April 30, 2026 23:26
Comment thread multinode/node_lifecycle.go
Comment thread multinode/node_lifecycle.go Outdated
lggr.Warnw("Finalized state still not available", "err", stateErr)
continue
}
lggr.Warnw("Finalized state check failed with RPC error", "err", stateErr)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with this one. Should we use error log when it's an error we're not expecting?

@Krish-vemula Krish-vemula requested a review from dhaidashenko May 12, 2026 17:10
Comment thread multinode/node_lifecycle.go Outdated
Comment thread multinode/node_lifecycle.go Outdated
localHighestChainInfo, _ := n.rpc.GetInterceptedChainInfo()
var pollFailures uint32

// Finalized state availability check via optional interfaces

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add reasonning for why we decided to go with optional interfaces?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread multinode/node_lifecycle_test.go Outdated
Comment thread multinode/rpc_client_base.go Outdated
Comment thread multinode/node_lifecycle.go
@Krish-vemula Krish-vemula requested a review from dhaidashenko May 14, 2026 06:25
@Krish-vemula Krish-vemula requested a review from amit-momin May 21, 2026 15:48
@Krish-vemula Krish-vemula merged commit 26d78d5 into main May 21, 2026
24 checks passed
@Krish-vemula Krish-vemula deleted the cre/PLEX-2476-v2 branch May 21, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants