From f44d885b6d2b89d0f21bc337971557f916b9ba95 Mon Sep 17 00:00:00 2001 From: Afri Schoedon <5chdn@users.noreply.github.com> Date: Wed, 5 Dec 2018 16:07:11 +0100 Subject: [PATCH] patch beta release pipeline (#10020) * version: bump beta to 2.2.4 * ci: move future releases to ethereum subdir on s3 (#10017) * ci: move future releases to ethereum subdir on s3 * ci: redesign s3 bucket logic * ci: use the releases bucket * Handle failing case for update account cache in require (#9989) * state: remove accidently merged test * state: remove merge leftovers --- Cargo.lock | 12 +++---- Cargo.toml | 2 +- ethcore/src/state/mod.rs | 63 +++++++++++++++++---------------- scripts/gitlab/publish-awss3.sh | 2 +- util/version/Cargo.toml | 2 +- 5 files changed, 41 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 83122dd77..3765ac5c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2162,7 +2162,7 @@ version = "1.12.0" dependencies = [ "jni 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "panic_hook 0.1.0", - "parity-ethereum 2.2.3", + "parity-ethereum 2.2.4", ] [[package]] @@ -2178,7 +2178,7 @@ dependencies = [ [[package]] name = "parity-ethereum" -version = "2.2.3" +version = "2.2.4" 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)", @@ -2227,7 +2227,7 @@ dependencies = [ "parity-rpc-client 1.4.0", "parity-runtime 0.1.0", "parity-updater 1.12.0", - "parity-version 2.2.3", + "parity-version 2.2.4", "parity-whisper 0.1.0", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2382,7 +2382,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.2.3", + "parity-version 2.2.4", "parking_lot 0.6.4 (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)", @@ -2479,7 +2479,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.2.3", + "parity-version 2.2.4", "parking_lot 0.6.4 (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)", @@ -2489,7 +2489,7 @@ dependencies = [ [[package]] name = "parity-version" -version = "2.2.3" +version = "2.2.4" 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 02651947c..75a5c3008 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.2.3" +version = "2.2.4" license = "GPL-3.0" authors = ["Parity Technologies "] diff --git a/ethcore/src/state/mod.rs b/ethcore/src/state/mod.rs index f34f1219d..e9ef64af8 100644 --- a/ethcore/src/state/mod.rs +++ b/ethcore/src/state/mod.rs @@ -1136,7 +1136,7 @@ impl State { self.note_cache(a); // at this point the entry is guaranteed to be in the cache. - Ok(RefMut::map(self.cache.borrow_mut(), |c| { + let mut account = RefMut::map(self.cache.borrow_mut(), |c| { let entry = c.get_mut(a).expect("entry known to exist in the cache; qed"); match &mut entry.account { @@ -1146,18 +1146,19 @@ impl State { // set the dirty flag after changing account data. entry.state = AccountState::Dirty; - match entry.account { - Some(ref mut account) => { - if require_code { - let addr_hash = account.address_hash(a); - let accountdb = self.factories.accountdb.readonly(self.db.as_hashdb(), addr_hash); - Self::update_account_cache(RequireCache::Code, account, &self.db, accountdb.as_hashdb()); - } - account - }, - _ => panic!("Required account must always exist; qed"), + entry.account.as_mut().expect("Required account must always exist; qed") + }); + + if require_code { + let addr_hash = account.address_hash(a); + let accountdb = self.factories.accountdb.readonly(self.db.as_hashdb(), addr_hash); + + if !Self::update_account_cache(RequireCache::Code, &mut account, &self.db, accountdb.as_hashdb()) { + return Err(Box::new(TrieError::IncompleteDatabase(H256::from(a)))) } - })) + } + + Ok(account) } /// Replace account code and storage. Creates account if it does not exist. @@ -2591,12 +2592,12 @@ mod tests { assert_eq!(diff_map.len(), 1); assert!(diff_map.get(&a).is_some()); assert_eq!(diff_map.get(&a), - pod_account::diff_pod(Some(&PodAccount { - balance: U256::from(100), - nonce: U256::zero(), - code: Some(Default::default()), - storage: Default::default() - }), None).as_ref()); + pod_account::diff_pod(Some(&PodAccount { + balance: U256::from(100), + nonce: U256::zero(), + code: Some(Default::default()), + storage: Default::default() + }), None).as_ref()); } #[test] @@ -2622,18 +2623,18 @@ mod tests { assert_eq!(diff_map.len(), 1); assert!(diff_map.get(&a).is_some()); assert_eq!(diff_map.get(&a), - pod_account::diff_pod(Some(&PodAccount { - balance: U256::zero(), - nonce: U256::zero(), - code: Some(Default::default()), - storage: vec![(H256::from(&U256::from(1u64)), H256::from(&U256::from(20u64)))] - .into_iter().collect(), - }), Some(&PodAccount { - balance: U256::zero(), - nonce: U256::zero(), - code: Some(Default::default()), - storage: vec![(H256::from(&U256::from(1u64)), H256::from(&U256::from(100u64)))] - .into_iter().collect(), - })).as_ref()); + pod_account::diff_pod(Some(&PodAccount { + balance: U256::zero(), + nonce: U256::zero(), + code: Some(Default::default()), + storage: vec![(H256::from(&U256::from(1u64)), H256::from(&U256::from(20u64)))] + .into_iter().collect(), + }), Some(&PodAccount { + balance: U256::zero(), + nonce: U256::zero(), + code: Some(Default::default()), + storage: vec![(H256::from(&U256::from(1u64)), H256::from(&U256::from(100u64)))] + .into_iter().collect(), + })).as_ref()); } } diff --git a/scripts/gitlab/publish-awss3.sh b/scripts/gitlab/publish-awss3.sh index 30c98933d..af768a632 100755 --- a/scripts/gitlab/publish-awss3.sh +++ b/scripts/gitlab/publish-awss3.sh @@ -43,7 +43,7 @@ aws configure set aws_secret_access_key $s3_secret case "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" in (beta|stable|nightly) - export S3_BUCKET=builds-parity-published; + export S3_BUCKET=releases.parity.io/ethereum; ;; (*) export S3_BUCKET=builds-parity; diff --git a/util/version/Cargo.toml b/util/version/Cargo.toml index e4a1fecb9..71b513127 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.2.3" +version = "2.2.4" authors = ["Parity Technologies "] build = "build.rs"