Skip to content
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

Release/2.12.0 ccip1.4 #1164

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b3d431c
core/services: fix ocrWrapper saveError contexts (#13139)
jmank88 May 8, 2024
40a16b4
Merge pull request #13151 from smartcontractkit/BCF-3221-ocr-wrapper-…
snehaagni May 8, 2024
33bd15d
changed spammy error log to debug (#13153)
patrickhuie19 May 9, 2024
19967d4
Merge pull request #13160 from smartcontractkit/release/2.12.0-log-fix
snehaagni May 9, 2024
5ce0eb2
Updating changelog for 2.12.0 with cherry pick fix
snehaagni May 9, 2024
3c10100
Merge pull request #13163 from smartcontractkit/chore/update_changelo…
snehaagni May 9, 2024
119df08
BCF-3225 - Implement forwarder fallback if forwarder not present as a…
ilija42 May 17, 2024
1d0b861
Merge pull request #13246 from smartcontractkit/BCF-3225-forwarders-f…
ilija42 May 20, 2024
d133da4
Fix panic on mercury server error (#13231) (#13256)
samsondav May 20, 2024
5daefad
Fixed CPU usage issues caused by inefficiencies in HeadTracker (#13230)
dhaidashenko May 17, 2024
de1503c
Merge branch 'release/2.12.0' into hotfix/BCI-3285-optimise-headtrack…
dhaidashenko May 20, 2024
fa33885
Merge pull request #13260 from smartcontractkit/hotfix/BCI-3285-optim…
snehaagni May 20, 2024
88a27f4
Update CHANGELOG for 2.12.0 bugfixes
snehaagni May 20, 2024
b38cb0c
Merge pull request #13264 from smartcontractkit/chore/update-release-…
snehaagni May 20, 2024
4fbcf7d
Decouple ChainType from config string [SHIP-2001] (#13272)
friedemannf May 23, 2024
9dc5e51
Merge pull request #13316 from smartcontractkit/cherrypick-c7a6356
snehaagni May 24, 2024
0abe09d
Index only the fifth word to reduce the db size overhead (#13315)
mateusz-sekara May 24, 2024
19e366b
Merge branch 'release/2.12.0' into release-2.12.2-beta-only-fifth-word
reductionista May 24, 2024
5e27b2f
Merge pull request #13327 from smartcontractkit/release-2.12.2-beta-o…
snehaagni May 25, 2024
8585cc9
Add special transmitter for OCR2 feeds (#13323)
ilija42 May 28, 2024
636c5e1
Improve ocr2FeedsTransmitter FromAddress() fallback (#13343)
ilija42 May 28, 2024
aad0d68
Merge pull request #13341 from smartcontractkit/2.12.0-cherry-pick-oc…
ilija42 May 28, 2024
dc74f20
Update 2.12.0 Changelog with bugfixes
snehaagni May 28, 2024
a06b2f2
Merge pull request #13347 from smartcontractkit/chore/release-2.12.0-…
snehaagni May 28, 2024
b95fe98
core/services/pipeline: bridge task must continue after cancellation
jmank88 May 31, 2024
7e536c1
Merge pull request #13388 from smartcontractkit/release2.12.0-fix-bri…
momentmaker May 31, 2024
d202837
core/services/pipeline: use request context for deletion (#13404)
jmank88 Jun 3, 2024
2cf506b
core/services/pipeline: hide deadline from monitor
jmank88 Jun 4, 2024
4f1cb37
Merge pull request #13410 from smartcontractkit/overtime-query-logs
snehaagni Jun 5, 2024
5204bf9
Finalize date on changelog for 2.12.0
snehaagni Jun 5, 2024
ef8a79c
Merge pull request #13434 from smartcontractkit/chore/update-release-…
snehaagni Jun 5, 2024
ededa5c
Bump version for CCIP 2.12.0-ccip1.4.16
mateusz-sekara Jun 14, 2024
ca19c40
Merge tag 'v2.12.0' into merge2.12-release
mateusz-sekara Jun 14, 2024
ad8b7f3
Bumping selectors and post merge fixes
mateusz-sekara Jun 14, 2024
b399007
Merge latest v2.12 into release branch (#1021)
RensR Jun 14, 2024
64352e9
zkSync L1 gas Price calculation oracle (#13498) (#1050) (#1056)
simsonraj Jun 19, 2024
572cc60
Added config options to control HeadTracker's support of finality tag…
mateusz-sekara Jun 20, 2024
a1308bc
Fix slice bounds out of range error in performBatchCall (#1145) (#1146)
0xnogo Jul 5, 2024
b4d400b
Returning messageVisibilityInterval always from commit roots cache (…
mateusz-sekara Jul 8, 2024
4440b29
Bump package json
mateusz-sekara Jul 8, 2024
9687442
Commit NewReportingPlugin retries on error
rstout Jul 9, 2024
60b20db
bump version to 1.4.19
dimkouv Jul 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/popular-stingrays-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ccip": patch
---

Fix slice bounds out of range error in performBatchCall. #bugfix
5 changes: 5 additions & 0 deletions .changeset/red-balloons-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ccip": patch
---

Commit NewReportingPlugin retries on error
7 changes: 7 additions & 0 deletions .changeset/sour-owls-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"chainlink": patch
---

Added config option `HeadTracker.FinalityTagBypass` to force `HeadTracker` to track blocks up to `FinalityDepth` even if `FinalityTagsEnabled = true`. This option is a temporary measure to address high CPU usage on chains with extremely large actual finality depth (gap between the current head and the latest finalized block). #added

Added config option `HeadTracker.MaxAllowedFinalityDepth` maximum gap between current head to the latest finalized block that `HeadTracker` considers healthy. #added
86 changes: 20 additions & 66 deletions CHANGELOG.md

Large diffs are not rendered by default.

117 changes: 93 additions & 24 deletions common/config/chaintype.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import (
"strings"
)

// ChainType denotes the chain or network to work with
type ChainType string

// nolint
const (
ChainArbitrum ChainType = "arbitrum"
ChainCelo ChainType = "celo"
Expand All @@ -18,11 +16,103 @@ const (
ChainOptimismBedrock ChainType = "optimismBedrock"
ChainScroll ChainType = "scroll"
ChainWeMix ChainType = "wemix"
ChainXDai ChainType = "xdai" // Deprecated: use ChainGnosis instead
ChainXLayer ChainType = "xlayer"
ChainZkSync ChainType = "zksync"
)

// IsL2 returns true if this chain is a Layer 2 chain. Notably:
// - the block numbers used for log searching are different from calling block.number
// - gas bumping is not supported, since there is no tx mempool
func (c ChainType) IsL2() bool {
switch c {
case ChainArbitrum, ChainMetis:
return true
default:
return false
}
}

func (c ChainType) IsValid() bool {
switch c {
case "", ChainArbitrum, ChainCelo, ChainGnosis, ChainKroma, ChainMetis, ChainOptimismBedrock, ChainScroll, ChainWeMix, ChainXLayer, ChainZkSync:
return true
}
return false
}

func ChainTypeFromSlug(slug string) ChainType {
switch slug {
case "arbitrum":
return ChainArbitrum
case "celo":
return ChainCelo
case "gnosis", "xdai":
return ChainGnosis
case "kroma":
return ChainKroma
case "metis":
return ChainMetis
case "optimismBedrock":
return ChainOptimismBedrock
case "scroll":
return ChainScroll
case "wemix":
return ChainWeMix
case "xlayer":
return ChainXLayer
case "zksync":
return ChainZkSync
default:
return ChainType(slug)
}
}

type ChainTypeConfig struct {
value ChainType
slug string
}

func NewChainTypeConfig(slug string) *ChainTypeConfig {
return &ChainTypeConfig{
value: ChainTypeFromSlug(slug),
slug: slug,
}
}

func (c *ChainTypeConfig) MarshalText() ([]byte, error) {
if c == nil {
return nil, nil
}
return []byte(c.slug), nil
}

func (c *ChainTypeConfig) UnmarshalText(b []byte) error {
c.slug = string(b)
c.value = ChainTypeFromSlug(c.slug)
return nil
}

func (c *ChainTypeConfig) Slug() string {
if c == nil {
return ""
}
return c.slug
}

func (c *ChainTypeConfig) ChainType() ChainType {
if c == nil {
return ""
}
return c.value
}

func (c *ChainTypeConfig) String() string {
if c == nil {
return ""
}
return string(c.value)
}

var ErrInvalidChainType = fmt.Errorf("must be one of %s or omitted", strings.Join([]string{
string(ChainArbitrum),
string(ChainCelo),
Expand All @@ -35,24 +125,3 @@ var ErrInvalidChainType = fmt.Errorf("must be one of %s or omitted", strings.Joi
string(ChainXLayer),
string(ChainZkSync),
}, ", "))

// IsValid returns true if the ChainType value is known or empty.
func (c ChainType) IsValid() bool {
switch c {
case "", ChainArbitrum, ChainCelo, ChainGnosis, ChainKroma, ChainMetis, ChainOptimismBedrock, ChainScroll, ChainWeMix, ChainXDai, ChainXLayer, ChainZkSync:
return true
}
return false
}

// IsL2 returns true if this chain is a Layer 2 chain. Notably:
// - the block numbers used for log searching are different from calling block.number
// - gas bumping is not supported, since there is no tx mempool
func (c ChainType) IsL2() bool {
switch c {
case ChainArbitrum, ChainMetis:
return true
default:
return false
}
}
22 changes: 18 additions & 4 deletions common/headtracker/head_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) Start(ctx context.Context) error
if ctx.Err() != nil {
return ctx.Err()
}
ht.log.Errorw("Error handling initial head", "err", err)
ht.log.Errorw("Error handling initial head", "err", err.Error())
}

ht.wgDone.Add(3)
Expand Down Expand Up @@ -337,9 +337,23 @@ func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) backfillLoop() {
// calculateLatestFinalized - returns latest finalized block. It's expected that currentHeadNumber - is the head of
// canonical chain. There is no guaranties that returned block belongs to the canonical chain. Additional verification
// must be performed before usage.
func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) calculateLatestFinalized(ctx context.Context, currentHead HTH) (h HTH, err error) {
if ht.config.FinalityTagEnabled() {
return ht.client.LatestFinalizedBlock(ctx)
func (ht *headTracker[HTH, S, ID, BLOCK_HASH]) calculateLatestFinalized(ctx context.Context, currentHead HTH) (latestFinalized HTH, err error) {
if ht.config.FinalityTagEnabled() && !ht.htConfig.FinalityTagBypass() {
latestFinalized, err = ht.client.LatestFinalizedBlock(ctx)
if err != nil {
return latestFinalized, fmt.Errorf("failed to get latest finalized block: %w", err)
}

if !latestFinalized.IsValid() {
return latestFinalized, fmt.Errorf("failed to get valid latest finalized block")
}

if currentHead.BlockNumber()-latestFinalized.BlockNumber() > int64(ht.htConfig.MaxAllowedFinalityDepth()) {
return latestFinalized, fmt.Errorf("gap between latest finalized block (%d) and current head (%d) is too large (> %d)",
latestFinalized.BlockNumber(), currentHead.BlockNumber(), ht.htConfig.MaxAllowedFinalityDepth())
}

return latestFinalized, nil
}
// no need to make an additional RPC call on chains with instant finality
if ht.config.FinalityDepth() == 0 {
Expand Down
2 changes: 2 additions & 0 deletions common/headtracker/types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ type HeadTrackerConfig interface {
HistoryDepth() uint32
MaxBufferSize() uint32
SamplingInterval() time.Duration
FinalityTagBypass() bool
MaxAllowedFinalityDepth() uint32
}
46 changes: 37 additions & 9 deletions common/txmgr/mocks/tx_manager.go

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

22 changes: 18 additions & 4 deletions common/txmgr/txmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ type TxManager[
services.Service
Trigger(addr ADDR)
CreateTransaction(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, TX_HASH]) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error)
GetForwarderForEOA(eoa ADDR) (forwarder ADDR, err error)
GetForwarderForEOA(ctx context.Context, eoa ADDR) (forwarder ADDR, err error)
GetForwarderForEOAOCR2Feeds(ctx context.Context, eoa, ocr2AggregatorID ADDR) (forwarder ADDR, err error)
RegisterResumeCallback(fn ResumeCallback)
SendNativeToken(ctx context.Context, chainID CHAIN_ID, from, to ADDR, value big.Int, gasLimit uint64) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error)
Reset(addr ADDR, abandon bool) error
Expand Down Expand Up @@ -545,11 +546,20 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) CreateTran
}

// Calls forwarderMgr to get a proper forwarder for a given EOA.
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetForwarderForEOA(eoa ADDR) (forwarder ADDR, err error) {
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetForwarderForEOA(ctx context.Context, eoa ADDR) (forwarder ADDR, err error) {
if !b.txConfig.ForwardersEnabled() {
return forwarder, fmt.Errorf("forwarding is not enabled, to enable set Transactions.ForwardersEnabled =true")
}
forwarder, err = b.fwdMgr.ForwarderFor(eoa)
forwarder, err = b.fwdMgr.ForwarderFor(ctx, eoa)
return
}

// GetForwarderForEOAOCR2Feeds calls forwarderMgr to get a proper forwarder for a given EOA and checks if its set as a transmitter on the OCR2Aggregator contract.
func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) GetForwarderForEOAOCR2Feeds(ctx context.Context, eoa, ocr2Aggregator ADDR) (forwarder ADDR, err error) {
if !b.txConfig.ForwardersEnabled() {
return forwarder, fmt.Errorf("forwarding is not enabled, to enable set Transactions.ForwardersEnabled =true")
}
forwarder, err = b.fwdMgr.ForwarderForOCR2Feeds(ctx, eoa, ocr2Aggregator)
return
}

Expand Down Expand Up @@ -646,9 +656,13 @@ func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Tri
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) CreateTransaction(ctx context.Context, txRequest txmgrtypes.TxRequest[ADDR, TX_HASH]) (etx txmgrtypes.Tx[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE], err error) {
return etx, errors.New(n.ErrMsg)
}
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetForwarderForEOA(addr ADDR) (fwdr ADDR, err error) {
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetForwarderForEOA(ctx context.Context, addr ADDR) (fwdr ADDR, err error) {
return fwdr, err
}
func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) GetForwarderForEOAOCR2Feeds(ctx context.Context, _, _ ADDR) (fwdr ADDR, err error) {
return fwdr, err
}

func (n *NullTxManager[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) Reset(addr ADDR, abandon bool) error {
return nil
}
Expand Down
6 changes: 5 additions & 1 deletion common/txmgr/types/forwarder_manager.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package types

import (
"context"

"github.com/smartcontractkit/chainlink-common/pkg/services"

"github.com/smartcontractkit/chainlink/v2/common/types"
)

//go:generate mockery --quiet --name ForwarderManager --output ./mocks/ --case=underscore
type ForwarderManager[ADDR types.Hashable] interface {
services.Service
ForwarderFor(addr ADDR) (forwarder ADDR, err error)
ForwarderFor(ctx context.Context, addr ADDR) (forwarder ADDR, err error)
ForwarderForOCR2Feeds(ctx context.Context, eoa, ocr2Aggregator ADDR) (forwarder ADDR, err error)
// Converts payload to be forwarder-friendly
ConvertPayload(dest ADDR, origPayload []byte) ([]byte, error)
}
Loading
Loading