Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump dependencies of Cumulus to polkadot-v0.9.9 #253

Merged
merged 7 commits into from
Aug 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,285 changes: 1,274 additions & 1,011 deletions Cargo.lock

Large diffs are not rendered by default.

217 changes: 108 additions & 109 deletions Cargo.toml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ cd -
```bash
git clone -n https://github.com/paritytech/polkadot.git /tmp/polkadot
cd /tmp/polkadot
git checkout release-v0.9.8
git checkout release-v0.9.9
cargo build --release
cd -
```
Expand Down Expand Up @@ -136,14 +136,14 @@ wget -O ~/bifrost-fullnode/bifrost.json https://github.com/bifrost-finance/bifro

Replace your-fullnode-name
```sh
docker pull bifrostnetwork/bifrost:v0.8.1-fix_crash
docker pull bifrostnetwork/bifrost:v0.8.3
docker run -d \
-v ~/bifrost-fullnode:/bifrost \
-p 9944:9944 \
-p 9933:9933 \
-p 30333:30333 \
-p 9615:9615 \
bifrostnetwork/bifrost:v0.8.1-fix_crash \
bifrostnetwork/bifrost:v0.8.3 \
--name your-fullnode-name \
--base-path "/bifrost" \
--node-key-file "/bifrost/network/node-key" \
Expand Down
33 changes: 17 additions & 16 deletions node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,37 @@ log = "0.4.8"
structopt = { version = "0.3.8", optional = true }

# primitives
sp-core = { version = "3.0.0" }
sp-runtime = { version = "3.0.0" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }

# client dependencies
sc-service = { version = "0.9.0", optional = true }
sc-tracing = { version = "3.0.0" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", optional = true }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }

# node-specific dependencies
node-service = { path = "../service", default-features = false }
node-primitives = { path = "../primitives" }

# CLI-specific dependencies
sc-cli = { version = "0.9.0", optional = true }
try-runtime-cli = { version = "0.9.0", optional = true }
frame-try-runtime = { version = "0.9.0", optional = true }
frame-benchmarking-cli = { version = "3.0.0", optional = true }
node-inspect = { version = "0.8.0", optional = true }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", optional = true }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", optional = true }
frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", optional = true }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", optional = true }
node-inspect = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", optional = true }

# Cumulus dependencies
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.8" }
cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.8" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.8" }
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.9" }
cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.9" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.9" }

# Polkadot dependencies
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.8" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.8" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.8" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.9" }

[build-dependencies]
substrate-build-script-utils = { version = "3.0.0", optional = true }
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", optional = true }

[features]
default = [ "wasmtime", "cli" ]
Expand Down
18 changes: 14 additions & 4 deletions node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ impl DefaultConfigurationValues for RelayChainCli {
}

fn prometheus_listen_port() -> u16 {
9615
9616
}
}

Expand Down Expand Up @@ -559,9 +559,8 @@ impl CliConfiguration<Self> for RelayChainCli {
self.base.base.rpc_ws(default_listen_port)
}

fn prometheus_config(&self, _default_listen_port: u16) -> Result<Option<PrometheusConfig>> {
// self.base.base.prometheus_config(default_listen_port)
Ok(None)
fn prometheus_config(&self, default_listen_port: u16) -> Result<Option<PrometheusConfig>> {
self.base.base.prometheus_config(default_listen_port)
}

fn init<C: SubstrateCli>(&self) -> Result<()> {
Expand Down Expand Up @@ -594,6 +593,10 @@ impl CliConfiguration<Self> for RelayChainCli {
self.base.base.rpc_ws_max_connections()
}

fn rpc_http_threads(&self) -> Result<Option<usize>> {
self.base.base.rpc_http_threads()
}

fn rpc_cors(&self, is_dev: bool) -> Result<Option<Vec<String>>> {
self.base.base.rpc_cors(is_dev)
}
Expand Down Expand Up @@ -621,4 +624,11 @@ impl CliConfiguration<Self> for RelayChainCli {
fn announce_block(&self) -> Result<bool> {
self.base.base.announce_block()
}

fn telemetry_endpoints(
&self,
chain_spec: &Box<dyn ChainSpec>,
) -> Result<Option<sc_telemetry::TelemetryEndpoints>> {
self.base.base.telemetry_endpoints(chain_spec)
}
}
12 changes: 6 additions & 6 deletions node/inspect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ edition = "2018"
[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0" }
derive_more = "0.99"
sc-cli = "0.9.0"
sc-client-api = "3.0.0"
sc-service = { version = "0.9.0", default-features = false }
sp-blockchain = "3.0.0"
sp-core = "3.0.0"
sp-runtime = "3.0.0"
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }
structopt = "0.3.8"
8 changes: 4 additions & 4 deletions node/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ edition = "2018"
bstringify = "0.1.2"
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.124", optional = true }
frame-system = { version = "3.0.0", default-features = false }
sp-core = { version = "3.0.0", default-features = false }
sp-runtime = { version = "3.0.0", default-features = false }
sp-std = { version = "3.0.0", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9", default-features = false }
zenlink-protocol = { version = "*", default-features = false }

[features]
Expand Down
51 changes: 25 additions & 26 deletions node/primitives/src/currency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use bstringify::bstringify;
use codec::{Decode, Encode};
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};
use sp_runtime::{RuntimeDebug, SaturatedConversion};
use sp_runtime::RuntimeDebug;
use sp_std::{
convert::{Into, TryFrom, TryInto},
prelude::*,
Expand Down Expand Up @@ -75,21 +75,28 @@ macro_rules! create_currency_id {
type Error = ();
fn try_from(id: CurrencyId) -> Result<AssetId, ()> {
let _index = match id {
$(CurrencyId::Native(TokenSymbol::$symbol) => Ok((0_u32, TokenSymbol::$symbol as u32)),)*
$(CurrencyId::VToken(TokenSymbol::$symbol) => Ok((1_u32, TokenSymbol::$symbol as u32)),)*
$(CurrencyId::Token(TokenSymbol::$symbol) => Ok((2_u32, TokenSymbol::$symbol as u32)),)*
$(CurrencyId::Stable(TokenSymbol::$symbol) => Ok((3_u32, TokenSymbol::$symbol as u32)),)*
$(CurrencyId::VSToken(TokenSymbol::$symbol) => Ok((4_u32, TokenSymbol::$symbol as u32)),)*
$(CurrencyId::Native(TokenSymbol::$symbol) => Ok((0_u64, TokenSymbol::$symbol as u64)),)*
$(CurrencyId::VToken(TokenSymbol::$symbol) => Ok((1_u64, TokenSymbol::$symbol as u64)),)*
$(CurrencyId::Token(TokenSymbol::$symbol) => Ok((2_u64, TokenSymbol::$symbol as u64)),)*
$(CurrencyId::Stable(TokenSymbol::$symbol) => Ok((3_u64, TokenSymbol::$symbol as u64)),)*
$(CurrencyId::VSToken(TokenSymbol::$symbol) => Ok((4_u64, TokenSymbol::$symbol as u64)),)*
CurrencyId::LPToken(symbol0, index0, symbol1, index1) => {
let currency_index0 =
(((((index0 as u64) << 8) & 0x0000_ff00) + (symbol0 as u64 & 0x0000_00ff)) as u64) << 16;
let currency_index1 =
(((((index1 as u64) << 8) & 0x0000_ff00) + (symbol1 as u64 & 0x0000_00ff)) as u64) << 32;
Ok((6 as u64, currency_index0 + currency_index1))
}
_ => Err(()),
};
let asset_index: u32 = ((_index?.0 << 8) & 0x0000_ff00) + (_index?.1 & 0x0000_00ff);
let asset_index = ((_index?.0 << 8) & 0x0000_ff00) + (_index?.1 & 0x0000_00ff);
if id.is_native() {
Ok(AssetId { chain_id: BIFROST_PARACHAIN_ID, asset_type: NATIVE, asset_index: 0 })
} else {
Ok(AssetId {
chain_id: BIFROST_PARACHAIN_ID,
asset_type: LOCAL,
asset_index: asset_index,
asset_index: asset_index as u64,
})
}
}
Expand All @@ -103,25 +110,17 @@ macro_rules! create_currency_id {
// TokenSymbol Index: 1byte
type Error = ();
fn try_into(self) -> Result<CurrencyId, Self::Error> {
let id: u32 = self.asset_index.saturated_into();
let c_discr = (id >> 8) as u32;
let _index = (0x0000_00ff & id) as u32;
let token_symbol = match _index {
$(x if x == TokenSymbol::$symbol as u32 => Ok(TokenSymbol::$symbol),)*
_ => Err(()),
};
let id = self.asset_index;
let c_discr = ((id & 0x0000_0000_0000_ff00) >> 8) as u32;
let _index = (0x0000_00ff & id) as u8;

match c_discr {
0 => {
if (_index == 0) {
Ok(CurrencyId::Native(TokenSymbol::ASG))
} else {
Ok(CurrencyId::Native(TokenSymbol::BNC))
}
},
1 => Ok(CurrencyId::VToken(token_symbol?)),
2 => Ok(CurrencyId::Token(token_symbol?)),
3 => Ok(CurrencyId::Stable(token_symbol?)),
4 => Ok(CurrencyId::VSToken(token_symbol?)),
0 => Ok(CurrencyId::Native(TokenSymbol::try_from(_index)?)),
1 => Ok(CurrencyId::VToken(TokenSymbol::try_from(_index)?)),
2 => Ok(CurrencyId::Token(TokenSymbol::try_from(_index)?)),
3 => Ok(CurrencyId::Stable(TokenSymbol::try_from(_index)?)),
4 => Ok(CurrencyId::VSToken(TokenSymbol::try_from(_index)?)),
6 => Ok(CurrencyId::try_from(id)?),
_ => Err(()),
}
}
Expand Down
12 changes: 6 additions & 6 deletions node/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
jsonrpc-core = "15.1.0"
node-primitives = { path = "../primitives" }
sc-rpc-api = { version = "0.9.0" }
sc-rpc = { version = "3.0.0" }
sp-api = { version = "3.0.0" }
sp-blockchain = { version = "3.0.0" }
sp-transaction-pool = { version = "3.0.0" }
pallet-transaction-payment-rpc = { version = "3.0.0" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }
bifrost-flexible-fee-rpc = { path = "../../pallets/flexible-fee/rpc" }
bifrost-flexible-fee-rpc-runtime-api = { path = "../../pallets/flexible-fee/rpc/runtime-api" }
zenlink-protocol-rpc = "*"
Expand Down
13 changes: 7 additions & 6 deletions node/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@

use std::sync::Arc;

use bifrost_flexible_fee_rpc::{FeeRpcApi, FlexibleFeeStruct};
use bifrost_flexible_fee_rpc_runtime_api::FlexibleFeeRuntimeApi as FeeRuntimeApi;
use node_primitives::{AccountId, Balance, Block};
pub use sc_rpc_api::DenyUnsafe;
use sc_transaction_pool_api::TransactionPool;
use sp_api::ProvideRuntimeApi;
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
use sp_transaction_pool::TransactionPool;
use zenlink_protocol_rpc::{ZenlinkProtocol, ZenlinkProtocolApi};
use zenlink_protocol_runtime_api::ZenlinkProtocolApi as ZenlinkProtocolRuntimeApi;

/// Full client dependencies.
Expand All @@ -58,7 +60,9 @@ pub type RpcExtension = jsonrpc_core::IoHandler<sc_rpc::Metadata>;
///
/// NOTE: It's a `PATCH` for the RPC of asgard runtime.
#[allow(non_snake_case)]
pub fn PATCH_FOR_ASGARD_create_full<C, P>(deps: FullDeps<C, P>) -> RpcExtension
pub fn PATCH_FOR_ASGARD_create_full<C, P>(
deps: FullDeps<C, P>,
) -> Result<jsonrpc_core::IoHandler<sc_rpc_api::Metadata>, Box<dyn std::error::Error + Send + Sync>>
where
C: ProvideRuntimeApi<Block>,
C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError>,
Expand All @@ -76,12 +80,9 @@ where

io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone())));

use bifrost_flexible_fee_rpc::{FeeRpcApi, FlexibleFeeStruct};
use zenlink_protocol_rpc::{ZenlinkProtocol, ZenlinkProtocolApi};

io.extend_with(FeeRpcApi::to_delegate(FlexibleFeeStruct::new(client.clone())));

io.extend_with(ZenlinkProtocolApi::to_delegate(ZenlinkProtocol::new(client.clone())));

io
Ok(io)
}
Loading