@@ -4,20 +4,19 @@ import (
44 "fmt"
55 "maps"
66
7- cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
87 "github.com/smartcontractkit/chainlink-common/pkg/logger"
98 "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
109 cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"
1110)
1211
1312// PluginConfig holds the configuration for a plugin.
1413type PluginConfig struct {
15- CommitPluginCodec cciptypes .CommitPluginCodec
16- ExecutePluginCodec cciptypes .ExecutePluginCodec
17- MessageHasher cciptypes .MessageHasher
18- TokenDataEncoder cciptypes .TokenDataEncoder
19- GasEstimateProvider cciptypes .EstimateProvider
20- RMNCrypto cciptypes .RMNCrypto
14+ CommitPluginCodec ccipocr3 .CommitPluginCodec
15+ ExecutePluginCodec ccipocr3 .ExecutePluginCodec
16+ MessageHasher ccipocr3 .MessageHasher
17+ TokenDataEncoder ccipocr3 .TokenDataEncoder
18+ GasEstimateProvider ccipocr3 .EstimateProvider
19+ RMNCrypto ccipocr3 .RMNCrypto
2120 ContractTransmitterFactory cctypes.ContractTransmitterFactory
2221 // PriceOnlyCommitFn optional method override for price only commit reports.
2322 PriceOnlyCommitFn string
@@ -29,9 +28,8 @@ type PluginConfig struct {
2928
3029// PluginServices aggregates services for a specific chain family.
3130type PluginServices struct {
32- PluginConfig PluginConfig
33- AddrCodec AddressCodec
34- //ExtraDataCodec ccipocr3.ExtraDataCodec
31+ PluginConfig PluginConfig
32+ AddrCodec AddressCodec
3533 ChainRW MultiChainRW
3634 CCIPProviderSupported map [string ]bool
3735}
@@ -53,25 +51,24 @@ func GetPluginServices(lggr logger.Logger, chainFamily string) (PluginServices,
5351 return PluginServices {}, fmt .Errorf ("unsupported chain family: %s (available: %v)" , chainFamily , maps .Keys (registeredFactories ))
5452 }
5553
56- pluginServices := PluginServices {
57- //ExtraDataCodec: make(ccipocr3.ExtraDataCodec), // lazy initialize it after factory init call
58- }
59-
54+ pluginServices := PluginServices {}
6055 extraDataCodecRegistry := GetExtraDataCodecRegistry ()
6156 addressCodecMap := make (map [string ]ChainSpecificAddressCodec )
6257 chainRWProviderMap := make (map [string ]ChainRWProvider )
6358 CCIPProviderSupported := make (map [string ]bool )
6459
6560 for family , initFunc := range registeredFactories {
66- //config := initFunc(lggr, pluginServices.ExtraDataCodec)
6761 config := initFunc (lggr , GetExtraDataCodecRegistry ())
6862 CCIPProviderSupported [family ] = config .CCIPProviderSupported
6963 if config .AddressCodec != nil {
7064 addressCodecMap [family ] = config .AddressCodec
7165 }
66+
67+ // Register all known families, this includes families whose SourceChainExtraDataCodec is provided
68+ // by the CCIPProvider
7269 extraDataCodecRegistry .RegisterFamily (family )
7370 if config .ExtraDataCodec != nil {
74- //pluginServices.ExtraDataCodec[family] = config.ExtraDataCodec // initialize and update it with the map
71+ // Register the actual codec for this family if we have it defined in core already
7572 extraDataCodecRegistry .RegisterCodec (family , config .ExtraDataCodec )
7673 }
7774 if config .ChainRW != nil {
@@ -85,14 +82,5 @@ func GetPluginServices(lggr logger.Logger, chainFamily string) (PluginServices,
8582 pluginServices .AddrCodec = NewAddressCodec (addressCodecMap )
8683 pluginServices .ChainRW = NewCRCW (chainRWProviderMap )
8784 pluginServices .CCIPProviderSupported = CCIPProviderSupported
88- //pluginServices.ExtraDataCodecBundle = registry // Provide registry-based bundle interface
8985 return pluginServices , nil
9086}
91-
92- // GetGlobalExtraDataCodecRegistry returns the singleton ExtraDataCodecRegistry
93- // that can be used to access codec functionality across all registered chain families.
94- // This function provides a way to access the registry without needing to initialize
95- // the full plugin services, which is useful for gRPC services and other external components.
96- func GetGlobalExtraDataCodecRegistry () ccipocr3.ExtraDataCodecBundle {
97- return GetExtraDataCodecRegistry ()
98- }
0 commit comments