Skip to content

Commit

Permalink
Add LLOConfigMode in preparation for blue/green deploys (#14634)
Browse files Browse the repository at this point in the history
- Currently only "mercury" is supported, in future additional config
  modes will be available
  • Loading branch information
samsondav authored Oct 4, 2024
1 parent 004a0de commit d0d1dd9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/services/ocr2/plugins/llo/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ func TestIntegration_LLO(t *testing.T) {
chainID = "%s"
fromBlock = %d
lloDonID = %d
lloConfigMode = "mercury"
`, chainID, fromBlock, donID)
addBootstrapJob(t, bootstrapNode, configuratorAddress, "job-2", relayType, relayConfig)

Expand Down
6 changes: 6 additions & 0 deletions core/services/relay/evm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,12 @@ func (r *Relayer) NewLLOProvider(rargs commontypes.RelayArgs, pargs commontypes.
return nil, fmt.Errorf("failed to get relay config: %w", err)
}
}
if relayConfig.LLODONID == 0 {
return nil, errors.New("donID must be specified in relayConfig for LLO jobs")
}
if relayConfig.LLOConfigMode != types.LLOConfigModeMercury {
return nil, fmt.Errorf("LLOConfigMode must be specified in relayConfig for LLO jobs (only %q is currently supported)", types.LLOConfigModeMercury)
}

var lloCfg lloconfig.PluginConfig
if err := json.Unmarshal(pargs.PluginConfig, &lloCfg); err != nil {
Expand Down
13 changes: 12 additions & 1 deletion core/services/relay/evm/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ func (r *ReadType) UnmarshalText(text []byte) error {
return fmt.Errorf("unrecognized ReadType: %s", string(text))
}

type LLOConfigMode string

const (
LLOConfigModeMercury LLOConfigMode = "mercury"
)

func (c LLOConfigMode) String() string {
return string(c)
}

type RelayConfig struct {
ChainID *big.Big `json:"chainID"`
FromBlock uint64 `json:"fromBlock"`
Expand All @@ -192,7 +202,8 @@ type RelayConfig struct {
EnableTriggerCapability bool `json:"enableTriggerCapability"`

// LLO-specific
LLODONID uint32 `json:"lloDonID" toml:"lloDonID"`
LLODONID uint32 `json:"lloDonID" toml:"lloDonID"`
LLOConfigMode LLOConfigMode `json:"lloConfigMode" toml:"lloConfigMode"`
}

var ErrBadRelayConfig = errors.New("bad relay config")
Expand Down

0 comments on commit d0d1dd9

Please sign in to comment.