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:
@@ -18,8 +18,6 @@
|
||||
|
||||
use uint::Uint;
|
||||
|
||||
/// Price per round of Blake2 compression.
|
||||
pub type Blake2F = u64;
|
||||
|
||||
/// Linear pricing.
|
||||
#[derive(Debug, PartialEq, Deserialize, Clone)]
|
||||
@@ -69,7 +67,10 @@ pub struct AltBn128Pairing {
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum Pricing {
|
||||
/// 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(Linear),
|
||||
/// Pricing for modular exponentiation.
|
||||
@@ -117,11 +118,11 @@ mod tests {
|
||||
let s = r#"{
|
||||
"name": "blake2_f",
|
||||
"activate_at": "0xffffff",
|
||||
"pricing": { "blake2_f": 123 }
|
||||
"pricing": { "blake2_f": { "gas_per_round": 123 } }
|
||||
}"#;
|
||||
let deserialized: Builtin = serde_json::from_str(s).unwrap();
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ pub enum ForkSpec {
|
||||
Byzantium,
|
||||
Constantinople,
|
||||
ConstantinopleFix,
|
||||
Istanbul,
|
||||
EIP158ToByzantiumAt5,
|
||||
FrontierToHomesteadAt5,
|
||||
HomesteadToDaoAt5,
|
||||
|
||||
Reference in New Issue
Block a user