-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No new finalized Heads Implementation #13907
No new finalized Heads Implementation #13907
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit on sync issue naming, but looks good.
Co-authored-by: amit-momin <108959691+amit-momin@users.noreply.github.com>
Co-authored-by: amit-momin <108959691+amit-momin@users.noreply.github.com>
Co-authored-by: amit-momin <108959691+amit-momin@users.noreply.github.com>
…hub.com:smartcontractkit/chainlink into feature/BCI-3731-no-new-finalized-block-develop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
//n.stateMu.Lock() | ||
//n.healthCheckSubs = append(n.healthCheckSubs, sub) | ||
//n.stateMu.Unlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these placeholders?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, after merging the BCI-2875 result.sub = sub
will be replaced with
n.stateMu.Lock()
n.healthCheckSubs = append(n.healthCheckSubs, sub)
n.stateMu.Unlock()
if !n.onNewHead(lggr, &localHighestChainInfo, head) { | ||
continue | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can you add a one-line comment here to quickly explain how we use bitwise operators? i.e. "We clear NoNewHead sync issue, after receiving a new head and check for out of sync." or something along these lines. It took me some time to figure out what is going on, without context.
common/client/models.go
Outdated
type syncIssue int | ||
|
||
const ( | ||
// syncIssueNotInSyncWithPool - RPC is lagging behind the highest block observed within the pool of RPCs | ||
syncIssueNotInSyncWithPool syncIssue = 1 << iota | ||
// syncIssueNoNewHead - RPC failed to produce a new head for too long | ||
syncIssueNoNewHead | ||
// syncIssueNoNewFinalizedHead - RPC failed to produce a new finalized head for too long | ||
syncIssueNoNewFinalizedHead | ||
syncIssueLen | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does changing syncIssue
to syncStatus
and adding synced
state as 0 work, or does it mess up the enumeration incrementation? I noticed in outOfSyncLoop
we use a 0 value instead of an enum value because of this.
…hub.com:smartcontractkit/chainlink into feature/BCI-3731-no-new-finalized-block-develop
Quality Gate passedIssues Measures |
* No new finalized Heads Implementation * fixed tests * update defaults for NoNewFinalizedHeadsThreshold * Update common/client/node_lifecycle.go Co-authored-by: amit-momin <108959691+amit-momin@users.noreply.github.com> * Update common/client/node_lifecycle_test.go Co-authored-by: amit-momin <108959691+amit-momin@users.noreply.github.com> * Update common/client/node_lifecycle_test.go Co-authored-by: amit-momin <108959691+amit-momin@users.noreply.github.com> * rename HeadIsNotIncreasing to NoNewHead * move and add docs for syncIssue consts * rename syncIssue to syncStatus --------- Co-authored-by: amit-momin <108959691+amit-momin@users.noreply.github.com>
## Motivation Cherry-pick of smartcontractkit/chainlink#14021 cherry-pick of smartcontractkit/chainlink#13957 cherry-pick of smartcontractkit/chainlink#13876 cherry-pick of smartcontractkit/chainlink#13907
* No new finalized Heads Implementation * fixed tests * update defaults for NoNewFinalizedHeadsThreshold * Update common/client/node_lifecycle.go Co-authored-by: amit-momin <108959691+amit-momin@users.noreply.github.com> * Update common/client/node_lifecycle_test.go Co-authored-by: amit-momin <108959691+amit-momin@users.noreply.github.com> * Update common/client/node_lifecycle_test.go Co-authored-by: amit-momin <108959691+amit-momin@users.noreply.github.com> * rename HeadIsNotIncreasing to NoNewHead * move and add docs for syncIssue consts * rename syncIssue to syncStatus --------- Co-authored-by: amit-momin <108959691+amit-momin@users.noreply.github.com>
NoNewFinalizedHeadsThreshold
Explanation of methodology to define
NoNewFinalizedHeadsThreshold
is available hereDefault values were only set for chains that have
FinalityTagEnabled = true
for CCIP andNoNewHeadsThreshold > 0
.