besu
besu copied to clipboard
Improve validation when reading transitions config
When I got the key name or validatorselectionmode enum value wrong in the transitions config, my config was either ignored or I got incorrect behaviour at runtime.
An improvement would be to throw an error whenever an invalid key or enum value is attempted.
A further improvement would be to make a useful suggestion for the user, e.g. user types 'validatormode', respond with "Did you mean validatorselectionmode?" Or at least list enumerate the possible keys/values.
In addition to this validation should be performed for when you specify validatorcontractaddress.
You can specify
"qbft": [{
"block": 20,
"validatorcontractaddress": "0x0000000000000000000000000000000000008888"
}]
without any warnings or errors. validatorselectionmode should be either required when specifying validatorcontractaddress or inferred from it's presence