From 9b9e054dc35ae8ca7953a43c8fd3a8c4aa5bfc52 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Mon, 29 Feb 2016 14:29:51 +0300 Subject: [PATCH 1/6] changing x64 asm config --- util/Cargo.toml | 2 +- util/build.rs | 10 +++++++++- util/src/lib.rs | 2 +- util/src/uint.rs | 12 ++++++------ 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/util/Cargo.toml b/util/Cargo.toml index 6a18f80de..b7eafd905 100644 --- a/util/Cargo.toml +++ b/util/Cargo.toml @@ -39,7 +39,7 @@ target_info = "0.1" [features] default = [] dev = ["clippy"] -x64asm = [] [build-dependencies] vergen = "*" +rustc_version = "0.1" diff --git a/util/build.rs b/util/build.rs index 32ee30472..20fd8c15f 100644 --- a/util/build.rs +++ b/util/build.rs @@ -1,6 +1,14 @@ extern crate vergen; +extern crate rustc_version; + + use vergen::*; +use rustc_version::{version_meta, Channel}; fn main() { vergen(OutputFns::all()).unwrap(); -} \ No newline at end of file + + if let Channel::Nightly = version_meta().channel { + println!("cargo:rustc-cfg=x64asm"); + } +} diff --git a/util/src/lib.rs b/util/src/lib.rs index be1e788c9..2a47eb438 100644 --- a/util/src/lib.rs +++ b/util/src/lib.rs @@ -16,7 +16,7 @@ #![warn(missing_docs)] #![cfg_attr(feature="dev", feature(plugin))] -#![cfg_attr(feature="x64asm", feature(asm))] +#![cfg_attr(x64asm, feature(asm))] #![cfg_attr(feature="dev", plugin(clippy))] // Clippy settings diff --git a/util/src/uint.rs b/util/src/uint.rs index 67a6f2ff4..517b7a29f 100644 --- a/util/src/uint.rs +++ b/util/src/uint.rs @@ -51,7 +51,7 @@ macro_rules! impl_map_from { } } -#[cfg(not(all(feature="x64asm", target_arch="x86_64")))] +#[cfg(not(all(x64asm, target_arch="x86_64")))] macro_rules! uint_overflowing_add { ($name:ident, $n_words:expr, $self_expr: expr, $other: expr) => ({ uint_overflowing_add_reg!($name, $n_words, $self_expr, $other) @@ -89,7 +89,7 @@ macro_rules! uint_overflowing_add_reg { } -#[cfg(all(feature="x64asm", target_arch="x86_64"))] +#[cfg(all(x64asm, target_arch="x86_64"))] macro_rules! uint_overflowing_add { (U256, $n_words: expr, $self_expr: expr, $other: expr) => ({ let mut result: [u64; 4] = unsafe { mem::uninitialized() }; @@ -165,7 +165,7 @@ macro_rules! uint_overflowing_add { ) } -#[cfg(not(all(feature="x64asm", target_arch="x86_64")))] +#[cfg(not(all(x64asm, target_arch="x86_64")))] macro_rules! uint_overflowing_sub { ($name:ident, $n_words: expr, $self_expr: expr, $other: expr) => ({ let res = overflowing!((!$other).overflowing_add(From::from(1u64))); @@ -174,7 +174,7 @@ macro_rules! uint_overflowing_sub { }) } -#[cfg(all(feature="x64asm", target_arch="x86_64"))] +#[cfg(all(x64asm, target_arch="x86_64"))] macro_rules! uint_overflowing_sub { (U256, $n_words: expr, $self_expr: expr, $other: expr) => ({ let mut result: [u64; 4] = unsafe { mem::uninitialized() }; @@ -250,7 +250,7 @@ macro_rules! uint_overflowing_sub { }) } -#[cfg(all(feature="x64asm", target_arch="x86_64"))] +#[cfg(all(x64asm, target_arch="x86_64"))] macro_rules! uint_overflowing_mul { (U256, $n_words: expr, $self_expr: expr, $other: expr) => ({ let mut result: [u64; 4] = unsafe { mem::uninitialized() }; @@ -370,7 +370,7 @@ macro_rules! uint_overflowing_mul { ) } -#[cfg(not(all(feature="x64asm", target_arch="x86_64")))] +#[cfg(not(all(x64asm, target_arch="x86_64")))] macro_rules! uint_overflowing_mul { ($name:ident, $n_words: expr, $self_expr: expr, $other: expr) => ({ uint_overflowing_mul_reg!($name, $n_words, $self_expr, $other) From e0c158c12f53088fbeefd75707c9b2ffabf6a4e9 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Mon, 29 Feb 2016 14:40:59 +0300 Subject: [PATCH 2/6] removed space --- util/build.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/util/build.rs b/util/build.rs index 20fd8c15f..b8346c97d 100644 --- a/util/build.rs +++ b/util/build.rs @@ -1,7 +1,6 @@ extern crate vergen; extern crate rustc_version; - use vergen::*; use rustc_version::{version_meta, Channel}; From 6197b3ee60a8271449f186d730cc362917f4fef8 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 29 Feb 2016 12:47:34 +0100 Subject: [PATCH 3/6] New provisional Homestead block. --- ethcore/res/ethereum/frontier.json | 4 ++-- ethcore/res/ethereum/frontier_like_test.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ethcore/res/ethereum/frontier.json b/ethcore/res/ethereum/frontier.json index 6e31a2fce..cd66ad3f1 100644 --- a/ethcore/res/ethereum/frontier.json +++ b/ethcore/res/ethereum/frontier.json @@ -1,9 +1,9 @@ { - "name": "Frontier", + "name": "Frontier/Homestead", "engineName": "Ethash", "params": { "accountStartNonce": "0x00", - "frontierCompatibilityModeLimit": "0x10c8e0", + "frontierCompatibilityModeLimit": "0x118c30", "maximumExtraDataSize": "0x20", "tieBreakingGas": false, "minGasLimit": "0x1388", diff --git a/ethcore/res/ethereum/frontier_like_test.json b/ethcore/res/ethereum/frontier_like_test.json index 553bb8018..3e4108566 100644 --- a/ethcore/res/ethereum/frontier_like_test.json +++ b/ethcore/res/ethereum/frontier_like_test.json @@ -3,7 +3,7 @@ "engineName": "Ethash", "params": { "accountStartNonce": "0x00", - "frontierCompatibilityModeLimit": "0x10c8e0", + "frontierCompatibilityModeLimit": "0x118c30", "maximumExtraDataSize": "0x20", "tieBreakingGas": false, "minGasLimit": "0x1388", From 06623333d9de984c22eaa6adf0e5eed2d168070f Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Mon, 29 Feb 2016 15:23:43 +0300 Subject: [PATCH 4/6] fix tabs --- util/build.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/build.rs b/util/build.rs index b8346c97d..2b581642b 100644 --- a/util/build.rs +++ b/util/build.rs @@ -7,7 +7,7 @@ use rustc_version::{version_meta, Channel}; fn main() { vergen(OutputFns::all()).unwrap(); - if let Channel::Nightly = version_meta().channel { + if let Channel::Nightly = version_meta().channel { println!("cargo:rustc-cfg=x64asm"); - } + } } From 791b0d82aa9273b63889cee6d334ca4205f8e71d Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 29 Feb 2016 14:59:10 +0100 Subject: [PATCH 5/6] Fix panic when downloading stales. --- sync/src/chain.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sync/src/chain.rs b/sync/src/chain.rs index dd89cdbf8..6a7add27f 100644 --- a/sync/src/chain.rs +++ b/sync/src/chain.rs @@ -245,8 +245,8 @@ impl ChainSync { start_block_number: self.starting_block, last_imported_block_number: self.last_imported_block, highest_block_number: self.highest_block, - blocks_received: match self.last_imported_block { None => 0, Some(x) => x - self.starting_block }, - blocks_total: match self.highest_block { None => 0, Some(x) => x - self.starting_block }, + blocks_received: match self.last_imported_block { Some(x) if x > self.starting_block => x - self.starting_block, _ => 0 }, + blocks_total: match self.highest_block { Some(x) if x > self.starting_block => x - self.starting_block, _ => 0 }, num_peers: self.peers.len(), num_active_peers: self.peers.values().filter(|p| p.asking != PeerAsking::Nothing).count(), mem_used: From a1e1f4f87ce1ae37466f04cdf509b000a405b738 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 29 Feb 2016 15:33:33 +0100 Subject: [PATCH 6/6] Disable stTransitionTest until Dimitri updates to correct number. --- ethcore/src/json_tests/state.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethcore/src/json_tests/state.rs b/ethcore/src/json_tests/state.rs index f6b5751a7..b5f28444a 100644 --- a/ethcore/src/json_tests/state.rs +++ b/ethcore/src/json_tests/state.rs @@ -115,7 +115,7 @@ declare_test!{StateTests_stSolidityTest, "StateTests/stSolidityTest"} declare_test!{StateTests_stSpecialTest, "StateTests/stSpecialTest"} declare_test!{StateTests_stSystemOperationsTest, "StateTests/stSystemOperationsTest"} declare_test!{StateTests_stTransactionTest, "StateTests/stTransactionTest"} -declare_test!{StateTests_stTransitionTest, "StateTests/stTransitionTest"} +//declare_test!{StateTests_stTransitionTest, "StateTests/stTransitionTest"} declare_test!{StateTests_stWalletTest, "StateTests/stWalletTest"}