Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit ecbafb2

Browse files
authored
backports for beta 2.5.2 (#10737)
* version: bump beta to 2.5.2 * [CI] allow cargo audit to fail (#10676) * [CI] allow cargo audit to fail * [.gitlab-ci.yml] add a comment about cargo audit * [Cargo.lock] cargo update -p protobuf * Reset blockchain properly (#10669) * delete BlockDetails from COL_EXTRA * better proofs * added tests * PR suggestions * new image (#10673) * Update publishing (#10644) * docker images are now built on k8s: test run * copy check_sync.sh in build-linux job * copy scripts/docker/hub/* in build-linux job * removed cache var * cleanup, no more nightly dockers * cleanup in dockerfile * some new tags * removed sccsche debug log, cleanup * no_gits, new artifacts dir, changed scripts. Test run. * define version once * one source for TRACK * stop kovan onchain updates * moved changes for two images to a new branch * rename Dockerfile * no need in libudev-dev * enable lto for release builds (#10717) * Use RUSTFLAGS to set the optimization level (#10719) * Use RUSTFLAGS to set the optimization level Cargo has a [quirk]() in how configuration settings are propagated when `cargo test` runs: local code respect the settings in `[profile.test]` but all dependencies use the `[profile.dev]` settings. Here we force `opt-level=3` for all dependencies. * Remove unused profile settings * Maybe like this? * Turn off incremental compilation * Remove colors; try again with overflow-checks on * Use quiet CI machine * Turn overflow checking back on * Be explicit about what options we use * Remove "quiet machine" override * ethcore: enable ECIP-1054 for classic (#10731) * config: enable atlantis on ethereum classic * config: enable atlantis on morden classic * config: enable atlantis on morden classic * config: enable atlantis on kotti classic * ethcore: move kotti fork block to 0xAEF49 * ethcore: move morden fork block to 0x4829BA * ethcore: move classic fork block to 0x81B320 * remove trailing comma * remove trailing comma * fix chainspec * ethcore: move classic fork block to 0x7fffffffffffffff
1 parent adabd81 commit ecbafb2

File tree

17 files changed

+456
-150
lines changed

17 files changed

+456
-150
lines changed

.gitlab-ci.yml

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ stages:
44
- publish
55
- optional
66

7-
image: parity/rust-parity-ethereum-build:xenial
7+
image: parity/parity-ci-linux:latest
88
variables:
99
GIT_STRATEGY: fetch
1010
GIT_SUBMODULE_STRATEGY: recursive
1111
CI_SERVER_NAME: "GitLab CI"
12+
CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}"
13+
SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache"
1214
CARGO_TARGET: x86_64-unknown-linux-gnu
1315

1416
.no_git: &no_git # disable git strategy
@@ -30,12 +32,15 @@ variables:
3032
expire_in: 1 mos
3133
paths:
3234
- artifacts/
35+
- tools/
3336

3437
.docker-cache-status: &docker-cache-status
3538
variables:
3639
CARGO_HOME: "/ci-cache/parity-ethereum/cargo/${CI_JOB_NAME}"
3740
dependencies: []
3841
before_script:
42+
- rustup show
43+
- cargo --version
3944
- SCCACHE_ERROR_LOG=/builds/parity/parity-ethereum/sccache_debug.log
4045
RUST_LOG=sccache=debug
4146
sccache --start-server
@@ -44,10 +49,7 @@ variables:
4449
# sccache debug info
4550
- if test -e sccache_debug.log;
4651
then
47-
echo "_____sccache_debug.log listing start:_____";
48-
cat sccache_debug.log;
49-
echo "_____sccache_debug.log listing end_____";
50-
echo "All crate-types:";
52+
echo "_____All crate-types:_____";
5153
grep 'parse_arguments.*--crate-type' sccache_debug.log | sed -re 's/.*"--crate-type", "([^"]+)".*/\1/' | sort | uniq -c;
5254
echo "_____Non-cacheable reasons:_____";
5355
grep CannotCache sccache_debug.log | sed -re 's/.*CannotCache\((.+)\).*/\1/' | sort | uniq -c;
@@ -65,6 +67,16 @@ variables:
6567
script:
6668
- scripts/gitlab/build-linux.sh
6769
- sccache -s
70+
after_script:
71+
- mkdir -p tools
72+
- cp -r scripts/docker/hub/* ./tools
73+
- cp scripts/gitlab/publish-snap.sh ./tools
74+
- cp scripts/gitlab/publish-onchain.sh ./tools
75+
- cp scripts/gitlab/safe-curl.sh ./tools
76+
- echo v"$(sed -r -n '1,/^version/s/^version\s*=\s*"([^"]+)".*$/\1/p' Cargo.toml)" |
77+
tee ./tools/VERSION
78+
- echo "$(sed -r -n '1,/^track/s/^track\s*=\s*"([^"]+)".*$/\1/p' ./util/version/Cargo.toml)" |
79+
tee ./tools/TRACK
6880

6981

7082
cargo-check 0 3:
@@ -93,6 +105,7 @@ cargo-audit:
93105
<<: *docker-cache-status
94106
script:
95107
- cargo audit
108+
allow_failure: true # failed cargo audit shouldn't prevent a PR from being merged
96109

97110
validate-chainspecs:
98111
stage: test
@@ -192,19 +205,35 @@ build-windows:
192205

193206
publish-docker:
194207
stage: publish
208+
<<: *no_git
195209
only: *releaseable_branches
196-
cache: {}
210+
except:
211+
variables:
212+
- $SCHEDULE_TAG == "nightly"
197213
dependencies:
198214
- build-linux
199-
tags:
200-
- shell
215+
environment:
216+
name: parity-build
217+
cache: {}
218+
image: docker:stable
219+
services:
220+
- docker:dind
221+
variables:
222+
DOCKER_HOST: tcp://localhost:2375
223+
DOCKER_DRIVER: overlay2
224+
GIT_STRATEGY: none
225+
# DOCKERFILE: tools/Dockerfile
226+
# CONTAINER_IMAGE: parity/parity
201227
script:
202-
- scripts/gitlab/publish-docker.sh parity
228+
# we stopped pushing nightlies to dockerhub, will push to own registry prb.
229+
- ./tools/publish-docker.sh
230+
tags:
231+
- kubernetes-parity-build
203232

204233
publish-snap: &publish-snap
205234
stage: publish
235+
<<: *no_git
206236
only: *releaseable_branches
207-
<<: *collect_artifacts
208237
image: snapcore/snapcraft
209238
variables:
210239
BUILD_ARCH: amd64
@@ -214,39 +243,43 @@ publish-snap: &publish-snap
214243
tags:
215244
- linux-docker
216245
script:
217-
- scripts/gitlab/publish-snap.sh
246+
- ./tools/publish-snap.sh
218247

219248
publish-snap-i386:
220249
<<: *publish-snap
221250
variables:
222251
BUILD_ARCH: i386
252+
CARGO_TARGET: i686-unknown-linux-gnu
223253
dependencies:
224254
- build-linux-i386
225255

226256
publish-snap-arm64:
227257
<<: *publish-snap
228258
variables:
229259
BUILD_ARCH: arm64
260+
CARGO_TARGET: aarch64-unknown-linux-gnu
230261
dependencies:
231262
- build-linux-arm64
232263

233264
publish-snap-armhf:
234265
<<: *publish-snap
235266
variables:
236267
BUILD_ARCH: armhf
268+
CARGO_TARGET: armv7-unknown-linux-gnueabihf
237269
dependencies:
238270
- build-linux-armhf
239271

240272
publish-onchain:
241273
stage: publish
274+
<<: *no_git
242275
only: *releaseable_branches
243276
cache: {}
244277
dependencies:
245278
- build-linux
246279
- build-darwin
247280
- build-windows
248281
script:
249-
- scripts/gitlab/publish-onchain.sh
282+
- ./tools/publish-onchain.sh
250283
tags:
251284
- linux-docker
252285

Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description = "Parity Ethereum client"
33
name = "parity-ethereum"
44
# NOTE Make sure to update util/version/Cargo.toml as well
5-
version = "2.5.1"
5+
version = "2.5.2"
66
license = "GPL-3.0"
77
authors = ["Parity Technologies <[email protected]>"]
88

@@ -118,10 +118,13 @@ path = "parity/lib.rs"
118118
path = "parity/main.rs"
119119
name = "parity"
120120

121-
[profile.dev]
121+
[profile.test]
122+
lto = false
123+
opt-level = 3 # makes tests slower to compile, but faster to run
122124

123125
[profile.release]
124126
debug = false
127+
lto = true
125128

126129
[workspace]
127130
# This should only list projects that are not

ethcore/blockchain/src/blockchain.rs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -668,21 +668,6 @@ impl BlockChain {
668668
self.db.key_value().read_with_cache(db::COL_EXTRA, &self.block_details, parent).map_or(false, |d| d.children.contains(hash))
669669
}
670670

671-
/// fetches the list of blocks from best block to n, and n's parent hash
672-
/// where n > 0
673-
pub fn block_headers_from_best_block(&self, n: u32) -> Option<(Vec<encoded::Header>, H256)> {
674-
let mut blocks = Vec::with_capacity(n as usize);
675-
let mut hash = self.best_block_hash();
676-
677-
for _ in 0..n {
678-
let current_hash = self.block_header_data(&hash)?;
679-
hash = current_hash.parent_hash();
680-
blocks.push(current_hash);
681-
}
682-
683-
Some((blocks, hash))
684-
}
685-
686671
/// Returns a tree route between `from` and `to`, which is a tuple of:
687672
///
688673
/// - a vector of hashes of all blocks, ordered from `from` to `to`.
@@ -869,6 +854,14 @@ impl BlockChain {
869854
}
870855
}
871856

857+
/// clears all caches for testing purposes
858+
pub fn clear_cache(&self) {
859+
self.block_bodies.write().clear();
860+
self.block_details.write().clear();
861+
self.block_hashes.write().clear();
862+
self.block_headers.write().clear();
863+
}
864+
872865
/// Update the best ancient block to the given hash, after checking that
873866
/// it's directly linked to the currently known best ancient block
874867
pub fn update_best_ancient_block(&self, hash: &H256) {

0 commit comments

Comments
 (0)