Skip to content

Commit

Permalink
No new finalized Heads Implementation (#13907)
Browse files Browse the repository at this point in the history
* No new finalized Heads Implementation

* fixed tests

* update defaults for NoNewFinalizedHeadsThreshold

* Update common/client/node_lifecycle.go

Co-authored-by: amit-momin <[email protected]>

* Update common/client/node_lifecycle_test.go

Co-authored-by: amit-momin <[email protected]>

* Update common/client/node_lifecycle_test.go

Co-authored-by: amit-momin <[email protected]>

* rename HeadIsNotIncreasing to NoNewHead

* move and add docs for syncIssue consts

* rename syncIssue to syncStatus

---------

Co-authored-by: amit-momin <[email protected]>
  • Loading branch information
dhaidashenko and amit-momin authored Jul 30, 2024
1 parent 7147653 commit 1eaf5e0
Show file tree
Hide file tree
Showing 55 changed files with 1,452 additions and 339 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-seals-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Added new health check that ensures RPC provides new finalized heads at least every `NoNewFinalizedHeadsThreshold` #added
194 changes: 136 additions & 58 deletions common/client/mock_node_client_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

138 changes: 136 additions & 2 deletions common/client/mock_rpc_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions common/client/mocks/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package mocks
import "time"

type ChainConfig struct {
IsFinalityTagEnabled bool
FinalityDepthVal uint32
NoNewHeadsThresholdVal time.Duration
FinalizedBlockOffsetVal uint32
IsFinalityTagEnabled bool
FinalityDepthVal uint32
NoNewHeadsThresholdVal time.Duration
FinalizedBlockOffsetVal uint32
NoNewFinalizedHeadsThresholdVal time.Duration
}

func (t ChainConfig) NodeNoNewHeadsThreshold() time.Duration {
Expand All @@ -24,3 +25,7 @@ func (t ChainConfig) FinalityTagEnabled() bool {
func (t ChainConfig) FinalizedBlockOffset() uint32 {
return t.FinalizedBlockOffsetVal
}

func (t ChainConfig) NoNewFinalizedHeadsThreshold() time.Duration {
return t.NoNewFinalizedHeadsThresholdVal
}
Loading

0 comments on commit 1eaf5e0

Please sign in to comment.