v2.5.9-stable (#11089)

* ethcore/res: activate Istanbul on Ropsten, Görli, Rinkeby, Kovan (#11068)

* ethcore/res: activate Istanbul on Ropsten block 6485846

* ethcore/res: activate Istanbul on Goerli block 1561651

* ethcore/res: use hex values for Istanbul specs

* ethcore/res: fix trailing comma

* ethcore/res: be pedantic about EIP-1283 in Petersburg and Istanbul test specs

* ethcore/res: activate Istanbul on Rinkeby block 5435345

* ethcore/res: activate Istanbul on Kovan block 14111141

* ethcore/res: fix kovan istanbul number to 0xd751a5

* [json-spec] make blake2 pricing spec more readable (#11034)

* [json-spec] make blake2 pricing spec more readable

* [ethcore] fix compilation

* Manual backport of #11033
This commit is contained in:
s3krit 2019-09-26 11:03:39 +02:00 committed by GitHub
parent c52a6c8fb7
commit b2277f65e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 215 additions and 24 deletions

View File

@ -26,6 +26,11 @@
"eip1052Transition": "0x0", "eip1052Transition": "0x0",
"eip1283Transition": "0x0", "eip1283Transition": "0x0",
"eip1283DisableTransition": "0x0", "eip1283DisableTransition": "0x0",
"eip1283ReenableTransition": "0x17d433",
"eip1344Transition": "0x17d433",
"eip1706Transition": "0x17d433",
"eip1884Transition": "0x17d433",
"eip2028Transition": "0x17d433",
"gasLimitBoundDivisor": "0x400", "gasLimitBoundDivisor": "0x400",
"maxCodeSize": "0x6000", "maxCodeSize": "0x6000",
"maxCodeSizeTransition": "0x0", "maxCodeSizeTransition": "0x0",
@ -126,7 +131,7 @@
"builtin": { "builtin": {
"name": "alt_bn128_add", "name": "alt_bn128_add",
"activate_at": "0x00", "activate_at": "0x00",
"eip1108_transition": "0x7fffffffffffff", "eip1108_transition": "0x17d433",
"pricing": { "pricing": {
"alt_bn128_const_operations": { "alt_bn128_const_operations": {
"price": 500, "price": 500,
@ -140,7 +145,7 @@
"builtin": { "builtin": {
"name": "alt_bn128_mul", "name": "alt_bn128_mul",
"activate_at": "0x00", "activate_at": "0x00",
"eip1108_transition": "0x7fffffffffffff", "eip1108_transition": "0x17d433",
"pricing": { "pricing": {
"alt_bn128_const_operations": { "alt_bn128_const_operations": {
"price": 40000, "price": 40000,
@ -154,7 +159,7 @@
"builtin": { "builtin": {
"name": "alt_bn128_pairing", "name": "alt_bn128_pairing",
"activate_at": "0x00", "activate_at": "0x00",
"eip1108_transition": "0x7fffffffffffff", "eip1108_transition": "0x17d433",
"pricing": { "pricing": {
"alt_bn128_pairing": { "alt_bn128_pairing": {
"base": 100000, "base": 100000,
@ -166,7 +171,16 @@
} }
}, },
"0x0000000000000000000000000000000000000009": { "0x0000000000000000000000000000000000000009": {
"balance": "0x1" "balance": "0x1",
"builtin": {
"name": "blake2_f",
"activate_at": "0x17d433",
"pricing": {
"blake2_f": {
"gas_per_round": 1
}
}
}
}, },
"0x000000000000000000000000000000000000000a": { "0x000000000000000000000000000000000000000a": {
"balance": "0x1" "balance": "0x1"

View File

@ -0,0 +1,120 @@
{
"name": "Istanbul (test)",
"engine": {
"Ethash": {
"params": {
"minimumDifficulty": "0x020000",
"difficultyBoundDivisor": "0x0800",
"durationLimit": "0x0d",
"blockReward": "0x1BC16D674EC80000",
"homesteadTransition": "0x0",
"eip100bTransition": "0x0",
"difficultyBombDelays": {
"0": 5000000
}
}
}
},
"params": {
"gasLimitBoundDivisor": "0x0400",
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
"accountStartNonce": "0x00",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID" : "0x1",
"maxCodeSize": 24576,
"maxCodeSizeTransition": "0x0",
"eip150Transition": "0x0",
"eip160Transition": "0x0",
"eip161abcTransition": "0x0",
"eip161dTransition": "0x0",
"eip140Transition": "0x0",
"eip211Transition": "0x0",
"eip214Transition": "0x0",
"eip155Transition": "0x0",
"eip658Transition": "0x0",
"eip145Transition": "0x0",
"eip1014Transition": "0x0",
"eip1052Transition": "0x0",
"eip1283Transition": "0x0",
"eip1283DisableTransition": "0x0",
"eip1283ReenableTransition": "0x0",
"eip1344Transition": "0x0",
"eip1706Transition": "0x0",
"eip1884Transition": "0x0",
"eip2028Transition": "0x0"
},
"genesis": {
"seal": {
"ethereum": {
"nonce": "0x0000000000000042",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"difficulty": "0x400000000",
"author": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",
"gasLimit": "0x1388"
},
"accounts": {
"0000000000000000000000000000000000000001": { "balance": "1", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } },
"0000000000000000000000000000000000000002": { "balance": "1", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } },
"0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
"0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
"0000000000000000000000000000000000000005": { "builtin": { "name": "modexp", "activate_at": "0x00", "pricing": { "modexp": { "divisor": 20 } } } },
"0000000000000000000000000000000000000006": {
"builtin": {
"name": "alt_bn128_add",
"activate_at": "0x00",
"eip1108_transition": "0x0",
"pricing": {
"alt_bn128_const_operations": {
"price": 500,
"eip1108_transition_price": 150
}
}
}
},
"0000000000000000000000000000000000000007": {
"builtin": {
"name": "alt_bn128_mul",
"activate_at": "0x00",
"eip1108_transition": "0x0",
"pricing": {
"alt_bn128_const_operations": {
"price": 40000,
"eip1108_transition_price": 6000
}
}
}
},
"0000000000000000000000000000000000000008": {
"builtin": {
"name": "alt_bn128_pairing",
"activate_at": "0x00",
"eip1108_transition": "0x0",
"pricing": {
"alt_bn128_pairing": {
"base": 100000,
"pair": 80000,
"eip1108_transition_base": 45000,
"eip1108_transition_pair": 34000
}
}
}
},
"0000000000000000000000000000000000000009": {
"builtin": {
"name": "blake2_f",
"activate_at": "0x00",
"pricing": {
"blake2_f": {
"gas_per_round": 1
}
}
}
}
}
}

View File

@ -64,6 +64,11 @@
"eip1052Transition": "0x8c6180", "eip1052Transition": "0x8c6180",
"eip1283Transition": "0x8c6180", "eip1283Transition": "0x8c6180",
"eip1283DisableTransition": "0x9c7b61", "eip1283DisableTransition": "0x9c7b61",
"eip1283ReenableTransition": "0xd751a5",
"eip1344Transition": "0xd751a5",
"eip1706Transition": "0xd751a5",
"eip1884Transition": "0xd751a5",
"eip2028Transition": "0xd751a5",
"kip4Transition": "0x8c6180", "kip4Transition": "0x8c6180",
"kip6Transition": "0x8c6180" "kip6Transition": "0x8c6180"
}, },
@ -5344,7 +5349,7 @@
"builtin": { "builtin": {
"name": "alt_bn128_add", "name": "alt_bn128_add",
"activate_at": "0x4d50f8", "activate_at": "0x4d50f8",
"eip1108_transition": "0x7fffffffffffff", "eip1108_transition": "0xd751a5",
"pricing": { "pricing": {
"alt_bn128_const_operations": { "alt_bn128_const_operations": {
"price": 500, "price": 500,
@ -5357,7 +5362,7 @@
"builtin": { "builtin": {
"name": "alt_bn128_mul", "name": "alt_bn128_mul",
"activate_at": "0x4d50f8", "activate_at": "0x4d50f8",
"eip1108_transition": "0x7fffffffffffff", "eip1108_transition": "0xd751a5",
"pricing": { "pricing": {
"alt_bn128_const_operations": { "alt_bn128_const_operations": {
"price": 40000, "price": 40000,
@ -5370,7 +5375,7 @@
"builtin": { "builtin": {
"name": "alt_bn128_pairing", "name": "alt_bn128_pairing",
"activate_at": "0x4d50f8", "activate_at": "0x4d50f8",
"eip1108_transition": "0x7fffffffffffff", "eip1108_transition": "0xd751a5",
"pricing": { "pricing": {
"alt_bn128_pairing": { "alt_bn128_pairing": {
"base": 100000, "base": 100000,
@ -5381,6 +5386,17 @@
} }
} }
}, },
"0x0000000000000000000000000000000000000009": {
"builtin": {
"name": "blake2_f",
"activate_at": "0xd751a5",
"pricing": {
"blake2_f": {
"gas_per_round": 1
}
}
}
},
"0x00521965e7bd230323c423d96c657db5b79d099f": { "0x00521965e7bd230323c423d96c657db5b79d099f": {
"balance": "1606938044258990275541962092341162602522202993782792835301376" "balance": "1606938044258990275541962092341162602522202993782792835301376"
} }

View File

@ -26,6 +26,11 @@
"eip1052Transition": "0x37db77", "eip1052Transition": "0x37db77",
"eip1283Transition": "0x37db77", "eip1283Transition": "0x37db77",
"eip1283DisableTransition": "0x41efd2", "eip1283DisableTransition": "0x41efd2",
"eip1283ReenableTransition": "0x52efd1",
"eip1344Transition": "0x52efd1",
"eip1706Transition": "0x52efd1",
"eip1884Transition": "0x52efd1",
"eip2028Transition": "0x52efd1",
"gasLimitBoundDivisor": "0x400", "gasLimitBoundDivisor": "0x400",
"maxCodeSize": "0x6000", "maxCodeSize": "0x6000",
"maxCodeSizeTransition": "0x0", "maxCodeSizeTransition": "0x0",
@ -120,7 +125,7 @@
"builtin": { "builtin": {
"name": "alt_bn128_add", "name": "alt_bn128_add",
"activate_at": "0xfcc25", "activate_at": "0xfcc25",
"eip1108_transition": "0x7fffffffffffff", "eip1108_transition": "0x52efd1",
"pricing": { "pricing": {
"alt_bn128_const_operations": { "alt_bn128_const_operations": {
"price": 500, "price": 500,
@ -133,7 +138,7 @@
"builtin": { "builtin": {
"name": "alt_bn128_mul", "name": "alt_bn128_mul",
"activate_at": "0xfcc25", "activate_at": "0xfcc25",
"eip1108_transition": "0x7fffffffffffff", "eip1108_transition": "0x52efd1",
"pricing": { "pricing": {
"alt_bn128_const_operations": { "alt_bn128_const_operations": {
"price": 40000, "price": 40000,
@ -146,7 +151,7 @@
"builtin": { "builtin": {
"name": "alt_bn128_pairing", "name": "alt_bn128_pairing",
"activate_at": "0xfcc25", "activate_at": "0xfcc25",
"eip1108_transition": "0x7fffffffffffff", "eip1108_transition": "0x52efd1",
"pricing": { "pricing": {
"alt_bn128_pairing": { "alt_bn128_pairing": {
"base": 100000, "base": 100000,
@ -158,7 +163,16 @@
} }
}, },
"0x0000000000000000000000000000000000000009": { "0x0000000000000000000000000000000000000009": {
"balance": "0x1" "balance": "0x1",
"builtin": {
"name": "blake2_f",
"activate_at": "0x52efd1",
"pricing": {
"blake2_f": {
"gas_per_round": 1
}
}
}
}, },
"0x000000000000000000000000000000000000000a": { "0x000000000000000000000000000000000000000a": {
"balance": "0x1" "balance": "0x1"

View File

@ -45,7 +45,12 @@
"eip1014Transition": "0x408b70", "eip1014Transition": "0x408b70",
"eip1052Transition": "0x408b70", "eip1052Transition": "0x408b70",
"eip1283Transition": "0x408b70", "eip1283Transition": "0x408b70",
"eip1283DisableTransition": "0x4b5e82" "eip1283DisableTransition": "0x4b5e82",
"eip1283ReenableTransition": "0x62f756",
"eip1344Transition": "0x62f756",
"eip1706Transition": "0x62f756",
"eip1884Transition": "0x62f756",
"eip2028Transition": "0x62f756"
}, },
"genesis": { "genesis": {
"seal": { "seal": {
@ -2735,7 +2740,7 @@
"builtin": { "builtin": {
"name": "alt_bn128_add", "name": "alt_bn128_add",
"activate_at": "0x19f0a0", "activate_at": "0x19f0a0",
"eip1108_transition": "0x7fffffffffffff", "eip1108_transition": "0x62f756",
"pricing": { "pricing": {
"alt_bn128_const_operations": { "alt_bn128_const_operations": {
"price": 500, "price": 500,
@ -2750,7 +2755,7 @@
"builtin": { "builtin": {
"name": "alt_bn128_mul", "name": "alt_bn128_mul",
"activate_at": "0x19f0a0", "activate_at": "0x19f0a0",
"eip1108_transition": "0x7fffffffffffff", "eip1108_transition": "0x62f756",
"pricing": { "pricing": {
"alt_bn128_const_operations": { "alt_bn128_const_operations": {
"price": 40000, "price": 40000,
@ -2765,7 +2770,7 @@
"builtin": { "builtin": {
"name": "alt_bn128_pairing", "name": "alt_bn128_pairing",
"activate_at": "0x19f0a0", "activate_at": "0x19f0a0",
"eip1108_transition": "0x7fffffffffffff", "eip1108_transition": "0x62f756",
"pricing": { "pricing": {
"alt_bn128_pairing": { "alt_bn128_pairing": {
"base": 100000, "base": 100000,
@ -2777,7 +2782,16 @@
} }
}, },
"0x0000000000000000000000000000000000000009": { "0x0000000000000000000000000000000000000009": {
"balance": "0x1" "balance": "0x1",
"builtin": {
"name": "blake2_f",
"activate_at": "0x62f756",
"pricing": {
"blake2_f": {
"gas_per_round": 1
}
}
}
}, },
"0x000000000000000000000000000000000000000a": { "0x000000000000000000000000000000000000000a": {
"balance": "0x0" "balance": "0x0"

View File

@ -36,6 +36,7 @@
"eip145Transition": "0x0", "eip145Transition": "0x0",
"eip1014Transition": "0x0", "eip1014Transition": "0x0",
"eip1052Transition": "0x0", "eip1052Transition": "0x0",
"eip1283Transition": "0x0",
"eip1283DisableTransition": "0x0" "eip1283DisableTransition": "0x0"
}, },
"genesis": { "genesis": {

View File

@ -235,8 +235,8 @@ impl Builtin {
impl From<ethjson::spec::Builtin> for Builtin { impl From<ethjson::spec::Builtin> for Builtin {
fn from(b: ethjson::spec::Builtin) -> Self { fn from(b: ethjson::spec::Builtin) -> Self {
let pricer: Box<dyn Pricer> = match b.pricing { let pricer: Box<dyn Pricer> = match b.pricing {
ethjson::spec::Pricing::Blake2F(cost_per_round) => { ethjson::spec::Pricing::Blake2F { gas_per_round } => {
Box::new(cost_per_round) Box::new(gas_per_round)
}, },
ethjson::spec::Pricing::Linear(linear) => { ethjson::spec::Pricing::Linear(linear) => {
Box::new(Linear { Box::new(Linear {

View File

@ -94,6 +94,7 @@ impl<'a> EvmTestClient<'a> {
ForkSpec::Byzantium => Some(ethereum::new_byzantium_test()), ForkSpec::Byzantium => Some(ethereum::new_byzantium_test()),
ForkSpec::Constantinople => Some(ethereum::new_constantinople_test()), ForkSpec::Constantinople => Some(ethereum::new_constantinople_test()),
ForkSpec::ConstantinopleFix => Some(ethereum::new_constantinople_fix_test()), ForkSpec::ConstantinopleFix => Some(ethereum::new_constantinople_fix_test()),
ForkSpec::Istanbul => Some(ethereum::new_istanbul_test()),
ForkSpec::EIP158ToByzantiumAt5 => Some(ethereum::new_transition_test()), ForkSpec::EIP158ToByzantiumAt5 => Some(ethereum::new_transition_test()),
ForkSpec::FrontierToHomesteadAt5 | ForkSpec::HomesteadToDaoAt5 | ForkSpec::HomesteadToEIP150At5 => None, ForkSpec::FrontierToHomesteadAt5 | ForkSpec::HomesteadToDaoAt5 | ForkSpec::HomesteadToEIP150At5 => None,
} }

View File

@ -166,6 +166,9 @@ pub fn new_constantinople_test() -> Spec { load(None, include_bytes!("../../res/
/// Create a new Foundation St. Peter's (Contantinople Fix) era spec. /// Create a new Foundation St. Peter's (Contantinople Fix) era spec.
pub fn new_constantinople_fix_test() -> Spec { load(None, include_bytes!("../../res/ethereum/st_peters_test.json")) } pub fn new_constantinople_fix_test() -> Spec { load(None, include_bytes!("../../res/ethereum/st_peters_test.json")) }
/// Create a new Foundation Istanbul era spec.
pub fn new_istanbul_test() -> Spec { load(None, include_bytes!("../../res/ethereum/istanbul_test.json")) }
/// Create a new Musicoin-MCIP3-era spec. /// Create a new Musicoin-MCIP3-era spec.
pub fn new_mcip3_test() -> Spec { load(None, include_bytes!("../../res/ethereum/mcip3_test.json")) } pub fn new_mcip3_test() -> Spec { load(None, include_bytes!("../../res/ethereum/mcip3_test.json")) }
@ -189,6 +192,9 @@ pub fn new_constantinople_test_machine() -> EthereumMachine { load_machine(inclu
/// Create a new Foundation St. Peter's (Contantinople Fix) era spec. /// Create a new Foundation St. Peter's (Contantinople Fix) era spec.
pub fn new_constantinople_fix_test_machine() -> EthereumMachine { load_machine(include_bytes!("../../res/ethereum/st_peters_test.json")) } pub fn new_constantinople_fix_test_machine() -> EthereumMachine { load_machine(include_bytes!("../../res/ethereum/st_peters_test.json")) }
/// Create a new Foundation Istanbul era spec.
pub fn new_istanbul_test_machine() -> EthereumMachine { load_machine(include_bytes!("../../res/ethereum/istanbul_test.json")) }
/// Create a new Musicoin-MCIP3-era spec. /// Create a new Musicoin-MCIP3-era spec.
pub fn new_mcip3_test_machine() -> EthereumMachine { load_machine(include_bytes!("../../res/ethereum/mcip3_test.json")) } pub fn new_mcip3_test_machine() -> EthereumMachine { load_machine(include_bytes!("../../res/ethereum/mcip3_test.json")) }

View File

@ -83,8 +83,11 @@ Transaction options:
--gas-price WEI Supplied gas price as hex (without 0x). --gas-price WEI Supplied gas price as hex (without 0x).
State test options: State test options:
--chain CHAIN Run only from specific chain name (i.e. one of EIP150, EIP158,
Frontier, Homestead, Byzantium, Constantinople,
ConstantinopleFix, Istanbul, EIP158ToByzantiumAt5, FrontierToHomesteadAt5,
HomesteadToDaoAt5, HomesteadToEIP150At5).
--only NAME Runs only a single test matching the name. --only NAME Runs only a single test matching the name.
--chain CHAIN Run only tests from specific chain.
General options: General options:
--json Display verbose results in JSON. --json Display verbose results in JSON.

View File

@ -18,8 +18,6 @@
use uint::Uint; use uint::Uint;
/// Price per round of Blake2 compression.
pub type Blake2F = u64;
/// Linear pricing. /// Linear pricing.
#[derive(Debug, PartialEq, Deserialize, Clone)] #[derive(Debug, PartialEq, Deserialize, Clone)]
@ -69,7 +67,10 @@ pub struct AltBn128Pairing {
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
pub enum Pricing { pub enum Pricing {
/// Pricing for Blake2 compression function: each call costs the same amount per round. /// Pricing for Blake2 compression function: each call costs the same amount per round.
Blake2F(Blake2F), Blake2F {
/// Price per round of Blake2 compression function.
gas_per_round: u64,
},
/// Linear pricing. /// Linear pricing.
Linear(Linear), Linear(Linear),
/// Pricing for modular exponentiation. /// Pricing for modular exponentiation.
@ -117,11 +118,11 @@ mod tests {
let s = r#"{ let s = r#"{
"name": "blake2_f", "name": "blake2_f",
"activate_at": "0xffffff", "activate_at": "0xffffff",
"pricing": { "blake2_f": 123 } "pricing": { "blake2_f": { "gas_per_round": 123 } }
}"#; }"#;
let deserialized: Builtin = serde_json::from_str(s).unwrap(); let deserialized: Builtin = serde_json::from_str(s).unwrap();
assert_eq!(deserialized.name, "blake2_f"); assert_eq!(deserialized.name, "blake2_f");
assert_eq!(deserialized.pricing, Pricing::Blake2F(123)); assert_eq!(deserialized.pricing, Pricing::Blake2F { gas_per_round: 123 });
assert!(deserialized.activate_at.is_some()); assert!(deserialized.activate_at.is_some());
} }

View File

@ -31,6 +31,7 @@ pub enum ForkSpec {
Byzantium, Byzantium,
Constantinople, Constantinople,
ConstantinopleFix, ConstantinopleFix,
Istanbul,
EIP158ToByzantiumAt5, EIP158ToByzantiumAt5,
FrontierToHomesteadAt5, FrontierToHomesteadAt5,
HomesteadToDaoAt5, HomesteadToDaoAt5,