Skip to content

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

Open
Krish-vemula wants to merge 3 commits intomainfrom
cre/PLEX-2476-v2
Open

Add finalized state check as optional interfaces to avoid breaking shared code#100
Krish-vemula wants to merge 3 commits intomainfrom
cre/PLEX-2476-v2

Conversation

@Krish-vemula
Copy link
Copy Markdown
Contributor

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

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
Copy link
Copy Markdown

github-actions Bot commented Apr 13, 2026

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

⚠️ Breaking Changes (2)

nodeMetrics (2)
  • IncrementFinalizedStateFailed — ➕ Added

  • IncrementNodeTransitionsToFinalizedStateNotAvailable — ➕ Added

✅ Compatible Changes (5)

./ (3)
  • ErrFinalizedStateUnavailable — ➕ Added

  • FinalizedStateCheckConfig — ➕ Added

  • FinalizedStateChecker — ➕ Added

(*RPCClientBase[HEAD]) (2)
  • CheckFinalizedStateAvailability — ➕ Added

  • CheckFinalizedStateAvailability — ➕ 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
n.metrics.IncrementPollsFailed(ctx, n.name)
pollFailures++
}
lggr.Warnw("Finalized state check failed with RPC error", "err", stateErr, "pollFailures", pollFailures)
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.

Wouldn't we want this to be an error log?

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?

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.

2 participants