Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into bernhard-malus-fx
Browse files Browse the repository at this point in the history
* master:
  Bump tracing from 0.1.26 to 0.1.27 (#3841)
  Companion for substrate#9711 (#3801)
  fix complaints in CI (#3838)
  dockerfiles: upgrade to ubuntu:20.04; some chore (#3828)
  make polkadot-runtime optional feature (#3820)
  Companion for #9648 (#3757)
  Substrate Companion #9737 (#3830)
  Add logging for worker spawn failures (#3827)
  Add Canvas (#3823)
  Allow staking miner to use different election algorithms (#3752)
  • Loading branch information
ordian committed Sep 14, 2021
2 parents 5d8292b + 8b8d4c8 commit 99cb6e0
Show file tree
Hide file tree
Showing 73 changed files with 777 additions and 530 deletions.
11 changes: 11 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,17 @@ check-runtime-benchmarks:
- ./scripts/gitlab/check_runtime_benchmarks.sh
- sccache -s

check-no-default-features:
stage: test
<<: *rules-test
<<: *docker-env
<<: *compiler-info
<<: *vault-secrets
script:
# Check that polkadot-cli will compile no default features.
- ./scripts/gitlab/check_no_default_features.sh
- sccache -s

spellcheck:
stage: test
<<: *docker-env
Expand Down
415 changes: 181 additions & 234 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions bridges/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
# See the `deployments/README.md` for all the available `PROJECT` values.

FROM paritytech/bridges-ci:latest as builder
FROM docker.io/paritytech/bridges-ci:latest as builder
WORKDIR /parity-bridges-common

COPY . .
Expand All @@ -19,7 +19,7 @@ RUN cargo build --release --verbose -p ${PROJECT} && \

# In this final stage we copy over the final binary and do some checks
# to make sure that everything looks good.
FROM ubuntu:20.04 as runtime
FROM docker.io/library/ubuntu:20.04 as runtime

# show backtraces
ENV RUST_BACKTRACE 1
Expand Down
2 changes: 1 addition & 1 deletion bridges/ci.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is a "runtime" part from a builder-pattern in Dockerfile, it's used in CI.
# The only different part is that the compilation happens externally,
# so COPY has a different source.
FROM ubuntu:20.04
FROM docker.io/library/ubuntu:20.04

# show backtraces
ENV RUST_BACKTRACE 1
Expand Down
2 changes: 1 addition & 1 deletion bridges/deployments/BridgeDeps.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# This image is meant to be used as a building block when building images for
# the various components in the bridge repo, such as nodes and relayers.
FROM ubuntu:20.04
FROM docker.io/library/ubuntu:20.04

ENV LAST_DEPS_UPDATE 2021-04-01
ENV DEBIAN_FRONTEND=noninteractive
Expand Down
4 changes: 2 additions & 2 deletions bridges/deployments/bridges/poa-rialto/Front-end.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12 as build-deps
FROM docker.io/library/node:12 as build-deps

# install tools and dependencies
RUN set -eux; \
Expand All @@ -19,7 +19,7 @@ ENV EXPECTED_ETHEREUM_NETWORK_ID $EXPECTED_ETHEREUM_NETWORK_ID
RUN yarn build:docker

# Stage 2 - the production environment
FROM nginx:1.12
FROM docker.io/library/nginx:1.12
COPY --from=build-deps /usr/src/bridge-ui/nginx/*.conf /etc/nginx/conf.d/
COPY --from=build-deps /usr/src/bridge-ui/dist /usr/share/nginx/html
EXPOSE 80
Expand Down
2 changes: 1 addition & 1 deletion bridges/deployments/monitoring/GrafanaMatrix.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:alpine
FROM docker.io/library/ruby:alpine

RUN apk add --no-cache git

Expand Down
4 changes: 2 additions & 2 deletions bridges/deployments/networks/OpenEthereum.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:xenial AS builder
FROM docker.io/library/ubuntu:xenial AS builder

# show backtraces
ENV RUST_BACKTRACE 1
Expand Down Expand Up @@ -60,7 +60,7 @@ WORKDIR /openethereum
RUN cargo build --release --verbose
RUN strip ./target/release/openethereum

FROM ubuntu:xenial
FROM docker.io/library/ubuntu:xenial

# show backtraces
ENV RUST_BACKTRACE 1
Expand Down
5 changes: 3 additions & 2 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master",
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }

[features]
default = [ "wasmtime", "db", "cli", "full-node", "trie-memory-tracker" ]
default = [ "wasmtime", "db", "cli", "full-node", "trie-memory-tracker", "polkadot-native" ]
wasmtime = [ "sc-cli/wasmtime" ]
db = [ "service/db" ]
cli = [
Expand All @@ -59,9 +59,10 @@ trie-memory-tracker = [ "sp-trie/memory-tracker" ]
full-node = [ "service/full-node" ]
try-runtime = [ "service/try-runtime" ]

# Configure the native runtimes to use. Polkadot is always enabled by default.
# Configure the native runtimes to use. Polkadot is enabled by default.
#
# Validators require the native runtime currently
polkadot-native = [ "service/polkadot-native" ]
kusama-native = [ "service/kusama-native" ]
westend-native = [ "service/westend-native" ]
rococo-native = [ "service/rococo-native" ]
Expand Down
56 changes: 37 additions & 19 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ impl SubstrateCli for Cli {
name if name.starts_with("kusama-") && !name.ends_with(".json") =>
Err(format!("`{}` only supported with `kusama-native` feature enabled.", name))?,
"polkadot" => Box::new(service::chain_spec::polkadot_config()?),
#[cfg(feature = "polkadot-native")]
"polkadot-dev" | "dev" => Box::new(service::chain_spec::polkadot_development_config()?),
#[cfg(feature = "polkadot-native")]
"polkadot-local" => Box::new(service::chain_spec::polkadot_local_testnet_config()?),
#[cfg(feature = "polkadot-native")]
"polkadot-staging" => Box::new(service::chain_spec::polkadot_staging_testnet_config()?),
"rococo" => Box::new(service::chain_spec::rococo_config()?),
#[cfg(feature = "rococo-native")]
Expand Down Expand Up @@ -177,7 +180,13 @@ impl SubstrateCli for Cli {
)))]
let _ = spec;

&service::polkadot_runtime::VERSION
#[cfg(feature = "polkadot-native")]
{
return &service::polkadot_runtime::VERSION
}

#[cfg(not(feature = "polkadot-native"))]
panic!("No runtime feature (polkadot, kusama, westend, rococo) is enabled")
}
}

Expand Down Expand Up @@ -394,12 +403,17 @@ pub fn run() -> Result<()> {
}

// else we assume it is polkadot.
Ok(runner.sync_run(|config| {
cmd.run::<service::polkadot_runtime::Block, service::PolkadotExecutorDispatch>(
config,
)
.map_err(|e| Error::SubstrateCli(e))
})?)
#[cfg(feature = "polkadot-native")]
{
return Ok(runner.sync_run(|config| {
cmd.run::<service::polkadot_runtime::Block, service::PolkadotExecutorDispatch>(
config,
)
.map_err(|e| Error::SubstrateCli(e))
})?)
}
#[cfg(not(feature = "polkadot-native"))]
panic!("No runtime feature (polkadot, kusama, westend, rococo) is enabled")
},
Some(Subcommand::Key(cmd)) => Ok(cmd.run(&cli)?),
#[cfg(feature = "try-runtime")]
Expand All @@ -410,9 +424,8 @@ pub fn run() -> Result<()> {

use sc_service::TaskManager;
let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry);
let task_manager =
TaskManager::new(runner.config().task_executor.clone(), *registry)
.map_err(|e| Error::SubstrateService(sc_service::Error::Prometheus(e)))?;
let task_manager = TaskManager::new(runner.config().tokio_handle.clone(), *registry)
.map_err(|e| Error::SubstrateService(sc_service::Error::Prometheus(e)))?;

ensure_dev(chain_spec).map_err(Error::Other)?;

Expand Down Expand Up @@ -442,15 +455,20 @@ pub fn run() -> Result<()> {
})
}
// else we assume it is polkadot.
runner.async_run(|config| {
Ok((
cmd.run::<service::polkadot_runtime::Block, service::PolkadotExecutorDispatch>(
config,
)
.map_err(Error::SubstrateCli),
task_manager,
))
})
#[cfg(feature = "polkadot-native")]
{
return runner.async_run(|config| {
Ok((
cmd.run::<service::polkadot_runtime::Block, service::PolkadotExecutorDispatch>(
config,
)
.map_err(Error::SubstrateCli),
task_manager,
))
})
}
#[cfg(not(feature = "polkadot-native"))]
panic!("No runtime feature (polkadot, kusama, westend, rococo) is enabled")
},
#[cfg(not(feature = "try-runtime"))]
Some(Subcommand::TryRuntime) => Err(Error::Other(
Expand Down
7 changes: 4 additions & 3 deletions cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ mod cli;
#[cfg(feature = "cli")]
mod command;

pub use service::{
self, Block, CoreApi, IdentifyVariant, ProvideRuntimeApi, RuntimeApiCollection, TFullClient,
};
#[cfg(feature = "full-node")]
pub use service::RuntimeApiCollection;
#[cfg(feature = "service")]
pub use service::{self, Block, CoreApi, IdentifyVariant, ProvideRuntimeApi, TFullClient};

#[cfg(feature = "malus")]
pub use service::create_default_subsystems;
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM paritytech/ci-linux:production as builder
FROM docker.io/paritytech/ci-linux:production as builder
LABEL description="This is the build stage for Polkadot. Here we create the binary."

ARG PROFILE=release
Expand All @@ -10,7 +10,7 @@ RUN cargo build --$PROFILE

# ===== SECOND STAGE ======

FROM debian:buster-slim
FROM docker.io/library/ubuntu:20.04
LABEL description="This is the 2nd stage: a very small image where we copy the Polkadot binary."
ARG PROFILE=release
COPY --from=builder /polkadot/target/$PROFILE/polkadot /usr/local/bin
Expand Down
4 changes: 3 additions & 1 deletion node/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ pallet-mmr-primitives = { git = "https://github.com/paritytech/substrate", branc
beefy-primitives = { git = "https://github.com/paritytech/grandpa-bridge-gadget", branch = "master" }

# Polkadot Runtimes
polkadot-runtime = { path = "../../runtime/polkadot" }
polkadot-runtime = { path = "../../runtime/polkadot", optional = true }
kusama-runtime = { path = "../../runtime/kusama", optional = true }
westend-runtime = { path = "../../runtime/westend", optional = true }
rococo-runtime = { path = "../../runtime/rococo", optional = true }

polkadot-primitives = { path = "../../primitives" }

[features]
default = ["polkadot"]
polkadot = ["polkadot-runtime"]
kusama = ["kusama-runtime"]
rococo = ["rococo-runtime"]
westend = ["westend-runtime"]
12 changes: 12 additions & 0 deletions node/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,19 @@ pub type FullBackend = sc_service::TFullBackend<Block>;
pub type FullClient<RuntimeApi, ExecutorDispatch> =
sc_service::TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<ExecutorDispatch>>;

#[cfg(not(any(
feature = "rococo",
feature = "kusama",
feature = "westend",
feature = "polkadot"
)))]
compile_error!("at least one runtime feature must be enabled");

/// The native executor instance for Polkadot.
#[cfg(feature = "polkadot")]
pub struct PolkadotExecutorDispatch;

#[cfg(feature = "polkadot")]
impl sc_executor::NativeExecutionDispatch for PolkadotExecutorDispatch {
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;

Expand Down Expand Up @@ -233,6 +243,7 @@ macro_rules! with_client {
}
} => {
match $self {
#[cfg(feature = "polkadot")]
Self::Polkadot($client) => { $( $code )* },
#[cfg(feature = "westend")]
Self::Westend($client) => { $( $code )* },
Expand All @@ -249,6 +260,7 @@ macro_rules! with_client {
/// See [`ExecuteWithClient`] for more information.
#[derive(Clone)]
pub enum Client {
#[cfg(feature = "polkadot")]
Polkadot(Arc<FullClient<polkadot_runtime::RuntimeApi, PolkadotExecutorDispatch>>),
#[cfg(feature = "westend")]
Westend(Arc<FullClient<westend_runtime::RuntimeApi, WestendExecutorDispatch>>),
Expand Down
2 changes: 1 addition & 1 deletion node/collation-generation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"

[dependencies]
futures = "0.3.17"
tracing = "0.1.26"
tracing = "0.1.27"
polkadot-erasure-coding = { path = "../../erasure-coding" }
polkadot-node-primitives = { path = "../primitives" }
polkadot-node-subsystem = { path = "../subsystem" }
Expand Down
2 changes: 1 addition & 1 deletion node/core/approval-voting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2018"
futures = "0.3.17"
futures-timer = "3.0.2"
parity-scale-codec = { version = "2.0.0", default-features = false, features = ["bit-vec", "derive"] }
tracing = "0.1.26"
tracing = "0.1.27"
bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] }
lru = "0.6"
merlin = "2.0"
Expand Down
2 changes: 1 addition & 1 deletion node/core/av-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ futures = "0.3.17"
futures-timer = "3.0.2"
kvdb = "0.10.0"
thiserror = "1.0.26"
tracing = "0.1.26"
tracing = "0.1.27"
bitvec = "0.20.1"

parity-scale-codec = { version = "2.0.0", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion node/core/backing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ polkadot-node-subsystem-util = { path = "../../subsystem-util" }
erasure-coding = { package = "polkadot-erasure-coding", path = "../../../erasure-coding" }
statement-table = { package = "polkadot-statement-table", path = "../../../statement-table" }
bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] }
tracing = "0.1.26"
tracing = "0.1.27"
thiserror = "1.0.26"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion node/core/bitfield-signing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"

[dependencies]
futures = "0.3.17"
tracing = "0.1.26"
tracing = "0.1.27"
polkadot-primitives = { path = "../../../primitives" }
polkadot-node-subsystem = { path = "../../subsystem" }
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
Expand Down
2 changes: 1 addition & 1 deletion node/core/candidate-validation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
async-trait = "0.1.51"
futures = "0.3.17"
tracing = "0.1.26"
tracing = "0.1.27"

sp-maybe-compressed-blob = { package = "sp-maybe-compressed-blob", git = "https://github.com/paritytech/substrate", branch = "master" }
parity-scale-codec = { version = "2.0.0", default-features = false, features = ["bit-vec", "derive"] }
Expand Down
2 changes: 1 addition & 1 deletion node/core/chain-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"

[dependencies]
futures = "0.3.17"
tracing = "0.1.26"
tracing = "0.1.27"
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
polkadot-primitives = { path = "../../../primitives" }
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
Expand Down
2 changes: 1 addition & 1 deletion node/core/chain-selection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2018"
[dependencies]
futures = "0.3.17"
futures-timer = "3"
tracing = "0.1.26"
tracing = "0.1.27"
polkadot-primitives = { path = "../../../primitives" }
polkadot-node-primitives = { path = "../../primitives" }
polkadot-node-subsystem = { path = "../../subsystem" }
Expand Down
2 changes: 1 addition & 1 deletion node/core/dispute-coordinator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] }
futures = "0.3.17"
tracing = "0.1.26"
tracing = "0.1.27"
parity-scale-codec = "2"
kvdb = "0.10.0"
derive_more = "0.99.14"
Expand Down
2 changes: 1 addition & 1 deletion node/core/dispute-participation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
futures = "0.3.17"
thiserror = "1.0.26"
tracing = "0.1.26"
tracing = "0.1.27"

polkadot-node-primitives = { path = "../../primitives" }
polkadot-node-subsystem = { path = "../../subsystem" }
Expand Down
2 changes: 1 addition & 1 deletion node/core/parachains-inherent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
futures = "0.3.17"
futures-timer = "3.0.2"
tracing = "0.1.26"
tracing = "0.1.27"
thiserror = "1.0.26"
async-trait = "0.1.51"
polkadot-node-subsystem = { path = "../../subsystem" }
Expand Down
2 changes: 1 addition & 1 deletion node/core/provisioner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] }
futures = "0.3.17"
tracing = "0.1.26"
tracing = "0.1.27"
thiserror = "1.0.26"
polkadot-primitives = { path = "../../../primitives" }
polkadot-node-subsystem = { path = "../../subsystem" }
Expand Down
Loading

0 comments on commit 99cb6e0

Please sign in to comment.