Skip to content

Move blockchain.Info to the evm accessor.#984

Merged
winder merged 4 commits intomainfrom
will/evm-info
Mar 27, 2026
Merged

Move blockchain.Info to the evm accessor.#984
winder merged 4 commits intomainfrom
will/evm-info

Conversation

@winder
Copy link
Copy Markdown
Collaborator

@winder winder commented Mar 26, 2026

Attempt to better compartmentalize EVM specific code by moving several evm specific types, functions and services out of the general integration package and into the evm accessor package.

@github-actions
Copy link
Copy Markdown

Code coverage report:

Package main will/evm-info diff
github.com/smartcontractkit/chainlink-ccv/aggregator 47.77% 47.79% +0.02%
github.com/smartcontractkit/chainlink-ccv/bootstrap 42.35% 42.35% +0.00%
github.com/smartcontractkit/chainlink-ccv/cli 65.13% 65.13% +0.00%
github.com/smartcontractkit/chainlink-ccv/cmd 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/common 50.74% 50.74% +0.00%
github.com/smartcontractkit/chainlink-ccv/executor 46.42% 46.42% +0.00%
github.com/smartcontractkit/chainlink-ccv/indexer 42.70% 42.76% +0.06%
github.com/smartcontractkit/chainlink-ccv/integration 54.96% 44.64% -10.32%
github.com/smartcontractkit/chainlink-ccv/pkg 0.00% 100.00% +100.00%
github.com/smartcontractkit/chainlink-ccv/pricer 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/protocol 0.00% 69.07% +69.07%
github.com/smartcontractkit/chainlink-ccv/verifier 0.00% 32.62% +32.62%

WARNING: go tool cover failed for coverage_target.out
cover: no required module provides package github.com/smartcontractkit/chainlink-ccv/integration/pkg; to add it:
go get github.com/smartcontractkit/chainlink-ccv/integration/pkg

@winder winder marked this pull request as ready for review March 26, 2026 19:30
@winder winder requested review from a team and skudasov as code owners March 26, 2026 19:30
Copilot AI review requested due to automatic review settings March 26, 2026 19:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR relocates the concrete EVM chain configuration types (Info/Node) out of the generic integration/pkg/blockchain package and into the EVM accessor package, updating executables and devenv utilities to use evm.Info while keeping blockchain.Infos[T] as a generic map helper.

Changes:

  • Moved EVM chain config structs from integration/pkg/blockchain into integration/pkg/accessors/evm (evm.Info, evm.Node).
  • Updated verifier/executor entrypoints and devenv config generation to use evm.Info in generic config wrappers.
  • Moved EVM source reader implementation under the evm accessor package and updated constructor call sites accordingly.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
verifier/cmd/token/main.go Switch token verifier wiring from blockchain.Info to evm.Info.
verifier/cmd/committee/main.go Switch committee verifier factory generics and deprecated wrapper to evm.Info.
integration/pkg/constructors/committee_verifier.go Use evm.NewEVMSourceReader instead of sourcereader.NewEVMSourceReader.
integration/pkg/blockchain/info_test.go Adjust tests to use a local generic test struct rather than removed blockchain.Info.
integration/pkg/blockchain/info.go Remove concrete Info/Node, leaving only generic Infos[T] helpers.
integration/pkg/accessors/evm/multi_node_client.go Move multinode client helpers into package evm and update signatures to Infos[evm.Info].
integration/pkg/accessors/evm/info.go New home for EVM Info/Node and helper methods.
integration/pkg/accessors/evm/factory_constructor.go Update accessor factory constructor to use local multinode helper + Infos[evm.Info].
integration/pkg/accessors/evm/factory.go Update EVM accessor factory to store Infos[evm.Info] and construct source readers in-package.
integration/pkg/accessors/evm/evm_source_reader.go Move EVM source reader implementation into package evm and rename struct to SourceReader.
integration/pkg/accessors/evm/evm_factory.go Move EVM factory into package evm and update generics to Infos[evm.Info].
cmd/executor/main.go Use evm.CreateMultiNodeClientFromInfo and decode blockchain infos as Infos[evm.Info].
build/devenv/services/tokenVerifier.go Update token verifier config generation to accept Infos[evm.Info].
build/devenv/services/executor.go Update executor config generation + filtering to use Infos[evm.Info].
build/devenv/services/common.go Update conversion from CTF outputs to return Infos[evm.Info].
build/devenv/services/chainconfig/evm.go Update chainconfig loader to produce *evm.Info values.
build/devenv/go.mod Add indirect chainlink-framework deps and pin ugorji/go/codec to v1.2.12 via replace.
build/devenv/go.sum Record sums for newly added deps and the pinned codec version.
Comments suppressed due to low confidence (2)

integration/pkg/accessors/evm/evm_source_reader.go:27

  • The comment reads "SourceReader implements the SourceReader interface", which is tautological and ambiguous given the chainaccess.SourceReader interface name. Update it to explicitly reference chainaccess.SourceReader (or remove it) to avoid confusion.
    integration/pkg/accessors/evm/multi_node_client.go:25
  • If GetBlockchainByChainSelector returns an error, the function currently just logs it and continues with a zero-value Info, which can mask the real cause (and lead to a misleading "no nodes found" error). Return the lookup error immediately instead of proceeding.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 20 to 32
func TestHelper_GetBlockchainByChainSelector_NilMapEntriesTreatedAsNotFound(t *testing.T) {
validInfo := Info{ChainID: "123", Type: "evm", Family: "evm", UniqueChainName: "chain-123"}
validInfo := TestInfo{ChainID: "123", Type: "evm", Family: "evm", UniqueChainName: "chain-123"}
selector := protocol.ChainSelector(999)
tests := []struct {
name string
infos map[string]Info
infos Infos[TestInfo]
wantErr bool
}{
{
name: "returns error when key exists but value is nil",
infos: map[string]Info{"999": {}},
infos: Infos[TestInfo]{"999": {}},
wantErr: false, // With generic types, this isn't something we can test for.
},
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test name and the first sub-case are now misleading: map values are not pointers and GetBlockchainByChainSelector only checks key existence, so there is no longer a meaningful "nil map entry" scenario here. Consider renaming the test and removing/reworking the first case so it reflects the current behavior being validated.

Copilot uses AI. Check for mistakes.
func ConvertBlockchainOutputsToInfo(outputs []*ctfblockchain.Output) (ccvblockchain.Infos[ccvblockchain.Info], error) {
infos := make(map[string]ccvblockchain.Info)
func ConvertBlockchainOutputsToInfo(outputs []*ctfblockchain.Output) (ccvblockchain.Infos[evm.Info], error) {
infos := make(map[string]evm.Info)
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Infos[T] is a named map type, so infos := make(map[string]evm.Info) cannot be returned as ccvblockchain.Infos[evm.Info] (will not compile). Define infos as make(ccvblockchain.Infos[evm.Info]) (or cast on return) so the return type matches.

Suggested change
infos := make(map[string]evm.Info)
infos := make(ccvblockchain.Infos[evm.Info])

Copilot uses AI. Check for mistakes.
@winder winder enabled auto-merge March 27, 2026 15:49
@winder winder added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit 066e3e5 Mar 27, 2026
33 of 34 checks passed
@winder winder deleted the will/evm-info branch March 27, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants