Skip to content

Commit f19bc31

Browse files
committed
add some logs
1 parent 52421cb commit f19bc31

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

core/capabilities/ccip/common/extradatacodecregistry.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package common
33
import (
44
"sync"
55

6+
"github.com/smartcontractkit/chainlink-common/pkg/logger"
67
cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
78
)
89

@@ -58,6 +59,16 @@ func (r *ExtraDataCodecRegistry) RegisterCodec(chainFamily string, codec SourceC
5859
r.extraDataCodec[chainFamily] = codec
5960
}
6061

62+
func (r *ExtraDataCodecRegistry) LogRegisteredFamilies(lggr logger.Logger) {
63+
r.mu.RLock()
64+
defer r.mu.RUnlock()
65+
families := make([]string, 0, len(r.extraDataCodec))
66+
for family := range r.extraDataCodec {
67+
families = append(families, family)
68+
}
69+
lggr.Infow("OGT ExtraDataCodecRegistry: registered chain families", "families", families)
70+
}
71+
6172
// ============ gRPC-compatible implementation of ExtraDataCodecBundle interface ============
6273

6374
// DecodeExtraArgs can be called either over gRPC or not. It is used to decode extra args for a specific

core/capabilities/ccip/common/pluginconfig.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ func GetPluginServices(lggr logger.Logger, chainFamily string) (PluginServices,
6363
CCIPProviderSupported[family] = config.CCIPProviderSupported
6464

6565
extraDataCodecRegistry.RegisterFamilyNoopCodec(family)
66+
lggr.Debugw("OGT ExtraDataCodecRegistry: registering family with no-op codec", "family", family)
6667
if config.ExtraDataCodec != nil {
68+
lggr.Debugw("OGT ExtraDataCodecRegistry: registering family with provided codec", "family", family)
6769
extraDataCodecRegistry.RegisterCodec(family, config.ExtraDataCodec)
6870
}
6971
if config.AddressCodec != nil {

core/capabilities/ccip/oraclecreator/plugin.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ func (i *pluginOracleCreator) Create(ctx context.Context, donID uint32, config c
218218
return nil, fmt.Errorf("failed to populate extraDataCodecRegistry with codecs from CCIPProviders: %w", err)
219219
}
220220

221+
i.lggr.Debugw("OGT finished populating ExtraDataCodecRegistry with codecs from CCIPProviders")
222+
ccipcommon.GetExtraDataCodecRegistry().LogRegisteredFamilies(i.lggr)
223+
221224
// build the onchain keyring. it will be the signing key for the destination chain family.
222225
keybundle, ok := i.ocrKeyBundles[destChainFamily]
223226
if !ok {
@@ -514,10 +517,18 @@ func (i *pluginOracleCreator) createCCIPProviders(
514517
if len(transmitter) == 0 {
515518
return nil, errors.New("transmitter list is empty")
516519
}
520+
i.lggr.Infow("OGT creating CCIP provider",
521+
"pluginType", pluginType.String(),
522+
"chainSelector", chainSelector,
523+
"chainID", relayID.ChainID,
524+
"offrampAddrStr", offrampAddrStr,
525+
"relayer", relayer.Name(),
526+
)
517527
ccipProvider, err := relayer.NewCCIPProvider(ctx, types.CCIPProviderArgs{
518-
PluginType: cciptypes.PluginType(config.Config.PluginType),
519-
OffRampAddress: config.Config.OfframpAddress,
520-
TransmitterAddress: cciptypes.UnknownEncodedAddress(transmitter[0]),
528+
PluginType: cciptypes.PluginType(config.Config.PluginType),
529+
OffRampAddress: config.Config.OfframpAddress,
530+
TransmitterAddress: cciptypes.UnknownEncodedAddress(transmitter[0]),
531+
ExtraDataCodecBundle: ccipcommon.GetExtraDataCodecRegistry(),
521532
})
522533
if err != nil {
523534
return nil, fmt.Errorf("failed to create CCIP provider for relay ID %s: %w", relayID, err)
@@ -594,6 +605,10 @@ func (i *pluginOracleCreator) populateCodecRegistriesWithProviderCodecs(
594605

595606
sourceChainExtraDataCodec := codec.SourceChainExtraDataCodec
596607
if sourceChainExtraDataCodec != nil {
608+
i.lggr.Infow("OGT registering SourceChainExtraDataCodec from CCIPProvider to global registry",
609+
"chainSelector", chainSelector,
610+
"chainFamily", chainFamily,
611+
)
597612
edcr.RegisterCodec(chainFamily, sourceChainExtraDataCodec)
598613
} else {
599614
i.lggr.Warnw("CCIPProvider codec has no SourceChainExtraDataCodec", "chainSelector", chainSelector)

0 commit comments

Comments
 (0)