@@ -29,9 +29,8 @@ type PluginConfig struct {
2929
3030// PluginServices aggregates services for a specific chain family.
3131type PluginServices struct {
32- PluginConfig PluginConfig
33- AddrCodec AddressCodec
34- //ExtraDataCodec ccipocr3.ExtraDataCodec
32+ PluginConfig PluginConfig
33+ AddrCodec AddressCodec
3534 ChainRW MultiChainRW
3635 CCIPProviderSupported map [string ]bool
3736}
@@ -53,25 +52,24 @@ func GetPluginServices(lggr logger.Logger, chainFamily string) (PluginServices,
5352 return PluginServices {}, fmt .Errorf ("unsupported chain family: %s (available: %v)" , chainFamily , maps .Keys (registeredFactories ))
5453 }
5554
56- pluginServices := PluginServices {
57- //ExtraDataCodec: make(ccipocr3.ExtraDataCodec), // lazy initialize it after factory init call
58- }
59-
55+ pluginServices := PluginServices {}
6056 extraDataCodecRegistry := GetExtraDataCodecRegistry ()
6157 addressCodecMap := make (map [string ]ChainSpecificAddressCodec )
6258 chainRWProviderMap := make (map [string ]ChainRWProvider )
6359 CCIPProviderSupported := make (map [string ]bool )
6460
6561 for family , initFunc := range registeredFactories {
66- //config := initFunc(lggr, pluginServices.ExtraDataCodec)
6762 config := initFunc (lggr , GetExtraDataCodecRegistry ())
6863 CCIPProviderSupported [family ] = config .CCIPProviderSupported
6964 if config .AddressCodec != nil {
7065 addressCodecMap [family ] = config .AddressCodec
7166 }
67+
68+ // Register all known families, this includes families whose SourceChainExtraDataCodec is provided
69+ // by the CCIPProvider
7270 extraDataCodecRegistry .RegisterFamily (family )
7371 if config .ExtraDataCodec != nil {
74- //pluginServices.ExtraDataCodec[family] = config.ExtraDataCodec // initialize and update it with the map
72+ // Register the actual codec for this family if we have it defined in core already
7573 extraDataCodecRegistry .RegisterCodec (family , config .ExtraDataCodec )
7674 }
7775 if config .ChainRW != nil {
@@ -85,14 +83,5 @@ func GetPluginServices(lggr logger.Logger, chainFamily string) (PluginServices,
8583 pluginServices .AddrCodec = NewAddressCodec (addressCodecMap )
8684 pluginServices .ChainRW = NewCRCW (chainRWProviderMap )
8785 pluginServices .CCIPProviderSupported = CCIPProviderSupported
88- //pluginServices.ExtraDataCodecBundle = registry // Provide registry-based bundle interface
8986 return pluginServices , nil
9087}
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