[ethash] chainspec validate ecip1017EraRounds non-zero (#11123)
* [ethash]: validate `ecip1017EraRounds` non-zero When `ecip1017EraRounds` ethash will divide by zero. This commit ensures that the chainspec deserialization fails and gives a better error message. * [ecip1017_eras_block_reward]: document behaviour * nit * docs(ethash ecip1071): resolve `TODO`
This commit is contained in:
@@ -91,6 +91,7 @@ pub struct EthashParams {
|
||||
pub ecip1010_continue_transition: Option<Uint>,
|
||||
|
||||
/// See main EthashParams docs.
|
||||
#[serde(default, deserialize_with="uint::validate_optional_non_zero")]
|
||||
pub ecip1017_era_rounds: Option<Uint>,
|
||||
|
||||
/// Delays of difficulty bombs.
|
||||
@@ -101,7 +102,6 @@ pub struct EthashParams {
|
||||
/// EXPIP-2 duration limit
|
||||
pub expip2_duration_limit: Option<Uint>,
|
||||
/// Block to transition to progpow
|
||||
#[serde(rename="progpowTransition")]
|
||||
pub progpow_transition: Option<Uint>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user