diff --git a/core/config/blockchain_info.go b/core/config/blockchain_info.go index e1c051954..b72225dbf 100644 --- a/core/config/blockchain_info.go +++ b/core/config/blockchain_info.go @@ -1,6 +1,11 @@ package config -import "time" +import ( + "context" + "time" + + "github.com/river-build/river/core/node/dlog" +) type BlockchainInfo struct { ChainId uint64 @@ -10,11 +15,18 @@ type BlockchainInfo struct { Blocktime time.Duration } -func GetEtherBasedBlockchains(chains []uint64, defaultBlockchainInfo map[uint64]BlockchainInfo) []uint64 { +func GetEtherBasedBlockchains( + ctx context.Context, + chains []uint64, + defaultBlockchainInfo map[uint64]BlockchainInfo, +) []uint64 { + log := dlog.FromCtx(ctx) etherBasedChains := make([]uint64, 0, len(chains)) for _, chainId := range chains { if info, ok := defaultBlockchainInfo[chainId]; ok && info.IsEtherBased { etherBasedChains = append(etherBasedChains, chainId) + } else if !ok { + log.Error("Missing BlockchainInfo for chain", "chainId", chainId) } } return etherBasedChains diff --git a/core/xchain/entitlement/evaluator.go b/core/xchain/entitlement/evaluator.go index 0bfd4ffea..1cd33f9f9 100644 --- a/core/xchain/entitlement/evaluator.go +++ b/core/xchain/entitlement/evaluator.go @@ -43,6 +43,7 @@ func NewEvaluatorFromConfigWithBlockchainInfo( "operation", ), ethChainIds: config.GetEtherBasedBlockchains( + ctx, cfg.XChainBlockchains, blockChainInfo, ),