From 47848769ff858f95e38ae2d72162aa1c3c5df4f1 Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Fri, 28 Sep 2018 14:26:38 +0100 Subject: [PATCH 1/9] refactor(fetch) : light use only one `DNS` thread (#9647) * refactor(fetch) : light use only one `DNS` thread * grumbles(fetch) : pass number of threads directly --- parity/run.rs | 12 +++++++++--- util/fetch/src/client.rs | 35 +++++++++++++++++++++++------------ 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/parity/run.rs b/parity/run.rs index 0d122e2bcc0..1ebbfb6a877 100644 --- a/parity/run.rs +++ b/parity/run.rs @@ -77,7 +77,13 @@ const SNAPSHOT_HISTORY: u64 = 100; const GAS_CORPUS_EXPIRATION_MINUTES: u64 = 60 * 6; // Pops along with error messages when a password is missing or invalid. -const VERIFY_PASSWORD_HINT: &'static str = "Make sure valid password is present in files passed using `--password` or in the configuration file."; +const VERIFY_PASSWORD_HINT: &str = "Make sure valid password is present in files passed using `--password` or in the configuration file."; + +// Full client number of DNS threads +const FETCH_FULL_NUM_DNS_THREADS: usize = 4; + +// Light client number of DNS threads +const FETCH_LIGHT_NUM_DNS_THREADS: usize = 1; #[derive(Debug, PartialEq)] pub struct RunCmd { @@ -283,7 +289,7 @@ fn execute_light_impl(cmd: RunCmd, logger: Arc) -> Result(cmd: RunCmd, logger: Arc, on_client_rq: let event_loop = EventLoop::spawn(); // fetch service - let fetch = fetch::Client::new().map_err(|e| format!("Error starting fetch client: {:?}", e))?; + let fetch = fetch::Client::new(FETCH_FULL_NUM_DNS_THREADS).map_err(|e| format!("Error starting fetch client: {:?}", e))?; let txpool_size = cmd.miner_options.pool_limits.max_count; // create miner diff --git a/util/fetch/src/client.rs b/util/fetch/src/client.rs index 03a3a5a2c00..3f1f274e077 100644 --- a/util/fetch/src/client.rs +++ b/util/fetch/src/client.rs @@ -170,11 +170,11 @@ impl Drop for Client { impl Client { /// Create a new fetch client. - pub fn new() -> Result { + pub fn new(num_dns_threads: usize) -> Result { let (tx_start, rx_start) = std::sync::mpsc::sync_channel(1); let (tx_proto, rx_proto) = mpsc::channel(64); - Client::background_thread(tx_start, rx_proto)?; + Client::background_thread(tx_start, rx_proto, num_dns_threads)?; match rx_start.recv_timeout(Duration::from_secs(10)) { Err(RecvTimeoutError::Timeout) => { @@ -199,7 +199,7 @@ impl Client { }) } - fn background_thread(tx_start: TxStartup, rx_proto: mpsc::Receiver) -> io::Result> { + fn background_thread(tx_start: TxStartup, rx_proto: mpsc::Receiver, num_dns_threads: usize) -> io::Result> { thread::Builder::new().name("fetch".into()).spawn(move || { let mut core = match reactor::Core::new() { Ok(c) => c, @@ -208,7 +208,7 @@ impl Client { let handle = core.handle(); let hyper = hyper::Client::configure() - .connector(hyper_rustls::HttpsConnector::new(4, &core.handle())) + .connector(hyper_rustls::HttpsConnector::new(num_dns_threads, &core.handle())) .build(&core.handle()); let future = rx_proto.take_while(|item| Ok(item.is_some())) @@ -640,7 +640,18 @@ mod test { #[test] fn it_should_fetch() { let server = TestServer::run(); - let client = Client::new().unwrap(); + let client = Client::new(4).unwrap(); + let future = client.get(&format!("http://{}?123", server.addr()), Default::default()); + let resp = future.wait().unwrap(); + assert!(resp.is_success()); + let body = resp.concat2().wait().unwrap(); + assert_eq!(&body[..], b"123") + } + + #[test] + fn it_should_fetch_in_light_mode() { + let server = TestServer::run(); + let client = Client::new(1).unwrap(); let future = client.get(&format!("http://{}?123", server.addr()), Default::default()); let resp = future.wait().unwrap(); assert!(resp.is_success()); @@ -651,7 +662,7 @@ mod test { #[test] fn it_should_timeout() { let server = TestServer::run(); - let client = Client::new().unwrap(); + let client = Client::new(4).unwrap(); let abort = Abort::default().with_max_duration(Duration::from_secs(1)); match client.get(&format!("http://{}/delay?3", server.addr()), abort).wait() { Err(Error::Timeout) => {} @@ -662,7 +673,7 @@ mod test { #[test] fn it_should_follow_redirects() { let server = TestServer::run(); - let client = Client::new().unwrap(); + let client = Client::new(4).unwrap(); let abort = Abort::default(); let future = client.get(&format!("http://{}/redirect?http://{}/", server.addr(), server.addr()), abort); assert!(future.wait().unwrap().is_success()) @@ -671,7 +682,7 @@ mod test { #[test] fn it_should_follow_relative_redirects() { let server = TestServer::run(); - let client = Client::new().unwrap(); + let client = Client::new(4).unwrap(); let abort = Abort::default().with_max_redirects(4); let future = client.get(&format!("http://{}/redirect?/", server.addr()), abort); assert!(future.wait().unwrap().is_success()) @@ -680,7 +691,7 @@ mod test { #[test] fn it_should_not_follow_too_many_redirects() { let server = TestServer::run(); - let client = Client::new().unwrap(); + let client = Client::new(4).unwrap(); let abort = Abort::default().with_max_redirects(3); match client.get(&format!("http://{}/loop", server.addr()), abort).wait() { Err(Error::TooManyRedirects) => {} @@ -691,7 +702,7 @@ mod test { #[test] fn it_should_read_data() { let server = TestServer::run(); - let client = Client::new().unwrap(); + let client = Client::new(4).unwrap(); let abort = Abort::default(); let future = client.get(&format!("http://{}?abcdefghijklmnopqrstuvwxyz", server.addr()), abort); let resp = future.wait().unwrap(); @@ -702,7 +713,7 @@ mod test { #[test] fn it_should_not_read_too_much_data() { let server = TestServer::run(); - let client = Client::new().unwrap(); + let client = Client::new(4).unwrap(); let abort = Abort::default().with_max_size(3); let resp = client.get(&format!("http://{}/?1234", server.addr()), abort).wait().unwrap(); assert!(resp.is_success()); @@ -715,7 +726,7 @@ mod test { #[test] fn it_should_not_read_too_much_data_sync() { let server = TestServer::run(); - let client = Client::new().unwrap(); + let client = Client::new(4).unwrap(); let abort = Abort::default().with_max_size(3); let resp = client.get(&format!("http://{}/?1234", server.addr()), abort).wait().unwrap(); assert!(resp.is_success()); From 984493db30f4ba9a078861d979a5f8d3cc26402a Mon Sep 17 00:00:00 2001 From: ddorgan Date: Fri, 28 Sep 2018 18:52:15 +0100 Subject: [PATCH 2/9] Test fix for windows cache name... (#9658) * Test fix for windows cache name... * Fix variable name. --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b0a665a3980..509ef126244 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -100,7 +100,7 @@ test-android-rust-stable: test-windows-rust-stable: stage: test cache: - key: "%CI_JOB_NAME%" + key: "${CI_JOB_NAME}" paths: - "%CI_PROJECT_DIR%/target/" - "%CI_PROJECT_DIR%/cargo/" @@ -208,7 +208,7 @@ build-windows-msvc-x86_64: stage: build only: *releaseable_branches cache: - key: "%CI_JOB_NAME%" + key: "${CI_JOB_NAME}" paths: - "%CI_PROJECT_DIR%/target/" - "%CI_PROJECT_DIR%/cargo/" From 2d44b3ebeac364436a36ae9af2f771383e86e7ad Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Sat, 29 Sep 2018 22:22:36 +0200 Subject: [PATCH 3/9] fix(light_fetch): avoid race with BlockNumber::Latest (#9665) --- rpc/src/v1/helpers/light_fetch.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpc/src/v1/helpers/light_fetch.rs b/rpc/src/v1/helpers/light_fetch.rs index 88821c572f0..ade100baa5a 100644 --- a/rpc/src/v1/helpers/light_fetch.rs +++ b/rpc/src/v1/helpers/light_fetch.rs @@ -250,7 +250,8 @@ impl LightFetch { }).join(header_fut).and_then(move |((gas_known, tx), hdr)| { // then request proved execution. // TODO: get last-hashes from network. - let env_info = match client.env_info(id) { + let hash = hdr.hash(); + let env_info = match client.env_info(BlockId::Hash(hash)) { Some(env_info) => env_info, _ => return Either::A(future::err(errors::unknown_block())), }; From ebaa43fa4cee9f45d701c9a06f693061e4e5557f Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Sat, 29 Sep 2018 21:25:16 +0100 Subject: [PATCH 4/9] ethcore-io retries failed work steal (#9651) * ethcore-io uses newer version of crossbeam && retries failed work steal * ethcore-io non-mio service uses newer crossbeam --- Cargo.lock | 4 ++-- ethcore/src/engines/tendermint/mod.rs | 1 - util/io/Cargo.toml | 2 +- util/io/src/lib.rs | 2 +- util/io/src/service_mio.rs | 14 +++++++------- util/io/src/service_non_mio.rs | 22 +++++++++++----------- util/io/src/worker.rs | 14 ++++++++------ 7 files changed, 30 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69773af63c6..c0c020162ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -600,7 +600,7 @@ version = "1.12.0" name = "ethcore-io" version = "1.12.0" dependencies = [ - "crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2296,7 +2296,7 @@ source = "git+https://github.com/nikvolf/parity-tokio-ipc#c0f80b40399d7f08ef1e68 dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio-named-pipes 0.1.6 (git+https://github.com/alexcrichton/mio-named-pipes)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/ethcore/src/engines/tendermint/mod.rs b/ethcore/src/engines/tendermint/mod.rs index 2d0015d06b2..70d78147e42 100644 --- a/ethcore/src/engines/tendermint/mod.rs +++ b/ethcore/src/engines/tendermint/mod.rs @@ -693,7 +693,6 @@ impl Engine for Tendermint { } fn stop(&self) { - self.step_service.stop() } fn is_proposal(&self, header: &Header) -> bool { diff --git a/util/io/Cargo.toml b/util/io/Cargo.toml index ad50881ddfa..e53b302b7fe 100644 --- a/util/io/Cargo.toml +++ b/util/io/Cargo.toml @@ -9,7 +9,7 @@ authors = ["Parity Technologies "] [dependencies] fnv = "1.0" mio = { version = "0.6.8", optional = true } -crossbeam = "0.3" +crossbeam-deque = "0.6" parking_lot = "0.6" log = "0.4" slab = "0.4" diff --git a/util/io/src/lib.rs b/util/io/src/lib.rs index 02dbf223be4..3aa51fbdf9d 100644 --- a/util/io/src/lib.rs +++ b/util/io/src/lib.rs @@ -74,7 +74,7 @@ extern crate mio; #[macro_use] extern crate log as rlog; extern crate slab; -extern crate crossbeam; +extern crate crossbeam_deque as deque; extern crate parking_lot; extern crate num_cpus; extern crate timer; diff --git a/util/io/src/service_mio.rs b/util/io/src/service_mio.rs index 729fcec176e..07d0f8106bb 100644 --- a/util/io/src/service_mio.rs +++ b/util/io/src/service_mio.rs @@ -20,7 +20,7 @@ use std::collections::HashMap; use mio::*; use mio::timer::{Timeout}; use mio::deprecated::{EventLoop, Handler, Sender, EventLoopBuilder}; -use crossbeam::sync::chase_lev; +use deque; use slab::Slab; use {IoError, IoHandler}; use worker::{Worker, Work, WorkType}; @@ -184,7 +184,7 @@ pub struct IoManager where Message: Send + Sync { timers: Arc>>, handlers: Arc>>>>, workers: Vec, - worker_channel: chase_lev::Worker>, + worker_channel: deque::Worker>, work_ready: Arc, } @@ -194,7 +194,7 @@ impl IoManager where Message: Send + Sync + 'static { event_loop: &mut EventLoop>, handlers: Arc>>>> ) -> Result<(), IoError> { - let (worker, stealer) = chase_lev::deque(); + let (worker, stealer) = deque::fifo(); let num_workers = 4; let work_ready_mutex = Arc::new(Mutex::new(())); let work_ready = Arc::new(Condvar::new()); @@ -430,7 +430,7 @@ impl IoChannel where Message: Send + Sync + 'static { /// General IO Service. Starts an event loop and dispatches IO requests. /// 'Message' is a notification message type pub struct IoService where Message: Send + Sync + 'static { - thread: Mutex>>, + thread: Option>, host_channel: Mutex>>, handlers: Arc>>>>, } @@ -448,19 +448,19 @@ impl IoService where Message: Send + Sync + 'static { IoManager::::start(&mut event_loop, h).expect("Error starting IO service"); }); Ok(IoService { - thread: Mutex::new(Some(thread)), + thread: Some(thread), host_channel: Mutex::new(channel), handlers: handlers, }) } - pub fn stop(&self) { + pub fn stop(&mut self) { trace!(target: "shutdown", "[IoService] Closing..."); // Clear handlers so that shared pointers are not stuck on stack // in Channel::send_sync self.handlers.write().clear(); self.host_channel.lock().send(IoMessage::Shutdown).unwrap_or_else(|e| warn!("Error on IO service shutdown: {:?}", e)); - if let Some(thread) = self.thread.lock().take() { + if let Some(thread) = self.thread.take() { thread.join().unwrap_or_else(|e| { debug!(target: "shutdown", "Error joining IO service event loop thread: {:?}", e); }); diff --git a/util/io/src/service_non_mio.rs b/util/io/src/service_non_mio.rs index 315f84c4d1d..30839f9e954 100644 --- a/util/io/src/service_non_mio.rs +++ b/util/io/src/service_non_mio.rs @@ -16,7 +16,7 @@ use std::sync::{Arc, Weak}; use std::thread; -use crossbeam::sync::chase_lev; +use deque; use slab::Slab; use fnv::FnvHashMap; use {IoError, IoHandler}; @@ -198,7 +198,7 @@ struct Shared where Message: Send + Sync + 'static { // necessary. timers: Mutex>, // Channel used to send work to the worker threads. - channel: Mutex>>>, + channel: Mutex>>>, } // Messages used to communicate with the event loop from other threads. @@ -224,7 +224,7 @@ impl Clone for WorkTask where Message: Send + Sized { impl IoService where Message: Send + Sync + 'static { /// Starts IO event loop pub fn start() -> Result, IoError> { - let (tx, rx) = chase_lev::deque(); + let (tx, rx) = deque::fifo(); let shared = Arc::new(Shared { handlers: RwLock::new(Slab::with_capacity(MAX_HANDLERS)), @@ -251,7 +251,7 @@ impl IoService where Message: Send + Sync + 'static { } /// Stops the IO service. - pub fn stop(&self) { + pub fn stop(&mut self) { trace!(target: "shutdown", "[IoService] Closing..."); // Clear handlers so that shared pointers are not stuck on stack // in Channel::send_sync @@ -307,15 +307,15 @@ impl Drop for IoService where Message: Send + Sync { } } -fn do_work(shared: &Arc>, rx: chase_lev::Stealer>) - where Message: Send + Sync + 'static +fn do_work(shared: &Arc>, rx: deque::Stealer>) + where Message: Send + Sync + 'static { loop { match rx.steal() { - chase_lev::Steal::Abort => continue, - chase_lev::Steal::Empty => thread::park(), - chase_lev::Steal::Data(WorkTask::Shutdown) => break, - chase_lev::Steal::Data(WorkTask::UserMessage(message)) => { + deque::Steal::Retry => continue, + deque::Steal::Empty => thread::park(), + deque::Steal::Data(WorkTask::Shutdown) => break, + deque::Steal::Data(WorkTask::UserMessage(message)) => { for id in 0 .. MAX_HANDLERS { if let Some(handler) = shared.handlers.read().get(id) { let ctxt = IoContext { handler: id, shared: shared.clone() }; @@ -323,7 +323,7 @@ fn do_work(shared: &Arc>, rx: chase_lev::Stealer { + deque::Steal::Data(WorkTask::TimerTrigger { handler_id, token }) => { if let Some(handler) = shared.handlers.read().get(handler_id) { let ctxt = IoContext { handler: handler_id, shared: shared.clone() }; handler.timeout(&ctxt, token); diff --git a/util/io/src/worker.rs b/util/io/src/worker.rs index 2520608483d..1d335941677 100644 --- a/util/io/src/worker.rs +++ b/util/io/src/worker.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use std::thread::{JoinHandle, self}; use std::sync::atomic::{AtomicBool, Ordering as AtomicOrdering}; -use crossbeam::sync::chase_lev; +use deque; use service_mio::{HandlerId, IoChannel, IoContext}; use IoHandler; use LOCAL_STACK_SIZE; @@ -53,7 +53,7 @@ pub struct Worker { impl Worker { /// Creates a new worker instance. pub fn new(index: usize, - stealer: chase_lev::Stealer>, + stealer: deque::Stealer>, channel: IoChannel, wait: Arc, wait_mutex: Arc>, @@ -75,8 +75,9 @@ impl Worker { worker } - fn work_loop(stealer: chase_lev::Stealer>, - channel: IoChannel, wait: Arc, + fn work_loop(stealer: deque::Stealer>, + channel: IoChannel, + wait: Arc, wait_mutex: Arc>, deleting: Arc) where Message: Send + Sync + 'static { @@ -91,8 +92,9 @@ impl Worker { while !deleting.load(AtomicOrdering::Acquire) { match stealer.steal() { - chase_lev::Steal::Data(work) => Worker::do_work(work, channel.clone()), - _ => break, + deque::Steal::Data(work) => Worker::do_work(work, channel.clone()), + deque::Steal::Retry => {}, + deque::Steal::Empty => break, } } } From 856bbfc9c8fc18cd0fbcc347e66c69790065bacf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Sun, 30 Sep 2018 13:42:49 +0200 Subject: [PATCH 5/9] Calculate sha3 instead of sha256 for push-release. (#9673) * Calculate sha3 instead of sha256 for push-release. * Add pushes to the script. --- scripts/gitlab/build-unix.sh | 1 + scripts/gitlab/build-windows.sh | 2 ++ scripts/gitlab/push.sh | 17 ++++++++++++----- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/gitlab/build-unix.sh b/scripts/gitlab/build-unix.sh index 50ae7314c3d..e338a7768f9 100755 --- a/scripts/gitlab/build-unix.sh +++ b/scripts/gitlab/build-unix.sh @@ -32,4 +32,5 @@ echo "_____ Calculating checksums _____" for binary in $(ls) do rhash --sha256 $binary -o $binary.sha256 + ./parity tools hash $binary > $binary.sha3 done diff --git a/scripts/gitlab/build-windows.sh b/scripts/gitlab/build-windows.sh index a5510875c87..fbc76cd268b 100755 --- a/scripts/gitlab/build-windows.sh +++ b/scripts/gitlab/build-windows.sh @@ -31,5 +31,7 @@ echo "_____ Calculating checksums _____" for binary in $(ls) do rhash --sha256 $binary -o $binary.sha256 + parity.exe tools hash $binary > $binary.sha3 done cp parity.exe.sha256 parity.sha256 +cp parity.exe.sha3 parity.sha3 diff --git a/scripts/gitlab/push.sh b/scripts/gitlab/push.sh index 389019a4fac..ec58971c89f 100755 --- a/scripts/gitlab/push.sh +++ b/scripts/gitlab/push.sh @@ -2,11 +2,17 @@ set -e # fail on any error set -u # treat unset variables as error -updater_push_release () { - echo "push release" - # Mainnet -} + +echo "__________Register Release__________" +DATA="secret=$RELEASES_SECRET" + +echo "Pushing release to Mainnet" +../../scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1337/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF" + +echo "Pushing release to Kovan" +../../scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1338/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF" + echo "__________Set ENVIROMENT__________" DESCRIPTION="$(cat CHANGELOG.md)" RELEASE_TABLE="$(cat scripts/gitlab/templates/release-table.md)" @@ -35,9 +41,10 @@ do for binary in $(ls parity.sha256) do sha256=$(cat $binary | awk '{ print $1}' ) + sha3=$(cat ${binary/sha256/sha3} | awk '{ print $1}' ) case $DIR in x86_64* ) - DATA="commit=$CI_BUILD_REF&sha3=$sha256&filename=parity$WIN&secret=$RELEASES_SECRET" + DATA="commit=$CI_BUILD_REF&sha3=$sha3&filename=parity$WIN&secret=$RELEASES_SECRET" ../../scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$DIR" # Kovan ../../scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$DIR" From 85a6dc5e8c21ce2dab2f3218b2480e251479e29c Mon Sep 17 00:00:00 2001 From: Afri Schoedon <5chdn@users.noreply.github.com> Date: Sun, 30 Sep 2018 13:44:17 +0100 Subject: [PATCH 6/9] Hardfork the testnets (#9562) * ethcore: propose hardfork block number 4230000 for ropsten * ethcore: propose hardfork block number 9000000 for kovan * ethcore: enable kip-4 and kip-6 on kovan * etcore: bump kovan hardfork to block 9.2M * ethcore: fix ropsten constantinople block number to 4.2M * ethcore: disable difficulty_test_ropsten until ethereum/tests are updated upstream --- ethcore/res/ethereum/kovan.json | 8 +++++++- ethcore/res/ethereum/ropsten.json | 12 +++++++++--- ethcore/src/json_tests/difficulty.rs | 9 +++++---- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/ethcore/res/ethereum/kovan.json b/ethcore/res/ethereum/kovan.json index 28126713582..453974eaf2c 100644 --- a/ethcore/res/ethereum/kovan.json +++ b/ethcore/res/ethereum/kovan.json @@ -43,7 +43,13 @@ "eip211Transition": 5067000, "eip214Transition": 5067000, "eip658Transition": 5067000, - "wasmActivationTransition": 6600000 + "wasmActivationTransition": 6600000, + "eip145Transition": 9200000, + "eip1014Transition": 9200000, + "eip1052Transition": 9200000, + "eip1283Transition": 9200000, + "kip4Transition": 9200000, + "kip6Transition": 9200000 }, "genesis": { "seal": { diff --git a/ethcore/res/ethereum/ropsten.json b/ethcore/res/ethereum/ropsten.json index 44c0dfe7b89..09ebce8b278 100644 --- a/ethcore/res/ethereum/ropsten.json +++ b/ethcore/res/ethereum/ropsten.json @@ -9,12 +9,14 @@ "durationLimit": "0x0d", "blockReward": { "0": "0x4563918244F40000", - "1700000": "0x29A2241AF62C0000" + "1700000": "0x29A2241AF62C0000", + "4200000": "0x1BC16D674EC80000" }, "homesteadTransition": 0, "eip100bTransition": 1700000, "difficultyBombDelays": { - "1700000": 3000000 + "1700000": 3000000, + "4200000": 2000000 } } } @@ -39,7 +41,11 @@ "eip140Transition": 1700000, "eip211Transition": 1700000, "eip214Transition": 1700000, - "eip658Transition": 1700000 + "eip658Transition": 1700000, + "eip145Transition": 4200000, + "eip1014Transition": 4200000, + "eip1052Transition": 4200000, + "eip1283Transition": 4200000 }, "genesis": { "seal": { diff --git a/ethcore/src/json_tests/difficulty.rs b/ethcore/src/json_tests/difficulty.rs index 0de1f1777b7..23a85594552 100644 --- a/ethcore/src/json_tests/difficulty.rs +++ b/ethcore/src/json_tests/difficulty.rs @@ -95,10 +95,11 @@ mod difficulty_test_foundation { declare_test!{DifficultyTests_difficultyMainNetwork, "BasicTests/difficultyMainNetwork.json"} } -mod difficulty_test_ropsten { - difficulty_json_test_nopath!(new_ropsten_test); - declare_test!{DifficultyTests_difficultyRopsten, "BasicTests/difficultyRopsten.json"} -} +// Disabling Ropsten diff tests; waiting for upstream ethereum/tests Constantinople update +//mod difficulty_test_ropsten { +// difficulty_json_test_nopath!(new_ropsten_test); +// declare_test!{DifficultyTests_difficultyRopsten, "BasicTests/difficultyRopsten.json"} +//} mod difficulty_test_frontier { difficulty_json_test_nopath!(new_frontier_test); From 6496405f305f81eadae7d8b0a0eaa6d63f8a9020 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 1 Oct 2018 11:13:31 +0200 Subject: [PATCH 7/9] ci: fix push script (#9679) * ci: fix push script * Fix copying & running on windows. --- scripts/gitlab/build-unix.sh | 6 +++++- scripts/gitlab/build-windows.sh | 2 +- scripts/gitlab/push.sh | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/gitlab/build-unix.sh b/scripts/gitlab/build-unix.sh index e338a7768f9..45876559957 100755 --- a/scripts/gitlab/build-unix.sh +++ b/scripts/gitlab/build-unix.sh @@ -26,7 +26,11 @@ mkdir -p artifacts cd artifacts mkdir -p $CARGO_TARGET cd $CARGO_TARGET -cp ../../target/$CARGO_TARGET/release/{parity,parity-evm,ethstore,ethkey,whisper} . +cp ../../target/$CARGO_TARGET/release/parity ./parity +cp ../../target/$CARGO_TARGET/release/parity-evm ./parity-evm +cp ../../target/$CARGO_TARGET/release/ethstore ./ethstore +cp ../../target/$CARGO_TARGET/release/ethkey ./ethkey +cp ../../target/$CARGO_TARGET/release/whisper ./whisper strip -v ./* echo "_____ Calculating checksums _____" for binary in $(ls) diff --git a/scripts/gitlab/build-windows.sh b/scripts/gitlab/build-windows.sh index fbc76cd268b..424d701d6a1 100755 --- a/scripts/gitlab/build-windows.sh +++ b/scripts/gitlab/build-windows.sh @@ -31,7 +31,7 @@ echo "_____ Calculating checksums _____" for binary in $(ls) do rhash --sha256 $binary -o $binary.sha256 - parity.exe tools hash $binary > $binary.sha3 + ./parity.exe tools hash $binary > $binary.sha3 done cp parity.exe.sha256 parity.sha256 cp parity.exe.sha3 parity.sha3 diff --git a/scripts/gitlab/push.sh b/scripts/gitlab/push.sh index ec58971c89f..7660aabf11c 100755 --- a/scripts/gitlab/push.sh +++ b/scripts/gitlab/push.sh @@ -8,10 +8,10 @@ echo "__________Register Release__________" DATA="secret=$RELEASES_SECRET" echo "Pushing release to Mainnet" -../../scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1337/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF" +./scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1337/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF" echo "Pushing release to Kovan" -../../scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1338/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF" +./scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1338/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF" echo "__________Set ENVIROMENT__________" DESCRIPTION="$(cat CHANGELOG.md)" From f3b806b471e55925464e09c71a77bd25d1611906 Mon Sep 17 00:00:00 2001 From: gabriel klawitter Date: Mon, 1 Oct 2018 11:55:17 +0100 Subject: [PATCH 8/9] test.sh: use cargo --target for platforms other than linux, win or mac (#9650) * test.sh: use cargo --target for platforms other than linux, win or mac * drying test.sh script * run tests only when not cross-compiling * quote variable value --- .gitlab-ci.yml | 8 +++++ test.sh | 83 +++++++++++++++++++++++++++++++++++--------------- 2 files changed, 66 insertions(+), 25 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 509ef126244..56abf187166 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -53,6 +53,8 @@ cache: test-linux-rust-stable: &test stage: test + variables: + RUN_TESTS: "true" script: - scripts/gitlab/test.sh stable tags: @@ -60,6 +62,8 @@ test-linux-rust-stable: &test test-linux-rust-beta: stage: test + variables: + RUN_TESTS: "true" script: - scripts/gitlab/test.sh beta tags: @@ -68,6 +72,8 @@ test-linux-rust-beta: test-linux-rust-nightly: stage: test + variables: + RUN_TESTS: "true" script: - scripts/gitlab/test.sh nightly tags: @@ -80,6 +86,7 @@ test-darwin-rust-stable: CARGO_TARGET: x86_64-apple-darwin CC: gcc CXX: g++ + RUN_TESTS: "true" script: - scripts/gitlab/test.sh stable tags: @@ -107,6 +114,7 @@ test-windows-rust-stable: # No cargo caching, since fetch-locking on Windows gets stuck variables: CARGO_TARGET: x86_64-pc-windows-msvc + RUN_TESTS: "true" script: - sh scripts/gitlab/test.sh stable tags: diff --git a/test.sh b/test.sh index a3ed39e8d2c..8c33f5ee253 100755 --- a/test.sh +++ b/test.sh @@ -4,6 +4,7 @@ FEATURES="json-tests,ci-skip-issue" OPTIONS="--release" VALIDATE=1 +THREADS=8 case $1 in --no-json) @@ -29,31 +30,63 @@ esac set -e -if [ "$VALIDATE" -eq "1" ]; then -# Validate --no-default-features build -echo "________Validate build________" -time cargo check --no-default-features -time cargo check --manifest-path util/io/Cargo.toml --no-default-features -time cargo check --manifest-path util/io/Cargo.toml --features "mio" -# Validate chainspecs -echo "________Validate chainspecs________" -time ./scripts/validate_chainspecs.sh +validate () { + if [ "$VALIDATE" -eq "1" ] + then + echo "________Validate build________" + time cargo check $@ --no-default-features + time cargo check $@ --manifest-path util/io/Cargo.toml --no-default-features + time cargo check $@ --manifest-path util/io/Cargo.toml --features "mio" + + # Validate chainspecs + echo "________Validate chainspecs________" + time ./scripts/validate_chainspecs.sh + else + echo "# not validating due to \$VALIDATE!=1" + fi +} + +cpp_test () { + # Running the C++ example + echo "________Running the C++ example________" + cd parity-clib-examples/cpp && \ + mkdir -p build && \ + cd build && \ + cmake .. && \ + make -j $THREADS && \ + ./parity-example && \ + cd .. && \ + rm -rf build && \ + cd ../.. +} + +cargo_test () { + echo "________Running Parity Full Test Suite________" + git submodule update --init --recursive + time cargo test $OPTIONS --features "$FEATURES" --all $@ -- --test-threads $THREADS +} + + +if [ "$CARGO_TARGET" ] +then + validate --target $CARGO_TARGET +else + validate +fi + +test "${RUN_TESTS}" = "true" && cpp_test + +if [ "$CARGO_TARGET" ] +then + + if [ "${RUN_TESTS}" = "true" ] + then + cargo_test --target $CARGO_TARGET $@ + else + cargo_test --no-run --target $CARGO_TARGET $@ + fi +else + cargo_test $@ fi -# Running the C++ example -echo "________Running the C++ example________" -cd parity-clib-examples/cpp && \ - mkdir -p build && \ - cd build && \ - cmake .. && \ - make -j 8 && \ - ./parity-example && \ - cd .. && \ - rm -rf build && \ - cd ../.. - -# Running tests -echo "________Running Parity Full Test Suite________" -git submodule update --init --recursive -time cargo test $OPTIONS --features "$FEATURES" --all $1 -- --test-threads 8 From 7781cbbc578bf210fa4ebd62cc0c70f0c71c0d01 Mon Sep 17 00:00:00 2001 From: Afri Schoedon <5chdn@users.noreply.github.com> Date: Tue, 2 Oct 2018 00:03:58 +0100 Subject: [PATCH 9/9] CI: Remove unnecessary pipes (#9681) * ci: reduce gitlab pipelines significantly * ci: build pipeline for PR * ci: remove dead weight * ci: remove github release script * ci: remove forever broken aura tests * ci: add random stuff to the end of the pipes * ci: add wind and mac to the end of the pipe * ci: remove snap artifacts * ci: (re)move dockerfiles * ci: clarify job names * ci: add cargo audit job * ci: make audit script executable * ci: ignore snap and docker files for rust check * ci: simplify audit script * ci: rename misc to optional * ci: add publish script to releaseable branches * ci: more verbose cp command for windows build * ci: fix weird binary checksum logic in push script * ci: fix regex in push script for windows * ci: simplify gitlab caching * docs: align README with ci changes * ci: specify default cargo target dir * ci: print verbose environment * ci: proper naming of scripts * ci: restore docker files * ci: use docker hub file * ci: use cargo home instead of cargo target dir * ci: touch random rust file to trigger real builds * ci: set cargo target dir for audit script * ci: remove temp file * ci: don't export the cargo target dir in the audit script * ci: fix windows unbound variable * docs: fix gitlab badge path * rename deprecated gitlab ci variables https://docs.gitlab.com/ee/ci/variables/#9-0-renaming * ci: fix git compare for nightly builds * test: skip c++ example for all platforms but linux * ci: add random rust file to trigger tests * ci: remove random rust file * disable cpp lib test for mac, win and beta (#9686) --- .gitlab-ci.yml | 331 ++++-------------- README.md | 24 +- scripts/aura-test.sh | 12 - {docker => scripts/docker}/README.md | 0 {docker => scripts/docker}/alpine/Dockerfile | 0 {docker => scripts/docker}/centos/Dockerfile | 0 .../docker}/centos/Dockerfile.build | 0 {docker => scripts/docker}/centos/build.sh | 0 {docker => scripts/docker}/hub/Dockerfile | 0 .../docker}/ubuntu-aarch64/Dockerfile | 0 .../docker}/ubuntu-arm/Dockerfile | 0 scripts/gitlab/build-unix.sh | 12 +- scripts/gitlab/build-windows.sh | 27 +- scripts/gitlab/{rustfmt.sh => cargo-audit.sh} | 4 +- scripts/gitlab/clippy.sh | 7 - scripts/gitlab/coverage.sh | 20 -- .../gitlab/{rpc-docs.sh => docs-jsonrpc.sh} | 0 scripts/gitlab/install-readme.sh | 8 - scripts/gitlab/package-snap.sh | 24 -- scripts/gitlab/publish-awss3.sh | 49 +++ scripts/gitlab/publish-docker.sh | 6 +- scripts/gitlab/publish-snap.sh | 18 - scripts/gitlab/push.sh | 74 ---- scripts/gitlab/{safe_curl.sh => safe-curl.sh} | 0 scripts/gitlab/{sign.cmd => sign-win.cmd} | 0 scripts/gitlab/templates/release-table.md | 16 - .../gitlab/templates/snapcraft.template.yaml | 58 --- scripts/gitlab/{test.sh => test-all.sh} | 21 +- snap/gui/icon.png | Bin 5044 -> 0 bytes snap/gui/parity.desktop | 8 - test.sh | 47 ++- 31 files changed, 194 insertions(+), 572 deletions(-) delete mode 100755 scripts/aura-test.sh rename {docker => scripts/docker}/README.md (100%) rename {docker => scripts/docker}/alpine/Dockerfile (100%) rename {docker => scripts/docker}/centos/Dockerfile (100%) rename {docker => scripts/docker}/centos/Dockerfile.build (100%) rename {docker => scripts/docker}/centos/build.sh (100%) rename {docker => scripts/docker}/hub/Dockerfile (100%) rename {docker => scripts/docker}/ubuntu-aarch64/Dockerfile (100%) rename {docker => scripts/docker}/ubuntu-arm/Dockerfile (100%) rename scripts/gitlab/{rustfmt.sh => cargo-audit.sh} (50%) delete mode 100755 scripts/gitlab/clippy.sh delete mode 100755 scripts/gitlab/coverage.sh rename scripts/gitlab/{rpc-docs.sh => docs-jsonrpc.sh} (100%) delete mode 100755 scripts/gitlab/install-readme.sh delete mode 100755 scripts/gitlab/package-snap.sh create mode 100755 scripts/gitlab/publish-awss3.sh delete mode 100755 scripts/gitlab/publish-snap.sh delete mode 100755 scripts/gitlab/push.sh rename scripts/gitlab/{safe_curl.sh => safe-curl.sh} (100%) rename scripts/gitlab/{sign.cmd => sign-win.cmd} (100%) delete mode 100644 scripts/gitlab/templates/release-table.md delete mode 100644 scripts/gitlab/templates/snapcraft.template.yaml rename scripts/gitlab/{test.sh => test-all.sh} (66%) delete mode 100644 snap/gui/icon.png delete mode 100644 snap/gui/parity.desktop diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 56abf187166..2d473005b5c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,16 +1,14 @@ stages: - test - build - - package - publish - - docs + - optional image: parity/rust:gitlab-ci variables: CI_SERVER_NAME: "GitLab CI" - CARGO_HOME: "${CI_PROJECT_DIR}/cargo" - + CARGO_HOME: "${CI_PROJECT_DIR}/.cargo" BUILD_TARGET: ubuntu BUILD_ARCH: amd64 CARGO_TARGET: x86_64-unknown-linux-gnu @@ -18,21 +16,15 @@ variables: cache: key: "${CI_JOB_NAME}" paths: - - ${CI_PROJECT_DIR}/target/ - - ${CI_PROJECT_DIR}/cargo/ + - ./target + - ./.cargo .releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries") only: &releaseable_branches - - master - stable - beta - tags -.publishable_branches: # list of git refs for publishing builds to the "production" locations - only: &publishable_branches - - nightly # Our nightly builds from schedule, on `master` - - /^v2.*$/ # Our version tags - .collect_artifacts: &collect_artifacts artifacts: name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}" @@ -49,309 +41,138 @@ cache: - export VERSION - echo "Version = ${VERSION}" -#### stage: test - -test-linux-rust-stable: &test - stage: test - variables: - RUN_TESTS: "true" - script: - - scripts/gitlab/test.sh stable - tags: - - rust-stable - -test-linux-rust-beta: +test-linux: stage: test variables: - RUN_TESTS: "true" + RUN_TESTS: all script: - - scripts/gitlab/test.sh beta + - scripts/gitlab/test-all.sh stable tags: - rust-stable - allow_failure: true -test-linux-rust-nightly: - stage: test +build-linux: + stage: build + only: *releaseable_branches variables: - RUN_TESTS: "true" + CARGO_TARGET: x86_64-unknown-linux-gnu script: - - scripts/gitlab/test.sh nightly + - scripts/gitlab/build-unix.sh + <<: *collect_artifacts tags: - rust-stable - allow_failure: true -test-darwin-rust-stable: - stage: test +build-darwin: + stage: build + only: *releaseable_branches variables: CARGO_TARGET: x86_64-apple-darwin CC: gcc CXX: g++ - RUN_TESTS: "true" script: - - scripts/gitlab/test.sh stable - tags: - - osx - allow_failure: true - -test-android-rust-stable: - stage: test - image: parity/rust-android:gitlab-ci - variables: - CARGO_TARGET: armv7-linux-androideabi - script: - - scripts/gitlab/test.sh stable + - scripts/gitlab/build-unix.sh tags: - - rust-arm - allow_failure: true + - rust-osx + <<: *collect_artifacts -test-windows-rust-stable: - stage: test - cache: - key: "${CI_JOB_NAME}" - paths: - - "%CI_PROJECT_DIR%/target/" - - "%CI_PROJECT_DIR%/cargo/" - # No cargo caching, since fetch-locking on Windows gets stuck +build-windows: + stage: build + only: *releaseable_branches variables: CARGO_TARGET: x86_64-pc-windows-msvc - RUN_TESTS: "true" script: - - sh scripts/gitlab/test.sh stable + - sh scripts/gitlab/build-windows.sh tags: - rust-windows - allow_failure: true - -.optional_test: &optional_test - <<: *test - allow_failure: true - only: - - master + <<: *collect_artifacts -test-lint-rustfmt: - <<: *optional_test +publish-docker: + stage: publish + only: *releaseable_branches + cache: {} + dependencies: + - build-linux + tags: + - shell script: - - scripts/gitlab/rustfmt.sh + - scripts/gitlab/publish-docker.sh parity -test-lint-clippy: - <<: *optional_test +publish-awss3: + stage: publish + only: *releaseable_branches + cache: {} + dependencies: + - build-linux + - build-darwin + - build-windows + before_script: *determine_version script: - - scripts/gitlab/clippy.sh + - scripts/gitlab/publish-awss3.sh + tags: + - shell -test-coverage-kcov: - <<: *optional_test +docs-jsonrpc: + stage: optional + only: + - tags + cache: {} script: - - scripts/gitlab/coverage.sh + - scripts/gitlab/docs-jsonrpc.sh tags: - shell -#### stage: build - -build-linux-ubuntu-amd64: &build - stage: build - only: *releaseable_branches - variables: - CARGO_TARGET: x86_64-unknown-linux-gnu +cargo-audit: + stage: optional script: - - scripts/gitlab/build-unix.sh - <<: *collect_artifacts + - scripts/gitlab/cargo-audit.sh tags: - rust-stable -build-linux-ubuntu-i386: - <<: *build - only: *releaseable_branches - image: parity/rust-i686:gitlab-ci - variables: - CARGO_TARGET: i686-unknown-linux-gnu - tags: - - rust-i686 - allow_failure: true - -build-linux-ubuntu-arm64: - <<: *build - only: *releaseable_branches - image: parity/rust-arm64:gitlab-ci - variables: - CARGO_TARGET: aarch64-unknown-linux-gnu - tags: - - rust-arm - allow_failure: true - -build-linux-ubuntu-armhf: - <<: *build - only: *releaseable_branches - image: parity/rust-armv7:gitlab-ci - variables: - CARGO_TARGET: armv7-unknown-linux-gnueabihf - tags: - - rust-arm - allow_failure: true - -build-linux-android-armhf: - stage: build - only: *releaseable_branches +test-android: + stage: optional image: parity/rust-android:gitlab-ci variables: CARGO_TARGET: armv7-linux-androideabi script: - - scripts/gitlab/build-unix.sh + - scripts/gitlab/test-all.sh stable tags: - rust-arm - allow_failure: true -build-darwin-macos-x86_64: - stage: build - only: *releaseable_branches +test-darwin: + stage: optional variables: CARGO_TARGET: x86_64-apple-darwin CC: gcc CXX: g++ + RUN_TESTS: cargo script: - - scripts/gitlab/build-unix.sh + - scripts/gitlab/test-all.sh stable tags: - - osx - <<: *collect_artifacts + - rust-osx -build-windows-msvc-x86_64: - stage: build - only: *releaseable_branches - cache: - key: "${CI_JOB_NAME}" - paths: - - "%CI_PROJECT_DIR%/target/" - - "%CI_PROJECT_DIR%/cargo/" - # No cargo caching, since fetch-locking on Windows gets stuck +test-windows: + stage: optional variables: CARGO_TARGET: x86_64-pc-windows-msvc + RUN_TESTS: cargo script: - - sh scripts/gitlab/build-windows.sh + - sh scripts/gitlab/test-all.sh stable tags: - rust-windows - <<: *collect_artifacts - -#### stage: package - -package-linux-snap-amd64: &package_snap - stage: package - only: *releaseable_branches - except: - - master - image: parity/snapcraft:gitlab-ci - cache: {} - before_script: *determine_version - variables: - CARGO_TARGET: x86_64-unknown-linux-gnu - dependencies: - - build-linux-ubuntu-amd64 - script: - - scripts/gitlab/package-snap.sh - tags: - - rust-stable - <<: *collect_artifacts - -package-linux-snap-i386: - <<: *package_snap - variables: - BUILD_ARCH: i386 - CARGO_TARGET: i686-unknown-linux-gnu - dependencies: - - build-linux-ubuntu-i386 -package-linux-snap-arm64: - <<: *package_snap - variables: - BUILD_ARCH: arm64 - CARGO_TARGET: aarch64-unknown-linux-gnu - dependencies: - - build-linux-ubuntu-arm64 - -package-linux-snap-armhf: - <<: *package_snap - variables: - BUILD_ARCH: armhf - CARGO_TARGET: armv7-unknown-linux-gnueabihf - dependencies: - - build-linux-ubuntu-armhf - -#### stage: publish - -publish-linux-snap-amd64: &publish_snap - stage: publish - only: *publishable_branches - image: parity/snapcraft:gitlab-ci - cache: {} - before_script: *determine_version +test-beta: + stage: optional variables: - BUILD_ARCH: amd64 - dependencies: - - package-linux-snap-amd64 + RUN_TESTS: cargo script: - - scripts/gitlab/publish-snap.sh + - scripts/gitlab/test-all.sh beta tags: - - rust-stable - -publish-linux-snap-i386: - <<: *publish_snap - variables: - BUILD_ARCH: i386 - dependencies: - - package-linux-snap-i386 - -publish-linux-snap-arm64: - <<: *publish_snap - variables: - BUILD_ARCH: arm64 - dependencies: - - package-linux-snap-arm64 + - rust-beta -publish-linux-snap-armhf: - <<: *publish_snap +test-nightly: + stage: optional variables: - BUILD_ARCH: armhf - dependencies: - - package-linux-snap-armhf - -publish-docker-parity-amd64: &publish_docker - stage: publish - only: *releaseable_branches - cache: {} - dependencies: - - build-linux-ubuntu-amd64 - tags: - - shell + RUN_TESTS: all script: - - scripts/gitlab/publish-docker.sh parity - -publish-docker-parityevm-amd64: - <<: *publish_docker - script: - - scripts/gitlab/publish-docker.sh parity-evm - -publish-github-and-s3: - stage: publish - only: *publishable_branches - cache: {} - dependencies: - - build-linux-ubuntu-amd64 - - build-linux-ubuntu-i386 - - build-linux-ubuntu-armhf - - build-linux-ubuntu-arm64 - - build-darwin-macos-x86_64 - - build-windows-msvc-x86_64 - before_script: *determine_version - script: - - scripts/gitlab/push.sh + - scripts/gitlab/test-all.sh nightly tags: - - shell - -####stage: docs - -docs-rpc-json: - stage: docs - only: - - tags - cache: {} - script: - - scripts/gitlab/rpc-docs.sh - tags: - - shell + - rust-nightly diff --git a/README.md b/README.md index c89cc894dfc..d72e5bc3edc 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,7 @@

» Download the latest release «

-

- - +

**Built for mission-critical use**: Miners, service providers, and exchanges need fast synchronisation and maximum uptime. Parity Ethereum provides the core infrastructure essential for speedy and reliable services. @@ -60,26 +58,6 @@ Once you have `rustup` installed, then you need to install: Make sure that these binaries are in your `PATH`. After that, you should be able to build Parity Ethereum from source. -## Install from the Snapcraft Store - -In any of the [supported Linux distros](https://snapcraft.io/docs/core/install): - -```bash -sudo snap install parity -``` - -Alternatively, if you want to contribute testing the upcoming release: - -```bash -sudo snap install parity --beta -``` - -Moreover, to test the latest code from the master branch: - -```bash -sudo snap install parity --edge -``` - ## Build from Source Code ```bash diff --git a/scripts/aura-test.sh b/scripts/aura-test.sh deleted file mode 100755 index 0c39e12f4d1..00000000000 --- a/scripts/aura-test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -set -e # fail on any error -set -u # treat unset variables as error - -cargo build -j $(nproc) --release --features final $CARGOFLAGS -git clone https://github.com/paritytech/parity-import-tests -cp target/release/parity parity-import-tests/aura/parity -cd parity-import-tests/aura -echo "Start Aura test" -./parity import blocks.rlp --chain chain.json -./parity restore snap --chain chain.json -echo "Aura test complete" diff --git a/docker/README.md b/scripts/docker/README.md similarity index 100% rename from docker/README.md rename to scripts/docker/README.md diff --git a/docker/alpine/Dockerfile b/scripts/docker/alpine/Dockerfile similarity index 100% rename from docker/alpine/Dockerfile rename to scripts/docker/alpine/Dockerfile diff --git a/docker/centos/Dockerfile b/scripts/docker/centos/Dockerfile similarity index 100% rename from docker/centos/Dockerfile rename to scripts/docker/centos/Dockerfile diff --git a/docker/centos/Dockerfile.build b/scripts/docker/centos/Dockerfile.build similarity index 100% rename from docker/centos/Dockerfile.build rename to scripts/docker/centos/Dockerfile.build diff --git a/docker/centos/build.sh b/scripts/docker/centos/build.sh similarity index 100% rename from docker/centos/build.sh rename to scripts/docker/centos/build.sh diff --git a/docker/hub/Dockerfile b/scripts/docker/hub/Dockerfile similarity index 100% rename from docker/hub/Dockerfile rename to scripts/docker/hub/Dockerfile diff --git a/docker/ubuntu-aarch64/Dockerfile b/scripts/docker/ubuntu-aarch64/Dockerfile similarity index 100% rename from docker/ubuntu-aarch64/Dockerfile rename to scripts/docker/ubuntu-aarch64/Dockerfile diff --git a/docker/ubuntu-arm/Dockerfile b/scripts/docker/ubuntu-arm/Dockerfile similarity index 100% rename from docker/ubuntu-arm/Dockerfile rename to scripts/docker/ubuntu-arm/Dockerfile diff --git a/scripts/gitlab/build-unix.sh b/scripts/gitlab/build-unix.sh index 45876559957..00933f1eeb7 100755 --- a/scripts/gitlab/build-unix.sh +++ b/scripts/gitlab/build-unix.sh @@ -2,13 +2,19 @@ set -e # fail on any error set -u # treat unset variables as error + echo "__________Show ENVIROMENT__________" -echo "CC: " $CC -echo "CXX: " $CXX +echo "CI_SERVER_NAME: " $CI_SERVER_NAME +echo "CARGO_HOME: " $CARGO_HOME +echo "BUILD_TARGET: " $BUILD_TARGET +echo "BUILD_ARCH: " $BUILD_ARCH +echo "CARGO_TARGET: " $CARGO_TARGET +echo "CC: " $CC +echo "CXX: " $CXX echo "__________CARGO CONFIG__________" -rm -rf .cargo mkdir -p .cargo +rm -f .cargo/config echo "[target.$CARGO_TARGET]" >> .cargo/config echo "linker= \"$CC\"" >> .cargo/config cat .cargo/config diff --git a/scripts/gitlab/build-windows.sh b/scripts/gitlab/build-windows.sh index 424d701d6a1..b0570b917dc 100755 --- a/scripts/gitlab/build-windows.sh +++ b/scripts/gitlab/build-windows.sh @@ -6,18 +6,27 @@ set INCLUDE="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;C:\vs20 set LIB="C:\vs2015\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64" rustup default stable-x86_64-pc-windows-msvc -echo "_____ Building _____" + +echo "__________Show ENVIROMENT__________" +echo "CI_SERVER_NAME: " $CI_SERVER_NAME +echo "CARGO_HOME: " $CARGO_HOME +echo "BUILD_TARGET: " $BUILD_TARGET +echo "BUILD_ARCH: " $BUILD_ARCH +echo "CARGO_TARGET: " $CARGO_TARGET + +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 "__________Sign binaries__________" -scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/parity.exe -scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/parity-evm.exe -scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/ethstore.exe -scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/ethkey.exe -scripts/gitlab/sign.cmd $keyfile $certpass target/$CARGO_TARGET/release/whisper.exe +scripts/gitlab/sign-win.cmd $keyfile $certpass target/$CARGO_TARGET/release/parity.exe +scripts/gitlab/sign-win.cmd $keyfile $certpass target/$CARGO_TARGET/release/parity-evm.exe +scripts/gitlab/sign-win.cmd $keyfile $certpass target/$CARGO_TARGET/release/ethstore.exe +scripts/gitlab/sign-win.cmd $keyfile $certpass target/$CARGO_TARGET/release/ethkey.exe +scripts/gitlab/sign-win.cmd $keyfile $certpass target/$CARGO_TARGET/release/whisper.exe echo "_____ Post-processing binaries _____" rm -rf artifacts @@ -25,7 +34,11 @@ mkdir -p artifacts cd artifacts mkdir -p $CARGO_TARGET cd $CARGO_TARGET -cp --verbose ../../target/$CARGO_TARGET/release/{parity.exe,parity-evm.exe,ethstore.exe,ethkey.exe,whisper.exe} . +cp --verbose ../../target/$CARGO_TARGET/release/parity.exe ./parity.exe +cp --verbose ../../target/$CARGO_TARGET/release/parity-evm.exe ./parity-evm.exe +cp --verbose ../../target/$CARGO_TARGET/release/ethstore.exe ./ethstore.exe +cp --verbose ../../target/$CARGO_TARGET/release/ethkey.exe ./ethkey.exe +cp --verbose ../../target/$CARGO_TARGET/release/whisper.exe ./whisper.exe echo "_____ Calculating checksums _____" for binary in $(ls) diff --git a/scripts/gitlab/rustfmt.sh b/scripts/gitlab/cargo-audit.sh similarity index 50% rename from scripts/gitlab/rustfmt.sh rename to scripts/gitlab/cargo-audit.sh index 447d66f24ec..3677204d6ad 100755 --- a/scripts/gitlab/rustfmt.sh +++ b/scripts/gitlab/cargo-audit.sh @@ -3,5 +3,5 @@ set -e # fail on any error set -u # treat unset variables as error -cargo install rustfmt-nightly -cargo fmt -- --write-mode=diff +CARGO_TARGET_DIR=./target cargo +stable install cargo-audit +cargo +stable audit diff --git a/scripts/gitlab/clippy.sh b/scripts/gitlab/clippy.sh deleted file mode 100755 index aef39c29fbc..00000000000 --- a/scripts/gitlab/clippy.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -e # fail on any error -set -u # treat unset variables as error - -cargo install clippy -cargo clippy -- -D warnings diff --git a/scripts/gitlab/coverage.sh b/scripts/gitlab/coverage.sh deleted file mode 100755 index 38d01cb1faf..00000000000 --- a/scripts/gitlab/coverage.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -x -git submodule update --init --recursive -rm -rf target/* -cargo test --all --exclude evmjit --no-run -- --test-threads 8|| exit $? -KCOV_TARGET="target/cov" -KCOV_FLAGS="--verify" -mkdir -p $KCOV_TARGET -echo "__________Cover RUST___________" -for FILE in `find target/debug/deps ! -name "*.*" -type f` -do - timeout --signal=SIGKILL 5m kcov --include-path=$(pwd) --exclude-path=$(pwd)/target $KCOV_FLAGS $KCOV_TARGET $FILE -done -timeout --signal=SIGKILL 5m kcov --include-path=$(pwd) --exclude-path=$(pwd)/target $KCOV_FLAGS $KCOV_TARGET target/debug/parity-* - -bash <(curl -s https://codecov.io/bash) && - echo "Uploaded code coverage" - -exit 0 diff --git a/scripts/gitlab/rpc-docs.sh b/scripts/gitlab/docs-jsonrpc.sh similarity index 100% rename from scripts/gitlab/rpc-docs.sh rename to scripts/gitlab/docs-jsonrpc.sh diff --git a/scripts/gitlab/install-readme.sh b/scripts/gitlab/install-readme.sh deleted file mode 100755 index 531bae9b77a..00000000000 --- a/scripts/gitlab/install-readme.sh +++ /dev/null @@ -1,8 +0,0 @@ -echo "Parity Wallet -============= - -Welcome to Parity Wallet, your all-in-one Ethereum node and wallet. - -If you continue, Parity will be installed as a user service. You will be able to use the Parity Wallet through your browser by using the menu bar icon, following the shortcut in the Launchpad or navigating to http://localhost:8180/ in your browser. - -Parity is distributed under the terms of the GPL." diff --git a/scripts/gitlab/package-snap.sh b/scripts/gitlab/package-snap.sh deleted file mode 100755 index 1dbb77d79ea..00000000000 --- a/scripts/gitlab/package-snap.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -e # fail on any error -set -u # treat unset variables as error -case ${CI_COMMIT_REF_NAME} in - nightly|*v2.2*) export GRADE="devel";; - beta|*v2.1*) export GRADE="stable";; - stable|*v2.0*) export GRADE="stable";; - *) echo "No release" exit 0;; -esac -SNAP_PACKAGE="parity_"$VERSION"_"$BUILD_ARCH".snap" -echo "__________Create snap package__________" -echo "Release channel :" $GRADE " Branch/tag: " $CI_COMMIT_REF_NAME -echo $VERSION:$GRADE:$BUILD_ARCH -cat scripts/gitlab/templates/snapcraft.template.yaml | envsubst '$VERSION:$GRADE:$BUILD_ARCH:$CARGO_TARGET' > snapcraft.yaml -cat snapcraft.yaml -snapcraft --target-arch=$BUILD_ARCH -ls *.snap -echo "__________Post-processing snap package__________" -mkdir -p artifacts -mv -v $SNAP_PACKAGE "artifacts/"$SNAP_PACKAGE -echo "_____ Calculating checksums _____" -cd artifacts -rhash --sha256 $SNAP_PACKAGE -o $SNAP_PACKAGE".sha256" diff --git a/scripts/gitlab/publish-awss3.sh b/scripts/gitlab/publish-awss3.sh new file mode 100755 index 00000000000..9ef0435f5ba --- /dev/null +++ b/scripts/gitlab/publish-awss3.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -e # fail on any error +set -u # treat unset variables as error + +echo "__________Register Release__________" +DATA="secret=$RELEASES_SECRET" + +echo "Pushing release to Mainnet" +./scripts/gitlab/safe-curl.sh $DATA "http://update.parity.io:1337/push-release/$CI_COMMIT_REF_NAME/$CI_COMMIT_SHA" + +echo "Pushing release to Kovan" +./scripts/gitlab/safe-curl.sh $DATA "http://update.parity.io:1338/push-release/$CI_COMMIT_REF_NAME/$CI_COMMIT_SHA" + +cd artifacts +ls -l | sort -k9 +filetest=( * ) +echo ${filetest[*]} +for DIR in "${filetest[@]}"; +do + cd $DIR + if [[ $DIR =~ "windows" ]]; + then + WIN=".exe"; + else + WIN=""; + fi + sha3=$(cat parity.sha3 | awk '{print $1}') + case $DIR in + x86_64* ) + DATA="commit=$CI_COMMIT_SHA&sha3=$sha3&filename=parity$WIN&secret=$RELEASES_SECRET" + ../../scripts/gitlab/safe-curl.sh $DATA "http://update.parity.io:1337/push-build/$CI_COMMIT_REF_NAME/$DIR" + # Kovan + ../../scripts/gitlab/safe-curl.sh $DATA "http://update.parity.io:1338/push-build/$CI_COMMIT_REF_NAME/$DIR" + ;; + esac + cd .. +done + +echo "__________Push binaries to AWS S3____________" +aws configure set aws_access_key_id $s3_key +aws configure set aws_secret_access_key $s3_secret +if [[ "$CI_COMMIT_REF_NAME" = "beta" || "$CI_COMMIT_REF_NAME" = "stable" || "$CI_COMMIT_REF_NAME" = "nightly" ]]; + then + export S3_BUCKET=builds-parity-published; + else + export S3_BUCKET=builds-parity; +fi +aws s3 sync ./ s3://$S3_BUCKET/$CI_COMMIT_REF_NAME/ diff --git a/scripts/gitlab/publish-docker.sh b/scripts/gitlab/publish-docker.sh index d2ef66e16d8..e4d2007b95c 100755 --- a/scripts/gitlab/publish-docker.sh +++ b/scripts/gitlab/publish-docker.sh @@ -4,8 +4,8 @@ set -e # fail on any error set -u # treat unset variables as error if [ "$CI_COMMIT_REF_NAME" == "master" ]; -then export DOCKER_BUILD_TAG="latest"; -else export DOCKER_BUILD_TAG=$CI_COMMIT_REF_NAME; + then export DOCKER_BUILD_TAG="latest"; + else export DOCKER_BUILD_TAG=$CI_COMMIT_REF_NAME; fi docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity @@ -17,6 +17,6 @@ export DOCKER_TARGET=$1 echo $DOCKER_TARGET echo "__________Docker build and push__________" -docker build --build-arg TARGET=$DOCKER_TARGET --no-cache=true --tag parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG -f docker/hub/Dockerfile . +docker build --build-arg TARGET=$DOCKER_TARGET --no-cache=true --tag parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG -f scripts/docker/hub/Dockerfile . docker push parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG docker logout diff --git a/scripts/gitlab/publish-snap.sh b/scripts/gitlab/publish-snap.sh deleted file mode 100755 index 97e08f5d734..00000000000 --- a/scripts/gitlab/publish-snap.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -set -e # fail on any error -set -u # treat unset variables as error - -case ${CI_COMMIT_REF_NAME} in - nightly|*v2.2*) export CHANNEL="edge";; - beta|*v2.1*) export CHANNEL="beta";; - stable|*v2.0*) export CHANNEL="stable";; - *) echo "No release" exit 0;; -esac -echo "Release channel :" $CHANNEL " Branch/tag: " $CI_COMMIT_REF_NAME - -echo $SNAPCRAFT_LOGIN_PARITY_BASE64 | base64 --decode > snapcraft.login -snapcraft login --with snapcraft.login -snapcraft push --release $CHANNEL "artifacts/parity_"$VERSION"_"$BUILD_ARCH".snap" -snapcraft status parity -snapcraft logout diff --git a/scripts/gitlab/push.sh b/scripts/gitlab/push.sh deleted file mode 100755 index 7660aabf11c..00000000000 --- a/scripts/gitlab/push.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -e # fail on any error -set -u # treat unset variables as error - - -echo "__________Register Release__________" -DATA="secret=$RELEASES_SECRET" - -echo "Pushing release to Mainnet" -./scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1337/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF" - -echo "Pushing release to Kovan" -./scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1338/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF" - -echo "__________Set ENVIROMENT__________" -DESCRIPTION="$(cat CHANGELOG.md)" -RELEASE_TABLE="$(cat scripts/gitlab/templates/release-table.md)" -RELEASE_TABLE="$(echo "${RELEASE_TABLE//\$VERSION/${VERSION}}")" -#The text in the file CANGELOG.md before which the table with links is inserted. Must be present in this file necessarily -REPLACE_TEXT="The full list of included changes:" -case ${CI_COMMIT_REF_NAME} in - nightly|*v2.2*) NAME="Parity "$VERSION" nightly";; - beta|*v2.1*) NAME="Parity "$VERSION" beta";; - stable|*v2.0*) NAME="Parity "$VERSION" stable";; - *) echo "No release" exit 0;; -esac -cd artifacts -ls -l | sort -k9 -filetest=( * ) -echo ${filetest[*]} -for DIR in "${filetest[@]}"; -do - cd $DIR - if [[ $DIR == "*windows*" ]]; - then - WIN=".exe"; - else - WIN=""; - fi - for binary in $(ls parity.sha256) - do - sha256=$(cat $binary | awk '{ print $1}' ) - sha3=$(cat ${binary/sha256/sha3} | awk '{ print $1}' ) - case $DIR in - x86_64* ) - DATA="commit=$CI_BUILD_REF&sha3=$sha3&filename=parity$WIN&secret=$RELEASES_SECRET" - ../../scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$DIR" - # Kovan - ../../scripts/gitlab/safe_curl.sh $DATA "http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$DIR" - ;; - esac - RELEASE_TABLE="$(echo "${RELEASE_TABLE/sha$DIR/${sha256}}")" - done - cd .. -done -#do not touch the following 3 lines. Features of output in Markdown -DESCRIPTION="$(echo "${DESCRIPTION/${REPLACE_TEXT}/${RELEASE_TABLE} - -${REPLACE_TEXT}}")" -echo "$DESCRIPTION" -if [[ "$CI_COMMIT_REF_NAME" == "nightly" ]]; then DESCRIPTION=""; fi #TODO in the future, we need to prepare a script that will do changelog -echo "__________Create release to Github____________" -github-release release --user devops-parity --repo parity-ethereum --tag "$CI_COMMIT_REF_NAME" --draft --name "$NAME" --description "$DESCRIPTION" -echo "__________Push binaries to AWS S3____________" -aws configure set aws_access_key_id $s3_key -aws configure set aws_secret_access_key $s3_secret -if [[ "$CI_BUILD_REF_NAME" = "beta" || "$CI_BUILD_REF_NAME" = "stable" || "$CI_BUILD_REF_NAME" = "nightly" ]]; - then - export S3_BUCKET=builds-parity-published; - else - export S3_BUCKET=builds-parity; -fi -aws s3 sync ./ s3://$S3_BUCKET/$CI_BUILD_REF_NAME/ diff --git a/scripts/gitlab/safe_curl.sh b/scripts/gitlab/safe-curl.sh similarity index 100% rename from scripts/gitlab/safe_curl.sh rename to scripts/gitlab/safe-curl.sh diff --git a/scripts/gitlab/sign.cmd b/scripts/gitlab/sign-win.cmd similarity index 100% rename from scripts/gitlab/sign.cmd rename to scripts/gitlab/sign-win.cmd diff --git a/scripts/gitlab/templates/release-table.md b/scripts/gitlab/templates/release-table.md deleted file mode 100644 index 6145521524e..00000000000 --- a/scripts/gitlab/templates/release-table.md +++ /dev/null @@ -1,16 +0,0 @@ -| OS | Arch | Download | SHA256 Checksum | -|:---:|:---:|:---|:---| -| linux | arm64 | [parity](https://releases.parity.io/$VERSION/aarch64-unknown-linux-gnu/parity) | `shaaarch64-unknown-linux-gnu` | -| android | armv7 | [parity](https://releases.parity.io/$VERSION/armv7-linux-androideabi/parity) | `shaarmv7-linux-androideabi` | -| linux | armv7 | [parity](https://releases.parity.io/$VERSION/armv7-unknown-linux-gnueabihf/parity) | `shaarmv7-unknown-linux-gnueabihf` | -| linux | i686 | [parity](https://releases.parity.io/$VERSION/i686-unknown-linux-gnu/parity) | `shai686-unknown-linux-gnu` | -| osx | x64 | [parity](https://releases.parity.io/$VERSION/x86_64-apple-darwin/parity) | `shax86_64-apple-darwin` | -| windows | x64 | [parity.exe](https://releases.parity.io/$VERSION/x86_64-pc-windows-msvc/parity.exe) | `shax86_64-pc-windows-msvc` | -| linux | x64 | [parity](https://releases.parity.io/$VERSION/x86_64-unknown-linux-gnu/parity) | `shax86_64-unknown-linux-gnu` | - -| OS | Alternative | Link | -|:---:|:---:|:---| -| Apple Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect | Homebrew |[github.com/paritytech/homebrew-paritytech/blob/master/README.md](https://github.com/paritytech/homebrew-paritytech/blob/master/README.md) | -| Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect | Snapcraft | [snapcraft.io/parity](https://snapcraft.io/parity/) | -| Settings Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect | Docker | [hub.docker.com/r/parity/parity](https://hub.docker.com/r/parity/parity) | -| Settings Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect | Other binaries | [vanity-service.parity.io/parity-binaries?format=markdown&version=$VERSION](https://vanity-service.parity.io/parity-binaries?format=markdown&version=$VERSION) | diff --git a/scripts/gitlab/templates/snapcraft.template.yaml b/scripts/gitlab/templates/snapcraft.template.yaml deleted file mode 100644 index 97bb39aa14a..00000000000 --- a/scripts/gitlab/templates/snapcraft.template.yaml +++ /dev/null @@ -1,58 +0,0 @@ -name: parity -version: $VERSION -architectures: [$BUILD_ARCH] -grade: $GRADE -confinement: strict - -summary: Fast, light, robust Ethereum implementation -description: | - Parity's goal is to be the fastest, lightest, and most secure Ethereum - client. We are developing Parity using the sophisticated and cutting-edge - Rust programming language. Parity is licensed under the GPLv3, and can be - used for all your Ethereum needs. - - -apps: - parity: - command: parity - plugs: [home, network, network-bind, mount-observe, x11, unity7, desktop, desktop-legacy, wayland] - desktop: usr/share/applications/parity.desktop - parity-evm: - command: parity-evm - plugs: [home, network, network-bind] - ethkey: - command: ethkey - plugs: [home] - ethstore: - command: ethstore - plugs: [home] - whisper: - command: whisper - plugs: [home] - -icon: snap/gui/icon.png - -parts: - desktop-icon: - source: ./snap - plugin: nil - override-build: | - mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/applications - mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps - cp -v gui/parity.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/ - cp -v gui/icon.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/ - parity: - source: ./artifacts/$CARGO_TARGET - plugin: nil - override-build: | - mkdir -p $SNAPCRAFT_PART_INSTALL/usr/bin - cp -v parity $SNAPCRAFT_PART_INSTALL/usr/bin/parity - cp -v parity-evm $SNAPCRAFT_PART_INSTALL/usr/bin/parity-evm - cp -v ethkey $SNAPCRAFT_PART_INSTALL/usr/bin/ethkey - cp -v ethstore $SNAPCRAFT_PART_INSTALL/usr/bin/ethstore - cp -v whisper $SNAPCRAFT_PART_INSTALL/usr/bin/whisper - stage-packages: [libc6, libssl1.0.0, libudev1, libstdc++6, cmake] - df: - plugin: nil - stage-packages: [coreutils] - stage: [bin/df] diff --git a/scripts/gitlab/test.sh b/scripts/gitlab/test-all.sh similarity index 66% rename from scripts/gitlab/test.sh rename to scripts/gitlab/test-all.sh index 8395ec96277..fa4dc659586 100755 --- a/scripts/gitlab/test.sh +++ b/scripts/gitlab/test-all.sh @@ -4,41 +4,32 @@ set -e # fail on any error set -u # treat unset variables as error - -set -x # full command output for development git log --graph --oneline --all --decorate=short -n 10 - case $CI_COMMIT_REF_NAME in - (master|beta|stable) + (beta|stable) export GIT_COMPARE=$CI_COMMIT_REF_NAME~ ;; + (master|nightly) + export GIT_COMPARE=master~ + ;; (*) export GIT_COMPARE=master - ;; + ;; esac - -export RUST_FILES_MODIFIED="$(git --no-pager diff --name-only $GIT_COMPARE...$CI_COMMIT_SHA | grep -v -e ^\\. -e ^LICENSE -e ^README.md -e ^CHANGELOG.md -e ^test.sh -e ^scripts/ -e ^docs/ | wc -l | tr -d ' ')" +export RUST_FILES_MODIFIED="$(git --no-pager diff --name-only $GIT_COMPARE...$CI_COMMIT_SHA | grep -v -e ^\\. -e ^LICENSE -e ^README.md -e ^CHANGELOG.md -e ^test.sh -e ^scripts/ -e ^docs/ -e ^docker/ -e ^snap/ | wc -l | tr -d ' ')" echo "RUST_FILES_MODIFIED: $RUST_FILES_MODIFIED" - if [ "${RUST_FILES_MODIFIED}" = "0" ] then echo "__________Skipping Rust tests since no Rust files modified__________"; exit 0 fi - rustup default $1 git submodule update --init --recursive rustup show exec ./test.sh - -# if [[ "$CI_COMMIT_REF_NAME" == "nightly" ]]; -# ### @TODO re-enable fail after https://github.com/paritytech/parity-import-tests/issues/3 -# then sh scripts/aura-test.sh; # || exit $?; -# fi - diff --git a/snap/gui/icon.png b/snap/gui/icon.png deleted file mode 100644 index f0f22390f5629c9a746d7b54e359ca8a66fefd4b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5044 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 diff --git a/snap/gui/parity.desktop b/snap/gui/parity.desktop deleted file mode 100644 index 1833865deab..00000000000 --- a/snap/gui/parity.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Encoding=UTF-8 -Name=Parity Ethereum -Comment=The fastest and most advanced Ethereum client. -Exec=parity -Icon=/usr/share/pixmaps/icon.png -Terminal=true diff --git a/test.sh b/test.sh index 8c33f5ee253..b49dfadafac 100755 --- a/test.sh +++ b/test.sh @@ -38,7 +38,7 @@ validate () { time cargo check $@ --no-default-features time cargo check $@ --manifest-path util/io/Cargo.toml --no-default-features time cargo check $@ --manifest-path util/io/Cargo.toml --features "mio" - + # Validate chainspecs echo "________Validate chainspecs________" time ./scripts/validate_chainspecs.sh @@ -48,17 +48,24 @@ validate () { } cpp_test () { - # Running the C++ example - echo "________Running the C++ example________" - cd parity-clib-examples/cpp && \ - mkdir -p build && \ - cd build && \ - cmake .. && \ - make -j $THREADS && \ - ./parity-example && \ - cd .. && \ - rm -rf build && \ - cd ../.. + case $CARGO_TARGET in + (x86_64-unknown-linux-gnu) + # Running the C++ example + echo "________Running the C++ example________" + cd parity-clib-examples/cpp && \ + mkdir -p build && \ + cd build && \ + cmake .. && \ + make -j $THREADS && \ + ./parity-example && \ + cd .. && \ + rm -rf build && \ + cd ../.. + ;; + (*) + echo "________Skipping the C++ example________" + ;; + esac } cargo_test () { @@ -75,17 +82,19 @@ else validate fi -test "${RUN_TESTS}" = "true" && cpp_test +test "${RUN_TESTS}" = "all" && cpp_test if [ "$CARGO_TARGET" ] then - if [ "${RUN_TESTS}" = "true" ] - then - cargo_test --target $CARGO_TARGET $@ - else - cargo_test --no-run --target $CARGO_TARGET $@ - fi + case "${RUN_TESTS}" in + (cargo|all) + cargo_test --target $CARGO_TARGET $@ + ;; + ('') + cargo_test --no-run --target $CARGO_TARGET $@ + ;; + esac else cargo_test $@ fi