From 3aefa2b960eaee28d9588e6cc5f8907e93b0bcf6 Mon Sep 17 00:00:00 2001 From: Afri Schoedon <5chdn@users.noreply.github.com> Date: Tue, 22 Jan 2019 12:33:45 +0100 Subject: [PATCH] Beta Backports 2.3.1 (#10225) * version: bump beta to 2.3.1 * Fix _cannot recursively call into `Core`_ issue (#10144) * Change igd to github:maufl/rust-igd * Run `igd::search_gateway_from_timeout` from own thread * Update for Android cross-compilation. (#10180) * build-unix update * .gitlab-ci update * Update build-unix.sh add android postprocessing * path to android lib libparity.so * fix path to libparity * add android lib to artifacts * Run all `igd` methods in its own thread (#10195) * Cancel Constantinople HF on POA Core (#10198) * Add EIP-1283 disable transition (#10214) * Enable St-Peters-Fork ("Constantinople Fix") (#10223) * ethcore: disable eip-1283 on kovan block 10255201 * ethcore: disable eip-1283 on ropsten block 4939394 * ethcore: enable st-peters-fork on mainnet block 7280000 * ethcore: fix kovan chain spec * version: update fork blocks * ethcore: disable eip-1283 on sokol block 7026400 --- .gitlab-ci.yml | 3 +- Cargo.lock | 12 +++--- Cargo.toml | 2 +- ethcore/res/ethereum/foundation.json | 11 +++-- ethcore/res/ethereum/kovan.json | 1 + ethcore/res/ethereum/poacore.json | 6 +-- ethcore/res/ethereum/poasokol.json | 3 +- ethcore/res/ethereum/ropsten.json | 3 +- ethcore/src/spec/spec.rs | 8 +++- json/src/spec/params.rs | 3 ++ scripts/gitlab/build-unix.sh | 40 +++++++++-------- util/network-devp2p/src/ip_utils.rs | 64 ++++++++++++++-------------- util/version/Cargo.toml | 8 ++-- 13 files changed, 88 insertions(+), 76 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5d5f483da12..a1a1c979987 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -146,8 +146,9 @@ build-android: script: - scripts/gitlab/build-unix.sh tags: - - rust-arm + - linux-docker allow_failure: true + <<: *collect_artifacts test-beta: stage: optional diff --git a/Cargo.lock b/Cargo.lock index 6b4b2f3e7df..1e28db99dd6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2351,7 +2351,7 @@ dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "jni 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "panic_hook 0.1.0", - "parity-ethereum 2.3.0", + "parity-ethereum 2.3.1", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2369,7 +2369,7 @@ dependencies = [ [[package]] name = "parity-ethereum" -version = "2.3.0" +version = "2.3.1" dependencies = [ "ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2419,7 +2419,7 @@ dependencies = [ "parity-rpc 1.12.0", "parity-runtime 0.1.0", "parity-updater 1.12.0", - "parity-version 2.3.0", + "parity-version 2.3.1", "parity-whisper 0.1.0", "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2571,7 +2571,7 @@ dependencies = [ "parity-crypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-runtime 0.1.0", "parity-updater 1.12.0", - "parity-version 2.3.0", + "parity-version 2.3.1", "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2669,7 +2669,7 @@ dependencies = [ "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-hash-fetch 1.12.0", "parity-path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-version 2.3.0", + "parity-version 2.3.1", "parking_lot 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2679,7 +2679,7 @@ dependencies = [ [[package]] name = "parity-version" -version = "2.3.0" +version = "2.3.1" dependencies = [ "parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index be7a916bf14..ba8758a7cb7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ description = "Parity Ethereum client" name = "parity-ethereum" # NOTE Make sure to update util/version/Cargo.toml as well -version = "2.3.0" +version = "2.3.1" license = "GPL-3.0" authors = ["Parity Technologies "] diff --git a/ethcore/res/ethereum/foundation.json b/ethcore/res/ethereum/foundation.json index 69f150fad61..061c435705a 100644 --- a/ethcore/res/ethereum/foundation.json +++ b/ethcore/res/ethereum/foundation.json @@ -9,7 +9,8 @@ "durationLimit": "0xd", "blockReward": { "0x0": "0x4563918244f40000", - "0x42ae50": "0x29a2241af62c0000" + "0x42ae50": "0x29a2241af62c0000", + "0x6f1580": "0x1bc16d674ec80000" }, "homesteadTransition": "0x118c30", "daoHardforkTransition": "0x1d4c00", @@ -134,7 +135,8 @@ ], "eip100bTransition": "0x42ae50", "difficultyBombDelays": { - "0x42ae50": "0x2dc6c0" + "0x42ae50": "0x2dc6c0", + "0x6f1580": "0x1e8480" } } } @@ -158,7 +160,10 @@ "eip140Transition": "0x42ae50", "eip211Transition": "0x42ae50", "eip214Transition": "0x42ae50", - "eip658Transition": "0x42ae50" + "eip658Transition": "0x42ae50", + "eip145Transition": "0x6f1580", + "eip1014Transition": "0x6f1580", + "eip1052Transition": "0x6f1580" }, "genesis": { "seal": { diff --git a/ethcore/res/ethereum/kovan.json b/ethcore/res/ethereum/kovan.json index 7e4c257c933..a2332c64668 100644 --- a/ethcore/res/ethereum/kovan.json +++ b/ethcore/res/ethereum/kovan.json @@ -49,6 +49,7 @@ "eip1014Transition": "0x8c6180", "eip1052Transition": "0x8c6180", "eip1283Transition": "0x8c6180", + "eip1283DisableTransition": "0x9c7b61", "kip4Transition": "0x8c6180", "kip6Transition": "0x8c6180" }, diff --git a/ethcore/res/ethereum/poacore.json b/ethcore/res/ethereum/poacore.json index 53b3c548c55..9fc34d22a2b 100644 --- a/ethcore/res/ethereum/poacore.json +++ b/ethcore/res/ethereum/poacore.json @@ -34,11 +34,7 @@ "eip140Transition": "0x0", "eip211Transition": "0x0", "eip214Transition": "0x0", - "eip658Transition": "0x0", - "eip145Transition": 6843780, - "eip1014Transition": 6843780, - "eip1052Transition": 6843780, - "eip1283Transition": 6843780 + "eip658Transition": "0x0" }, "genesis": { "seal": { diff --git a/ethcore/res/ethereum/poasokol.json b/ethcore/res/ethereum/poasokol.json index 067fd69fc30..8ee91c90c06 100644 --- a/ethcore/res/ethereum/poasokol.json +++ b/ethcore/res/ethereum/poasokol.json @@ -41,7 +41,8 @@ "eip145Transition": 6464300, "eip1014Transition": 6464300, "eip1052Transition": 6464300, - "eip1283Transition": 6464300 + "eip1283Transition": 6464300, + "eip1283DisableTransition": 7026400 }, "genesis": { "seal": { diff --git a/ethcore/res/ethereum/ropsten.json b/ethcore/res/ethereum/ropsten.json index 1dee7e30f69..c3b2b96b4fb 100644 --- a/ethcore/res/ethereum/ropsten.json +++ b/ethcore/res/ethereum/ropsten.json @@ -44,7 +44,8 @@ "eip145Transition": "0x408b70", "eip1014Transition": "0x408b70", "eip1052Transition": "0x408b70", - "eip1283Transition": "0x408b70" + "eip1283Transition": "0x408b70", + "eip1283DisableTransition": "0x4b5e82" }, "genesis": { "seal": { diff --git a/ethcore/src/spec/spec.rs b/ethcore/src/spec/spec.rs index 9d67bf2c151..517b69e7519 100644 --- a/ethcore/src/spec/spec.rs +++ b/ethcore/src/spec/spec.rs @@ -121,6 +121,8 @@ pub struct CommonParams { pub eip1052_transition: BlockNumber, /// Number of first block where EIP-1283 rules begin. 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. pub eip1014_transition: BlockNumber, /// 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_bitwise_shifting = block_number >= self.eip145_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 { schedule.blockhash_gas = 800; } @@ -300,6 +302,10 @@ impl From for CommonParams { BlockNumber::max_value, 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( BlockNumber::max_value, Into::into, diff --git a/json/src/spec/params.rs b/json/src/spec/params.rs index d64f429bf88..765384a6b91 100644 --- a/json/src/spec/params.rs +++ b/json/src/spec/params.rs @@ -89,6 +89,9 @@ pub struct Params { pub eip1052_transition: Option, /// See `CommonParams` docs. pub eip1283_transition: Option, + /// See `CommonParams` docs. + pub eip1283_disable_transition: Option, + /// See `CommonParams` docs. pub eip1014_transition: Option, /// See `CommonParams` docs. pub dust_protection_transition: Option, diff --git a/scripts/gitlab/build-unix.sh b/scripts/gitlab/build-unix.sh index cf6bfe1476c..9bb6cd0f3f2 100755 --- a/scripts/gitlab/build-unix.sh +++ b/scripts/gitlab/build-unix.sh @@ -10,38 +10,36 @@ echo "CARGO_TARGET: " $CARGO_TARGET echo "CC: " $CC echo "CXX: " $CXX -echo "__________CARGO CONFIG__________" +echo "_____ Building target: "$CARGO_TARGET" _____" if [ "${CARGO_TARGET}" = "armv7-linux-androideabi" ] then - # use build container's cargo config - cat /.cargo/config +# only thing we need for android + time cargo build --target $CARGO_TARGET --release -p parity-clib --features final else - mkdir -p .cargo - rm -f .cargo/config - echo "[target.$CARGO_TARGET]" >> .cargo/config - echo "linker= \"$CC\"" >> .cargo/config - cat .cargo/config + time cargo build --target $CARGO_TARGET --release --features final + time cargo build --target $CARGO_TARGET --release -p evmbin + time cargo build --target $CARGO_TARGET --release -p ethstore-cli + time cargo build --target $CARGO_TARGET --release -p ethkey-cli + time cargo build --target $CARGO_TARGET --release -p whisper-cli fi - -echo "_____ Building target: "$CARGO_TARGET" _____" -time cargo build --target $CARGO_TARGET --release --features final -time cargo build --target $CARGO_TARGET --release -p evmbin -time cargo build --target $CARGO_TARGET --release -p ethstore-cli -time cargo build --target $CARGO_TARGET --release -p ethkey-cli -time cargo build --target $CARGO_TARGET --release -p whisper-cli - echo "_____ Post-processing binaries _____" rm -rf artifacts mkdir -p artifacts cd artifacts mkdir -p $CARGO_TARGET cd $CARGO_TARGET -cp -v ../../target/$CARGO_TARGET/release/parity ./parity -cp -v ../../target/$CARGO_TARGET/release/parity-evm ./parity-evm -cp -v ../../target/$CARGO_TARGET/release/ethstore ./ethstore -cp -v ../../target/$CARGO_TARGET/release/ethkey ./ethkey -cp -v ../../target/$CARGO_TARGET/release/whisper ./whisper +if [ "${CARGO_TARGET}" = "armv7-linux-androideabi" ] +then +# only thing we need for android + cp -v ../../target/$CARGO_TARGET/release/libparity.so ./libparity.so +else + cp -v ../../target/$CARGO_TARGET/release/parity ./parity + cp -v ../../target/$CARGO_TARGET/release/parity-evm ./parity-evm + cp -v ../../target/$CARGO_TARGET/release/ethstore ./ethstore + cp -v ../../target/$CARGO_TARGET/release/ethkey ./ethkey + cp -v ../../target/$CARGO_TARGET/release/whisper ./whisper +fi # stripping can also be done on release build time diff --git a/util/network-devp2p/src/ip_utils.rs b/util/network-devp2p/src/ip_utils.rs index 306f283934a..4b8473ceca8 100644 --- a/util/network-devp2p/src/ip_utils.rs +++ b/util/network-devp2p/src/ip_utils.rs @@ -309,40 +309,40 @@ pub fn select_public_address(port: u16) -> SocketAddr { pub fn map_external_address(local: &NodeEndpoint) -> Option { if let SocketAddr::V4(ref local_addr) = local.address { let local_ip = *local_addr.ip(); + let local_port = local_addr.port(); + let local_udp_port = local.udp_port; + let search_gateway_child = ::std::thread::spawn(move || { - search_gateway_from_timeout(local_ip, Duration::new(5, 0)) + match search_gateway_from_timeout(local_ip, Duration::new(5, 0)) { + Err(ref err) => debug!("Gateway search error: {}", err), + Ok(gateway) => { + match gateway.get_external_ip() { + Err(ref err) => { + debug!("IP request error: {}", err); + }, + Ok(external_addr) => { + match gateway.add_any_port(PortMappingProtocol::TCP, SocketAddrV4::new(local_ip, local_port), 0, "Parity Node/TCP") { + Err(ref err) => { + debug!("Port mapping error: {}", err); + }, + Ok(tcp_port) => { + match gateway.add_any_port(PortMappingProtocol::UDP, SocketAddrV4::new(local_ip, local_udp_port), 0, "Parity Node/UDP") { + Err(ref err) => { + debug!("Port mapping error: {}", err); + }, + Ok(udp_port) => { + return Some(NodeEndpoint { address: SocketAddr::V4(SocketAddrV4::new(external_addr, tcp_port)), udp_port }); + }, + } + }, + } + }, + } + }, + } + None }); - let gateway_result = match search_gateway_child.join() { - Err(_) => return None, - Ok(gateway_result) => gateway_result, - }; - match gateway_result { - Err(ref err) => debug!("Gateway search error: {}", err), - Ok(gateway) => { - match gateway.get_external_ip() { - Err(ref err) => { - debug!("IP request error: {}", err); - }, - Ok(external_addr) => { - match gateway.add_any_port(PortMappingProtocol::TCP, SocketAddrV4::new(*local_addr.ip(), local_addr.port()), 0, "Parity Node/TCP") { - Err(ref err) => { - debug!("Port mapping error: {}", err); - }, - Ok(tcp_port) => { - match gateway.add_any_port(PortMappingProtocol::UDP, SocketAddrV4::new(*local_addr.ip(), local.udp_port), 0, "Parity Node/UDP") { - Err(ref err) => { - debug!("Port mapping error: {}", err); - }, - Ok(udp_port) => { - return Some(NodeEndpoint { address: SocketAddr::V4(SocketAddrV4::new(external_addr, tcp_port)), udp_port }); - }, - } - }, - } - }, - } - }, - } + return search_gateway_child.join().ok()?; } None } diff --git a/util/version/Cargo.toml b/util/version/Cargo.toml index 093c61fde30..29531b078c1 100644 --- a/util/version/Cargo.toml +++ b/util/version/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "parity-version" # NOTE: this value is used for Parity Ethereum version string (via env CARGO_PKG_VERSION) -version = "2.3.0" +version = "2.3.1" authors = ["Parity Technologies "] build = "build.rs" @@ -16,9 +16,9 @@ track = "beta" # Latest supported fork blocks. # Indicates a critical release in this track (i.e. consensus issue). [package.metadata.networks] -foundation = { forkBlock = 4370000, critical = true } -ropsten = { forkBlock = 4230000, critical = false } -kovan = { forkBlock = 9200000, critical = true } +foundation = { forkBlock = 7280000, critical = false } +ropsten = { forkBlock = 4939394, critical = false } +kovan = { forkBlock = 10255201, critical = false } [dependencies] parity-bytes = "0.1"