Skip to content

Commit

Permalink
Squashed 'bridges/' changes from 746a4027..5330d84e
Browse files Browse the repository at this point in the history
5330d84e CLI: naming clean-up. (paritytech#897)
f99f2225 Westend<>Rococo Headers Relay (paritytech#875)
72c9117b Use complex headers+messages relay in test deployments (paritytech#905)
48423d5b Stop recursing when creating test headers (paritytech#906)
f8586fd4 Fix outstanding bridge names. (paritytech#901)
54b683b3 Complex headers+messages Millau<->Rialto relay (paritytech#878)
c0e77ca1 fix message generator scripts (paritytech#900)
debf3a82 Use Substrate state_getReadProof RPC method to get storage proofs (paritytech#893)
c3fa7216 Support more than `u8::max_value` GRANDPA validators (paritytech#896)
e5cb87f9 Grandpa Pallet Pruning (paritytech#890)
0b6a8920 RestartNeeded is a connection error (paritytech#894)
2cf5fa26 CLI: Estimate Fee (paritytech#888)
7dace624 CLI: Send Message (paritytech#886)
f8eaecfa CLI: Encode Message (paritytech#889)
1610f868 Bump `jsonrpsee` to Alpha.3 (paritytech#892)
d665b531 Use new Cargo feature resolver (paritytech#891)
ce2ee6ed Rialto Millau Maintenance Dashboard (paritytech#881)
7c585ce8 Revert to older nightly. (paritytech#887)
73a0470e Adding GrandpaJustification custom type (paritytech#882)
b9ccea9c Install CA certificates in relay images (paritytech#880)
ec7841a2 fix widget names (paritytech#879)
REVERT: 746a4027 Accidentally committed `cargo-expand`ed code 🤦
REVERT: 1a5d09c5 Add note to more closely match `initialize` Call variant
REVERT: fdd6e6b3 Add `submit_finality_proof` mock Call variant
REVERT: 768b053e Simplify the Rococo and Westend signing params
REVERT: 62aca80e Add Westend<>Rococo variants to `relay_headers`
REVERT: 0bcb0f51 Add Westend<>Rococo variants to `init_bridge`
REVERT: 01d1305f Use mock Westend and Rococo finaltiy tx calls
REVERT: fb34b9dd Add modules for Rococo<>Westend header sync

git-subtree-dir: bridges
git-subtree-split: 5330d84e9511e38cf9d9ec765bee865fedd4b260
  • Loading branch information
HCastano committed Apr 15, 2021
1 parent 0097a04 commit 5abf22b
Show file tree
Hide file tree
Showing 102 changed files with 5,441 additions and 5,286 deletions.
52 changes: 26 additions & 26 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ jobs:
toolchain:
- stable
#- beta
- nightly
- nightly-2021-04-10
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: full
NIGHTLY: nightly #if necessary, specify the version, nightly-2020-10-04, etc.
NIGHTLY: nightly-2021-04-10 #if necessary, specify the version, nightly-2020-10-04, etc.
steps:

- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout sources & submodules
uses: actions/checkout@master
with:
fetch-depth: 5
submodules: recursive

- name: Install Toolchain
run: rustup toolchain add $NIGHTLY

- name: Add WASM Utilities
run: rustup target add wasm32-unknown-unknown --toolchain $NIGHTLY

- name: Checking rust-${{ matrix.toolchain }}
uses: actions-rs/cargo@master
with:
Expand All @@ -69,14 +69,14 @@ jobs:
with:
command: check
toolchain: ${{ matrix.toolchain }}
args: --manifest-path ./bin/rialto/node/Cargo.toml --no-default-features --features runtime-benchmarks --verbose
args: -p rialto-runtime --features runtime-benchmarks --verbose

- name: Check Millau benchmarks runtime ${{ matrix.platform }} rust-${{ matrix.toolchain }}
uses: actions-rs/cargo@master
with:
command: check
toolchain: ${{ matrix.toolchain }}
args: --manifest-path ./bin/millau/node/Cargo.toml --no-default-features --features runtime-benchmarks --verbose
args: -p millau-runtime --features runtime-benchmarks --verbose

## Build Stage
build:
Expand All @@ -90,34 +90,34 @@ jobs:
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: full
NIGHTLY: nightly #if necessary, specify the version, nightly-2020-10-04, etc.
NIGHTLY: nightly-2021-04-10 #if necessary, specify the version, nightly-2020-10-04, etc.
steps:

- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout sources & submodules
uses: actions/checkout@master
with:
fetch-depth: 5
submodules: recursive

- name: Install Toolchain
run: rustup toolchain add $NIGHTLY

- name: Add WASM Utilities
run: rustup target add wasm32-unknown-unknown --toolchain $NIGHTLY

- name: Building rust-${{ matrix.toolchain }}
uses: actions-rs/cargo@master
if: github.ref == 'refs/heads/master'
with:
command: build
toolchain: ${{ matrix.toolchain }}
args: --all --verbose

- name: Prepare artifacts
if: github.ref == 'refs/heads/master'
run: |
Expand All @@ -127,7 +127,7 @@ jobs:
mv -v target/debug/ethereum-poa-relay ./artifacts/;
mv -v target/debug/substrate-relay ./artifacts/;
shell: bash

- name: Upload artifacts
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v1
Expand All @@ -141,35 +141,35 @@ jobs:
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: full
NIGHTLY: nightly #if necessary, specify the version, nightly-2020-10-04, etc.
NIGHTLY: nightly-2021-04-10 #if necessary, specify the version, nightly-2020-10-04, etc.
steps:

- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout sources & submodules
uses: actions/checkout@master
with:
fetch-depth: 5
submodules: recursive

- name: Install Toolchain
run: rustup toolchain add $NIGHTLY

- name: Add WASM Utilities
run: rustup target add wasm32-unknown-unknown --toolchain $NIGHTLY

- name: Add clippy
run: rustup component add clippy --toolchain $NIGHTLY

- name: Rust Cache
uses: Swatinem/[email protected]

- name: Clippy
uses: actions-rs/cargo@master
with:
command: clippy
toolchain: nightly #if necessary, specify the version, nightly-2020-10-04, etc.
toolchain: nightly-2021-04-10 #if necessary, specify the version, nightly-2020-10-04, etc.
args: --all-targets -- -D warnings
51 changes: 21 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"

members = [
"bin/*/node",
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ ENV DEBIAN_FRONTEND=noninteractive

RUN set -eux; \
apt-get update && \
apt-get install -y --no-install-recommends \
libssl-dev curl && \
apt-get install -y curl ca-certificates && \
apt-get install -y --no-install-recommends libssl-dev && \
update-ca-certificates && \
groupadd -g 1000 user && \
useradd -u 1000 -g user -s /bin/sh -m user && \
# apt clean up
Expand Down
1 change: 0 additions & 1 deletion bin/millau/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ bp-millau= { path = "../../../primitives/chain-millau" }
bp-runtime = { path = "../../../primitives/runtime" }
millau-runtime = { path = "../runtime" }
pallet-bridge-messages = { path = "../../../modules/messages" }
pallet-bridge-messages-rpc = { path = "../../../modules/messages/rpc" }

# Substrate Dependencies

Expand Down
38 changes: 1 addition & 37 deletions bin/millau/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,40 +211,8 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
let prometheus_registry = config.prometheus_registry().cloned();

let rpc_extensions_builder = {
use bp_messages::{LaneId, MessageNonce};
use bp_runtime::{InstanceId, RIALTO_BRIDGE_INSTANCE};
use sc_finality_grandpa::FinalityProofProvider as GrandpaFinalityProofProvider;
use sp_core::storage::StorageKey;

// This struct is here to ease update process.

/// Millau runtime from messages RPC point of view.
struct MillauMessagesKeys;

impl pallet_bridge_messages_rpc::Runtime for MillauMessagesKeys {
fn message_key(&self, instance: &InstanceId, lane: &LaneId, nonce: MessageNonce) -> Option<StorageKey> {
match *instance {
RIALTO_BRIDGE_INSTANCE => Some(millau_runtime::rialto_messages::message_key(lane, nonce)),
_ => None,
}
}

fn outbound_lane_data_key(&self, instance: &InstanceId, lane: &LaneId) -> Option<StorageKey> {
match *instance {
RIALTO_BRIDGE_INSTANCE => Some(millau_runtime::rialto_messages::outbound_lane_data_key(lane)),
_ => None,
}
}

fn inbound_lane_data_key(&self, instance: &InstanceId, lane: &LaneId) -> Option<StorageKey> {
match *instance {
RIALTO_BRIDGE_INSTANCE => Some(millau_runtime::rialto_messages::inbound_lane_data_key(lane)),
_ => None,
}
}
}

use pallet_bridge_messages_rpc::{MessagesApi, MessagesRpcHandler};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
use sc_finality_grandpa_rpc::{GrandpaApi, GrandpaRpcHandler};
use sc_rpc::DenyUnsafe;
Expand All @@ -259,7 +227,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
let shared_voter_state = sc_finality_grandpa::SharedVoterState::empty();

let finality_proof_provider =
GrandpaFinalityProofProvider::new_for_service(backend.clone(), Some(shared_authority_set.clone()));
GrandpaFinalityProofProvider::new_for_service(backend, Some(shared_authority_set.clone()));

Box::new(move |_, subscription_executor| {
let mut io = jsonrpc_core::IoHandler::default();
Expand All @@ -278,10 +246,6 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
subscription_executor,
finality_proof_provider.clone(),
)));
io.extend_with(MessagesApi::to_delegate(MessagesRpcHandler::new(
backend.clone(),
Arc::new(MillauMessagesKeys),
)));
io
})
};
Expand Down
3 changes: 3 additions & 0 deletions bin/millau/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,6 @@ std = [
"sp-trie/std",
"sp-version/std",
]
# TODO: https://github.com/paritytech/parity-bridges-common/issues/390
# I've left the feature flag here to test our CI configuration
runtime-benchmarks = []
Loading

0 comments on commit 5abf22b

Please sign in to comment.