@@ -3,10 +3,12 @@ package chainaccessor
3
3
import (
4
4
"context"
5
5
"encoding/binary"
6
+ "errors"
6
7
"fmt"
7
8
"slices"
8
9
9
10
"github.com/gagliardetto/solana-go"
11
+ "github.com/gagliardetto/solana-go/rpc"
10
12
"github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
11
13
12
14
offramp "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/latest/ccip_offramp"
@@ -132,11 +134,14 @@ func (a *SolanaAccessor) getOffRampSourceChainConfigs(ctx context.Context, sourc
132
134
133
135
var sourceChain offramp.SourceChain
134
136
err = a .client .GetAccountDataBorshInto (ctx , sourceChainPDA , & sourceChain )
137
+ // The plugin is built with EVM behaviour in mind: if account is not found insert entry for chain with source chain config disabled
138
+ if errors .Is (err , rpc .ErrNotFound ) {
139
+ sourceChainConfigs [selector ] = ccipocr3.SourceChainConfig {
140
+ IsEnabled : false ,
141
+ }
142
+ }
135
143
if err != nil {
136
- // TODO: Do we want to return what we can or is a failure to find a source chain config here something we should break at.
137
- // The feed chain selector seems to be included in the list so continuing seems the right move
138
- a .lggr .Debugw ("could not find source chain config for selector" , "selector" , selector )
139
- continue
144
+ return nil , fmt .Errorf ("failed to fetch source chain config for selector %d: %w" , selector , err )
140
145
}
141
146
142
147
a .lggr .Debugw ("fetching source chain config" , "sourceChainSelector" , selector , "offramp" , offrampAddr .String (), "sourceChainPDA" , sourceChainPDA .String (), "sourceChain" , sourceChain )
@@ -278,7 +283,7 @@ func (a *SolanaAccessor) getOfframpConfig(ctx context.Context, offrampAddr solan
278
283
}
279
284
280
285
func (a * SolanaAccessor ) getOfframpReferenceAddresses (ctx context.Context , offrampAddr solana.PublicKey ) (offramp.ReferenceAddresses , error ) {
281
- a .lggr .Debugw ("getOfframpReferenceAddresses" , "offrampAddr" , offrampAddr .String (), "" )
286
+ a .lggr .Debugw ("getOfframpReferenceAddresses" , "offrampAddr" , offrampAddr .String ())
282
287
refAddrPDA , _ , err := state .FindOfframpReferenceAddressesPDA (offrampAddr )
283
288
if err != nil {
284
289
return offramp.ReferenceAddresses {}, fmt .Errorf ("failed to calculate the offramp reference addresses PDA: %w" , err )
0 commit comments