Add EIP-1283 disable transition (#10214)

This commit is contained in:
Wei Tang 2019-01-21 12:22:29 +01:00 committed by Afri Schoedon
parent 940a88fa4e
commit fb07ffa676
2 changed files with 10 additions and 1 deletions

View File

@ -121,6 +121,8 @@ pub struct CommonParams {
pub eip1052_transition: BlockNumber, pub eip1052_transition: BlockNumber,
/// Number of first block where EIP-1283 rules begin. /// Number of first block where EIP-1283 rules begin.
pub eip1283_transition: BlockNumber, pub eip1283_transition: BlockNumber,
/// Number of first block where EIP-1283 rules end.
pub eip1283_disable_transition: BlockNumber,
/// Number of first block where EIP-1014 rules begin. /// Number of first block where EIP-1014 rules begin.
pub eip1014_transition: BlockNumber, pub eip1014_transition: BlockNumber,
/// Number of first block where dust cleanup rules (EIP-168 and EIP169) begin. /// Number of first block where dust cleanup rules (EIP-168 and EIP169) begin.
@ -189,7 +191,7 @@ impl CommonParams {
schedule.have_return_data = block_number >= self.eip211_transition; schedule.have_return_data = block_number >= self.eip211_transition;
schedule.have_bitwise_shifting = block_number >= self.eip145_transition; schedule.have_bitwise_shifting = block_number >= self.eip145_transition;
schedule.have_extcodehash = block_number >= self.eip1052_transition; schedule.have_extcodehash = block_number >= self.eip1052_transition;
schedule.eip1283 = block_number >= self.eip1283_transition; schedule.eip1283 = block_number >= self.eip1283_transition && !(block_number >= self.eip1283_disable_transition);
if block_number >= self.eip210_transition { if block_number >= self.eip210_transition {
schedule.blockhash_gas = 800; schedule.blockhash_gas = 800;
} }
@ -300,6 +302,10 @@ impl From<ethjson::spec::Params> for CommonParams {
BlockNumber::max_value, BlockNumber::max_value,
Into::into, Into::into,
), ),
eip1283_disable_transition: p.eip1283_disable_transition.map_or_else(
BlockNumber::max_value,
Into::into,
),
eip1014_transition: p.eip1014_transition.map_or_else( eip1014_transition: p.eip1014_transition.map_or_else(
BlockNumber::max_value, BlockNumber::max_value,
Into::into, Into::into,

View File

@ -89,6 +89,9 @@ pub struct Params {
pub eip1052_transition: Option<Uint>, pub eip1052_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
pub eip1283_transition: Option<Uint>, pub eip1283_transition: Option<Uint>,
/// See `CommonParams` docs.
pub eip1283_disable_transition: Option<Uint>,
/// See `CommonParams` docs.
pub eip1014_transition: Option<Uint>, pub eip1014_transition: Option<Uint>,
/// See `CommonParams` docs. /// See `CommonParams` docs.
pub dust_protection_transition: Option<Uint>, pub dust_protection_transition: Option<Uint>,