@@ -134,6 +134,22 @@ func (i *pluginOracleCreator) Create(ctx context.Context, donID uint32, config c
134134 return nil , fmt .Errorf ("failed to initialize plugin config: %w" , err )
135135 }
136136
137+ // Create CCIP providers - this is the preferred way for plugins to access CCIP data
138+ ccipProviders , err := i .createCCIPProviders (
139+ ctx ,
140+ pluginServices ,
141+ config ,
142+ )
143+ if err != nil {
144+ return nil , fmt .Errorf ("failed to create CCIPProviders: %w" , err )
145+ }
146+
147+ // Populate extraDataCodecRegistry with codecs from CCIPProviders
148+ err = i .populateCodecRegistriesWithProviderCodecs (ccipProviders )
149+ if err != nil {
150+ return nil , fmt .Errorf ("failed to populate extraDataCodecRegistry with codecs from CCIPProviders: %w" , err )
151+ }
152+
137153 destChainID , err := chainsel .GetChainIDFromSelector (chainSelector )
138154 if err != nil {
139155 return nil , fmt .Errorf ("failed to get chain ID from selector %d: %w" , chainSelector , err )
@@ -189,18 +205,6 @@ func (i *pluginOracleCreator) Create(ctx context.Context, donID uint32, config c
189205 return nil , fmt .Errorf ("failed to create readers and writers: %w" , err )
190206 }
191207
192- // Create CCIP providers - this is the preferred way for plugins to access CCIP data
193- ccipProviders , err := i .createCCIPProviders (
194- ctx ,
195- pluginServices ,
196- cctypes .PluginType (config .Config .PluginType ),
197- offrampAddrStr ,
198- config ,
199- )
200- if err != nil {
201- return nil , fmt .Errorf ("failed to create CCIPProviders: %w" , err )
202- }
203-
204208 // Create chain accessors and contract transmitters for relayers that supported them
205209 chainAccessors , contractTransmitters , err := i .getChainAccessorsAndContractTransmittersFromProviders (
206210 ccipProviders ,
@@ -212,12 +216,6 @@ func (i *pluginOracleCreator) Create(ctx context.Context, donID uint32, config c
212216 return nil , fmt .Errorf ("failed to create chain accessors: %w" , err )
213217 }
214218
215- // Populate extraDataCodecRegistry with codecs from CCIPProviders
216- err = i .populateCodecRegistriesWithProviderCodecs (ccipProviders )
217- if err != nil {
218- return nil , fmt .Errorf ("failed to populate extraDataCodecRegistry with codecs from CCIPProviders: %w" , err )
219- }
220-
221219 // build the onchain keyring. it will be the signing key for the destination chain family.
222220 keybundle , ok := i .ocrKeyBundles [destChainFamily ]
223221 if ! ok {
@@ -496,8 +494,6 @@ func (i *pluginOracleCreator) createFactoryAndTransmitter(
496494func (i * pluginOracleCreator ) createCCIPProviders (
497495 ctx context.Context ,
498496 pluginServices ccipcommon.PluginServices ,
499- pluginType cctypes.PluginType ,
500- offrampAddrStr string ,
501497 config cctypes.OCR3ConfigWithMeta ,
502498) (map [cciptypes.ChainSelector ]types.CCIPProvider , error ) {
503499 ccipProviders := make (map [cciptypes.ChainSelector ]types.CCIPProvider )
0 commit comments