Skip to content

Executor service refactor and bootstrap#870

Open
faisal-chainlink wants to merge 8 commits intomainfrom
feature/executor-bootstrap
Open

Executor service refactor and bootstrap#870
faisal-chainlink wants to merge 8 commits intomainfrom
feature/executor-bootstrap

Conversation

@faisal-chainlink
Copy link
Contributor

@faisal-chainlink faisal-chainlink commented Mar 9, 2026

This PR adds a devenv service bootstrap path for the executor. This matches what has been done for the verifier.

@github-actions
Copy link

Code coverage report:

Package main feature/executor-bootstrap diff
github.com/smartcontractkit/chainlink-ccv/aggregator 48.05% 48.06% +0.01%
github.com/smartcontractkit/chainlink-ccv/bootstrap 51.13% 51.13% +0.00%
github.com/smartcontractkit/chainlink-ccv/cmd 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/committee 0.00% 100.00% +100.00%
github.com/smartcontractkit/chainlink-ccv/common 0.00% 52.89% +52.89%
github.com/smartcontractkit/chainlink-ccv/executor 0.00% 46.95% +46.95%
github.com/smartcontractkit/chainlink-ccv/indexer 0.00% 36.79% +36.79%
github.com/smartcontractkit/chainlink-ccv/integration 0.00% 43.59% +43.59%
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% 64.82% +64.82%
github.com/smartcontractkit/chainlink-ccv/verifier 0.00% 38.41% +38.41%

WARNING: go tool cover failed for coverage_target.out
cover: open /home/runner/_work/chainlink-ccv/chainlink-ccv/cmd/executor/main.go: no such file or directory

@faisal-chainlink faisal-chainlink marked this pull request as ready for review March 10, 2026 21:58
@faisal-chainlink faisal-chainlink requested review from a team and skudasov as code owners March 10, 2026 21:58
@faisal-chainlink
Copy link
Contributor Author

Needs more edits around documentation and configuration

Copy link
Collaborator

@makramkd makramkd left a comment

Choose a reason for hiding this comment

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

Excellent start! Main points:

  • Do we still need the legacy mode? I noticed that main.go didn't switch to use bootstrap.Run, is that for another PR?
  • Key generation is still happening manually in devenv, I think we should switch that to use the keystore like the verifier
  • Some common code can probably be factored out

Comment on lines +747 to +748
case chainsel.FamilyStellar:
return serializeExtraArgsV3(opts)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Haha, another point of registration needed? 🤔

Copy link

@archseer archseer Mar 11, 2026

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

Something like this?

GetExtraArgs(receiver []byte, opts cciptestinterfaces.MessageOptions) ([]byte, error)

Receiver leaks through because solana needs to derive some custom accounts based on it

Comment on lines +62 to +63
// TransmitterPrivateKey is used in standalone mode for transaction signing.
TransmitterPrivateKey string `toml:"transmitter_private_key"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this still being used even after bootstrapping? We should rely on a key generated by the keystore instead if so.


// GenerateConfigWithBlockchainInfos combines the pre-generated config with blockchain infos
// for standalone mode deployment.
func (v *Input) GenerateConfigWithBlockchainInfos(blockchainInfos map[string]*blockchain.Info) ([]byte, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Still being used?

Comment on lines +216 to +217
// NewStandalone creates a standalone executor (legacy mode, no bootstrap/JD).
func NewStandalone(in *Input, blockchainOutputs []*ctfblockchain.Output) (*Output, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason you think we should keep this around?

Comment on lines +558 to +577
func generateTransmitterPrivateKey() (string, error) {
// TODO: not chain agnostic.
pk, err := crypto.GenerateKey()
if err != nil {
return "", err
}
return hex.EncodeToString(crypto.FromECDSA(pk)), nil
}

// SetTransmitterPrivateKey sets the transmitter private key for the provided execs array.
func SetTransmitterPrivateKey(execs []*Input) ([]*Input, error) {
for _, exec := range execs {
pk, err := generateTransmitterPrivateKey()
if err != nil {
return nil, fmt.Errorf("failed to generate transmitter private key: %w", err)
}
exec.TransmitterPrivateKey = pk
}
return execs, nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO we should remove these

# Then copy the rest of the source and build
COPY . .
WORKDIR /cmd/executor
WORKDIR /cmd/executor/standalone
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto here, don't need standalone suffix

# Then copy the rest of the source
COPY . .
WORKDIR /app/cmd/executor
WORKDIR /app/cmd/executor/standalone
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't need standalone suffix

Comment on lines +18 to +23
// LoadConfigWithBlockchainInfos decodes the executor config from the job spec
// into a strongly-typed map[string]*T. The type T is chosen by the caller (e.g.
// blockchain.Info for EVM). Strict decode is applied: any unknown key in the
// config (including under blockchain_infos.<selector>) causes an error.
// The returned Configuration has defaults applied via GetNormalizedConfig.
func LoadConfigWithBlockchainInfos[T any](spec JobSpec) (*Configuration, map[string]*T, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This dups what we have for commit verifier right? I guess the only difference is the return value Configuration instead of Config.

Maybe we can factor out a common method, we'll need to add a second generic type param for the return value though, wdyt?

type cfgWithBlockchainInfos[T any, U any] struct {
  U
  BlockchainInfos map[string]*T `toml:"blockchain_infos"`
}

func LoadConfigWithBlockchainInfos[T any, U any](spec JobSpec) (*U, map[string]*T, error) {

Comment on lines +33 to +36
normalized, err := decodeTarget.GetNormalizedConfig()
if err != nil {
return nil, nil, fmt.Errorf("failed to normalize executor config: %w", err)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah I just realized that this is executor specific, hmm...

Only thing I can think of is that we can call this after we decode, doesn't seem like it has to be part of decoding, but not too caught up on it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, were you thinking of adding the bootstrapped version in a follow up PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The current setup here wraps this (standalone) as a bootstrapped version. In Stellar, it's being setup with bootstrap.Run (like this) just like the verifier

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah nvm, I just realized this was about the the main.go in here

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.

3 participants