-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
latest finalized block metrics (#12339)
* Add LatestFinalizedBlock to HeadTracker * Added LatestFinalizedHead to Head * remove unused func * fix flakey nil pointer * improve logs & address lint issue * nitpicks * fixed copy on heads on MarkFinalized * error instead of panic * return error instead of panic * nitpicks * Finalized block based history depth * simplify trimming * nit fixes * fix build issues caused by merge * regen * FIx rpc client mock generation * nit fixes * nit fixes * update comments * ensure that we trim redundant blocks both in slice and in chain in Heads handle corner case for multiple uncle blocks at the end of the slice * nit fix * Update common/headtracker/head_tracker.go Co-authored-by: Dimitris Grigoriou <[email protected]> * HeadTracker backfill test with 0 finality depth * latest finalized block metrics * changelog & go generate fix * move nodeConfig back into the test pkg * rollback fields renaming * nit * changeset * removed unused func * Set default value for FinalizedBlockPollInterval * updated docs --------- Co-authored-by: Dimitris Grigoriou <[email protected]>
- Loading branch information
1 parent
2e3248e
commit 96d2fe1
Showing
34 changed files
with
607 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"chainlink": minor | ||
--- | ||
|
||
Add the `pool_rpc_node_highest_finalized_block` metric that tracks the highest finalized block seen per RPC. If `FinalityTagEnabled = true`, a positive `NodePool.FinalizedBlockPollInterval` is needed to collect the metric. If the finality tag is not enabled, the metric is populated with a calculated latest finalized block based on the latest head and finality depth. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package mocks | ||
|
||
import ( | ||
"time" | ||
|
||
commonconfig "github.com/smartcontractkit/chainlink/v2/common/config" | ||
) | ||
|
||
type ChainConfig struct { | ||
IsFinalityTagEnabled bool | ||
FinalityDepthVal uint32 | ||
NoNewHeadsThresholdVal time.Duration | ||
ChainTypeVal commonconfig.ChainType | ||
} | ||
|
||
func (t ChainConfig) ChainType() commonconfig.ChainType { | ||
return t.ChainTypeVal | ||
} | ||
|
||
func (t ChainConfig) NodeNoNewHeadsThreshold() time.Duration { | ||
return t.NoNewHeadsThresholdVal | ||
} | ||
|
||
func (t ChainConfig) FinalityDepth() uint32 { | ||
return t.FinalityDepthVal | ||
} | ||
|
||
func (t ChainConfig) FinalityTagEnabled() bool { | ||
return t.IsFinalityTagEnabled | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.