diff --git a/core/chains/evm/config/toml/config.go b/core/chains/evm/config/toml/config.go index 36c7d0f052b..6e360d886c1 100644 --- a/core/chains/evm/config/toml/config.go +++ b/core/chains/evm/config/toml/config.go @@ -513,6 +513,7 @@ func (t *TxmV2) ValidateConfig() (err error) { if t.Enabled != nil && *t.Enabled { if t.BlockTime == nil { err = multierr.Append(err, commonconfig.ErrMissing{Name: "TxmV2.BlockTime", Msg: "must be set if txmv2 feature is enabled"}) + return } if t.BlockTime.Duration() < 2*time.Second { err = multierr.Append(err, commonconfig.ErrInvalid{Name: "TxmV2.BlockTime", Msg: "must be equal to or greater than 2 seconds"}) diff --git a/core/services/chainlink/config_test.go b/core/services/chainlink/config_test.go index 1dbc46d069d..895c8809e23 100644 --- a/core/services/chainlink/config_test.go +++ b/core/services/chainlink/config_test.go @@ -1477,7 +1477,7 @@ func TestConfig_Validate(t *testing.T) { - Nodes: 2 errors: - 0.HTTPURL: missing: required for all nodes - 1.HTTPURL: missing: required for all nodes - - 1: 10 errors: + - 1: 11 errors: - ChainType: invalid value (Foo): must not be set with this chain id - Nodes: missing: must have at least one node - ChainType: invalid value (Foo): must be one of arbitrum, astar, celo, gnosis, hedera, kroma, mantle, metis, optimismBedrock, scroll, wemix, xlayer, zkevm, zksync, zircuit, dualBroadcast or omitted @@ -1485,6 +1485,7 @@ func TestConfig_Validate(t *testing.T) { - GasEstimator.BumpThreshold: invalid value (0): cannot be 0 if auto-purge feature is enabled for Foo - Transactions.AutoPurge.Threshold: missing: needs to be set if auto-purge feature is enabled for Foo - Transactions.AutoPurge.MinAttempts: missing: needs to be set if auto-purge feature is enabled for Foo + - TxmV2.TxmV2.BlockTime: missing: must be set if txmv2 feature is enabled - GasEstimator: 2 errors: - FeeCapDefault: invalid value (101 wei): must be equal to PriceMax (99 wei) since you are using FixedPrice estimation with gas bumping disabled in EIP1559 mode - PriceMax will be used as the FeeCap for transactions instead of FeeCapDefault - PriceMax: invalid value (1 gwei): must be greater than or equal to PriceDefault @@ -1515,7 +1516,9 @@ func TestConfig_Validate(t *testing.T) { - 4: 2 errors: - ChainID: missing: required for all chains - Nodes: missing: must have at least one node - - 5.Transactions.AutoPurge.DetectionApiUrl: invalid value (): must be set for scroll + - 5: 2 errors: + - Transactions.AutoPurge.DetectionApiUrl: invalid value (): must be set for scroll + - TxmV2.TxmV2.BlockTime: missing: must be set if txmv2 feature is enabled - 6.Nodes: missing: 0th node (primary) must have a valid WSURL when http polling is disabled - Cosmos: 5 errors: - 1.ChainID: invalid value (Malaga-420): duplicate - must be unique