besu icon indicating copy to clipboard operation
besu copied to clipboard

Improve validation when reading transitions config

Open siladu opened this issue 4 years ago • 1 comments

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.

siladu avatar Nov 15 '21 05:11 siladu

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

antonydenyer avatar Apr 26 '22 09:04 antonydenyer