Skip to content

Commit 57453f3

Browse files
authored
Merge pull request #23199 from smartcontractkit/hot-fixes-for-2-55-6
Hot fixes for 2 55 6
2 parents f482dbc + 69d8cd3 commit 57453f3

36 files changed

Lines changed: 468 additions & 507 deletions

File tree

core/capabilities/ccip/oraclecreator/plugin.go

Lines changed: 80 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ var _ cctypes.OracleCreator = &pluginOracleCreator{}
5656
const (
5757
defaultCommitGasLimit = 500_000
5858
defaultExecGasLimit = 6_500_000
59+
60+
// readerWriterCreationTimeout bounds the per-chain contract reader/writer creation,
61+
// binding, and startup during oracle creation.
62+
// Applied per chain, so it must stay small: a DON can span many chains and the timeout
63+
// is spent serially in the worst case. 10s matches the other blockchain-facing timeouts
64+
// in defaultLocalConfig and rpctimeout.Default.
65+
readerWriterCreationTimeout = 10 * time.Second
5966
)
6067

6168
// pluginOracleCreator creates oracles that reference plugins running
@@ -684,76 +691,87 @@ func (i *pluginOracleCreator) createReadersAndWriters(
684691
extendedReaders := make(map[cciptypes.ChainSelector]contractreader.Extended)
685692
chainWriters := make(map[cciptypes.ChainSelector]types.ContractWriter)
686693
for relayID, relayer := range i.relayers {
687-
chainID := relayID.ChainID
688-
relayChainFamily := relayID.Network
689-
chainDetails, err1 := chainsel.GetChainDetailsByChainIDAndFamily(chainID, relayChainFamily)
690-
chainSelector := cciptypes.ChainSelector(chainDetails.ChainSelector)
691-
if err1 != nil {
692-
return nil, nil, nil, fmt.Errorf("failed to get chain selector from chain ID %s: %w", chainID, err1)
693-
}
694-
695-
cr, err1 := crcw.GetChainReader(ctx, ccipcommon.ChainReaderProviderOpts{
696-
Lggr: i.lggr,
697-
Relayer: relayer,
698-
ChainID: chainID,
699-
DestChainID: destChainID,
700-
HomeChainID: homeChainID,
701-
Ofc: ofc,
702-
ChainSelector: chainSelector,
703-
ChainFamily: relayChainFamily,
704-
DestChainFamily: destChainFamily,
705-
Transmitters: i.transmitters,
706-
})
707-
if err1 != nil {
708-
// Some Chain family might not need crcw to be created, and if createChainAccessorsAndContractTransmitters will catch error if it does
709-
i.lggr.Debugf("skipping creating reader and writers for chain %s, reader creation: %v", chainID, err1)
710-
continue
711-
}
694+
if err := func() error {
695+
// Bound each chain's reader/writer creation with its own deadline so an unavailable
696+
// chain LOOPP fails fast instead of blocking the launcher context
697+
// forever.
698+
chainCtx, cancel := context.WithTimeout(ctx, readerWriterCreationTimeout)
699+
defer cancel()
700+
701+
chainID := relayID.ChainID
702+
relayChainFamily := relayID.Network
703+
chainDetails, err1 := chainsel.GetChainDetailsByChainIDAndFamily(chainID, relayChainFamily)
704+
chainSelector := cciptypes.ChainSelector(chainDetails.ChainSelector)
705+
if err1 != nil {
706+
return fmt.Errorf("failed to get chain selector from chain ID %s: %w", chainID, err1)
707+
}
712708

713-
if chainID == destChainID && destChainFamily == relayChainFamily {
714-
offrampAddress := destAddrStr
715-
err2 := cr.Bind(ctx, []types.BoundContract{
716-
{
717-
Address: offrampAddress,
718-
Name: consts.ContractNameOffRamp,
719-
},
709+
cr, err1 := crcw.GetChainReader(chainCtx, ccipcommon.ChainReaderProviderOpts{
710+
Lggr: i.lggr,
711+
Relayer: relayer,
712+
ChainID: chainID,
713+
DestChainID: destChainID,
714+
HomeChainID: homeChainID,
715+
Ofc: ofc,
716+
ChainSelector: chainSelector,
717+
ChainFamily: relayChainFamily,
718+
DestChainFamily: destChainFamily,
719+
Transmitters: i.transmitters,
720720
})
721-
if err2 != nil {
722-
return nil, nil, nil, fmt.Errorf("failed to bind chain reader for dest chain %s's offramp at %s: %w", chainID, offrampAddress, err2)
721+
if err1 != nil {
722+
// Some Chain family might not need crcw to be created, and if createChainAccessorsAndContractTransmitters will catch error if it does
723+
i.lggr.Debugf("skipping creating reader and writers for chain %s, reader creation: %v", chainID, err1)
724+
return nil
723725
}
724-
}
725726

726-
if err2 := cr.Start(ctx); err2 != nil {
727-
return nil, nil, nil, fmt.Errorf("failed to start contract reader for chain %s: %w", chainID, err2)
728-
}
727+
if chainID == destChainID && destChainFamily == relayChainFamily {
728+
offrampAddress := destAddrStr
729+
err2 := cr.Bind(chainCtx, []types.BoundContract{
730+
{
731+
Address: offrampAddress,
732+
Name: consts.ContractNameOffRamp,
733+
},
734+
})
735+
if err2 != nil {
736+
return fmt.Errorf("failed to bind chain reader for dest chain %s's offramp at %s: %w", chainID, offrampAddress, err2)
737+
}
738+
}
729739

730-
cw, err1 := crcw.GetChainWriter(ctx, ccipcommon.ChainWriterProviderOpts{
731-
ChainID: chainID,
732-
Relayer: relayer,
733-
Transmitters: i.transmitters,
734-
ExecBatchGasLimit: execBatchGasLimit,
735-
CommitEvmBatchGasLimit: commitEvmGasLimit,
736-
ChainFamily: relayChainFamily,
737-
OfframpProgramAddress: config.Config.OfframpAddress,
738-
})
739-
if err1 != nil {
740-
// Some Chain family might not need crcw to be created, and if createChainAccessorsAndContractTransmitters will catch error if it does
741-
i.lggr.Debugf("skipping creating chain writer for chain %s, writer creation: %v", chainID, err1)
742-
continue
743-
}
740+
if err2 := cr.Start(chainCtx); err2 != nil {
741+
return fmt.Errorf("failed to start contract reader for chain %s: %w", chainID, err2)
742+
}
744743

745-
if err4 := cw.Start(ctx); err4 != nil {
746-
return nil, nil, nil, fmt.Errorf("failed to start chain writer for chain %s: %w", chainID, err4)
747-
}
744+
cw, err1 := crcw.GetChainWriter(chainCtx, ccipcommon.ChainWriterProviderOpts{
745+
ChainID: chainID,
746+
Relayer: relayer,
747+
Transmitters: i.transmitters,
748+
ExecBatchGasLimit: execBatchGasLimit,
749+
CommitEvmBatchGasLimit: commitEvmGasLimit,
750+
ChainFamily: relayChainFamily,
751+
OfframpProgramAddress: config.Config.OfframpAddress,
752+
})
753+
if err1 != nil {
754+
// Some Chain family might not need crcw to be created, and if createChainAccessorsAndContractTransmitters will catch error if it does
755+
i.lggr.Debugf("skipping creating chain writer for chain %s, writer creation: %v", chainID, err1)
756+
return nil
757+
}
748758

749-
extendedCr, err := wrapContractReaderInObservedExtended(i.lggr, cr, chainSelector)
750-
if err != nil {
751-
return nil, nil, nil, fmt.Errorf("failed to wrap contract reader for chain %s: %w", chainID, err)
752-
}
759+
if err4 := cw.Start(chainCtx); err4 != nil {
760+
return fmt.Errorf("failed to start chain writer for chain %s: %w", chainID, err4)
761+
}
762+
763+
extendedCr, err := wrapContractReaderInObservedExtended(i.lggr, cr, chainSelector)
764+
if err != nil {
765+
return fmt.Errorf("failed to wrap contract reader for chain %s: %w", chainID, err)
766+
}
753767

754-
contractReaders[chainSelector] = cr
755-
extendedReaders[chainSelector] = extendedCr
756-
chainWriters[chainSelector] = cw
768+
contractReaders[chainSelector] = cr
769+
extendedReaders[chainSelector] = extendedCr
770+
chainWriters[chainSelector] = cw
771+
return nil
772+
}(); err != nil {
773+
return nil, nil, nil, err
774+
}
757775
}
758776
return contractReaders, extendedReaders, chainWriters, nil
759777
}
17.1 KB
Binary file not shown.
Binary file not shown.

core/capabilities/vault/vaultutils/json_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func TestToCanonicalJSON_OmitsEmptyFields(t *testing.T) {
6363
withEmptyFields, err := ToCanonicalJSON(msg, false)
6464
require.NoError(t, err)
6565
assert.JSONEq(t, `{
66+
"requestId":"",
6667
"responses":[{"id":{"owner":"owner","namespace":"main","key":"secret1"},"success":true,"error":""}]
6768
}`, string(withEmptyFields))
6869

@@ -83,7 +84,7 @@ func TestToCanonicalJSON_OmitsEmptyFields(t *testing.T) {
8384

8485
withEmptyFields, err := ToCanonicalJSON(msg, false)
8586
require.NoError(t, err)
86-
assert.JSONEq(t, `{"responses":[]}`, string(withEmptyFields))
87+
assert.JSONEq(t, `{"requestId":"","responses":[]}`, string(withEmptyFields))
8788

8889
canonicalJSON, err := ToCanonicalJSON(msg, true)
8990
require.NoError(t, err)
@@ -100,7 +101,7 @@ func TestToCanonicalJSON_OmitsEmptyFields(t *testing.T) {
100101

101102
withEmptyFields, err := ToCanonicalJSON(msg, false)
102103
require.NoError(t, err)
103-
assert.JSONEq(t, `{"responses":[]}`, string(withEmptyFields))
104+
assert.JSONEq(t, `{"requestId":"","responses":[]}`, string(withEmptyFields))
104105

105106
canonicalJSON, err := ToCanonicalJSON(msg, true)
106107
require.NoError(t, err)

core/scripts/go.mod

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ require (
2727
github.com/andybalholm/brotli v1.2.1
2828
github.com/avast/retry-go/v4 v4.7.0
2929
github.com/c-bata/go-prompt v0.2.6
30-
github.com/ethereum/go-ethereum v1.17.3
30+
github.com/ethereum/go-ethereum v1.17.4
3131
github.com/gkampitakis/go-snaps v0.5.19
3232
github.com/google/go-cmp v0.7.0
3333
github.com/google/uuid v1.6.0
@@ -47,7 +47,7 @@ require (
4747
github.com/smartcontractkit/chain-selectors v1.0.104
4848
github.com/smartcontractkit/chainlink-automation v0.8.1
4949
github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260624154507-ea7ff77a0ddb
50-
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260701091216-9264d4444ce0
50+
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260713194119-2689c5708c8b
5151
github.com/smartcontractkit/chainlink-common/keystore v1.2.0
5252
github.com/smartcontractkit/chainlink-data-streams v0.1.15-0.20260522094612-5f9f748bd87a
5353
github.com/smartcontractkit/chainlink-deployments-framework v0.111.1-0.20260612191326-e31c0ae4cd54
@@ -253,6 +253,7 @@ require (
253253
github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b // indirect
254254
github.com/felixge/httpsnoop v1.0.4 // indirect
255255
github.com/ferranbt/fastssz v0.1.4 // indirect
256+
github.com/fjl/jsonw v0.1.0 // indirect
256257
github.com/fsnotify/fsevents v0.2.0 // indirect
257258
github.com/fsnotify/fsnotify v1.10.1 // indirect
258259
github.com/fvbommel/sortorder v1.1.0 // indirect
@@ -448,11 +449,10 @@ require (
448449
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
449450
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
450451
github.com/pierrec/lz4/v4 v4.1.26 // indirect
451-
github.com/pion/dtls/v2 v2.2.12 // indirect
452-
github.com/pion/logging v0.2.2 // indirect
453-
github.com/pion/stun/v2 v2.0.0 // indirect
454-
github.com/pion/transport/v2 v2.2.10 // indirect
455-
github.com/pion/transport/v3 v3.0.1 // indirect
452+
github.com/pion/dtls/v3 v3.1.2 // indirect
453+
github.com/pion/logging v0.2.4 // indirect
454+
github.com/pion/stun/v3 v3.1.2 // indirect
455+
github.com/pion/transport/v4 v4.0.1 // indirect
456456
github.com/pkg/term v1.2.0-beta.2 // indirect
457457
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
458458
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
@@ -487,8 +487,9 @@ require (
487487
github.com/sirupsen/logrus v1.9.4 // indirect
488488
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
489489
github.com/smartcontractkit/ccip-owner-contracts v0.1.0 // indirect
490-
github.com/smartcontractkit/chainlink-aptos v0.0.0-20260706100550-d43558069754 // indirect
491-
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260625091148-e5618f5682ee // indirect
490+
github.com/smartcontractkit/chainlink-aptos v0.0.0-20260708114855-e953eeb028a7 // indirect
491+
github.com/smartcontractkit/chainlink-aptos/codec v0.0.0-20260708114855-e953eeb028a7 // indirect
492+
github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260715204125-87778cfb9fd3 // indirect
492493
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260624154507-ea7ff77a0ddb // indirect
493494
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260624154507-ea7ff77a0ddb // indirect
494495
github.com/smartcontractkit/chainlink-ccv v0.0.2-0.20260706093831-dad26b360094 // indirect
@@ -507,7 +508,7 @@ require (
507508
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d // indirect
508509
github.com/smartcontractkit/chainlink-protos/data-feeds v0.1.1-0.20260501174546-2e8846986b36 // indirect
509510
github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20260512230622-65f10f4cd305 // indirect
510-
github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260512230622-65f10f4cd305 // indirect
511+
github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260709145319-7782fb89eb16 // indirect
511512
github.com/smartcontractkit/chainlink-protos/orchestrator v0.11.0 // indirect
512513
github.com/smartcontractkit/chainlink-protos/ring/go v0.0.0-20260331131315-f08a616d8dcd // indirect
513514
github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 // indirect
@@ -516,7 +517,7 @@ require (
516517
github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260630073003-fb8da7229930 // indirect
517518
github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-20260513123719-d347eaf314e1 // indirect
518519
github.com/smartcontractkit/chainlink-sui v0.0.0 // indirect
519-
github.com/smartcontractkit/chainlink-sui/codec v0.0.0-20260706170510-94f3a0409ea5 // indirect
520+
github.com/smartcontractkit/chainlink-sui/codec v0.0.0-20260713202800-ac352a2c68f0 // indirect
520521
github.com/smartcontractkit/chainlink-testing-framework/framework/components/chiprouter v1.0.4 // indirect
521522
github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake v0.15.0 // indirect
522523
github.com/smartcontractkit/chainlink-testing-framework/lib v1.54.9 // indirect
@@ -565,6 +566,7 @@ require (
565566
github.com/urfave/cli/v2 v2.27.7 // indirect
566567
github.com/valyala/fastjson v1.6.10 // indirect
567568
github.com/vektah/gqlparser/v2 v2.5.30 // indirect
569+
github.com/wlynxg/anet v0.0.5 // indirect
568570
github.com/x448/float16 v0.8.4 // indirect
569571
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
570572
github.com/xlab/treeprint v1.2.0 // indirect
@@ -626,7 +628,7 @@ require (
626628
google.golang.org/genproto v0.0.0-20250505200425-f936aa4a68b2 // indirect
627629
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect
628630
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect
629-
google.golang.org/grpc v1.81.1 // indirect
631+
google.golang.org/grpc v1.82.0 // indirect
630632
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
631633
gopkg.in/guregu/null.v4 v4.0.0 // indirect
632634
gopkg.in/inf.v0 v0.9.1 // indirect
@@ -662,4 +664,4 @@ replace github.com/doyensec/safeurl => github.com/cedric-cordenier/safeurl v0.0.
662664
// yet, so we pin to v0.1.0 which has both the old aliases and the new compression API.
663665
replace github.com/moby/go-archive v0.2.0 => github.com/moby/go-archive v0.1.0
664666

665-
replace github.com/smartcontractkit/chainlink-sui => github.com/smartcontractkit/chainlink-sui v0.0.0-20260707125635-abec997b6eae
667+
replace github.com/smartcontractkit/chainlink-sui => github.com/smartcontractkit/chainlink-sui v0.0.0-20260721212531-dc23bb271beb

0 commit comments

Comments
 (0)