Skip to content

Commit

Permalink
fix: 🐛 merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
yooml committed Dec 3, 2023
2 parents f3b7d62 + cabb9d9 commit b784a34
Show file tree
Hide file tree
Showing 129 changed files with 2,452 additions and 2,156 deletions.
721 changes: 338 additions & 383 deletions Cargo.lock

Large diffs are not rendered by default.

266 changes: 248 additions & 18 deletions Cargo.toml

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ init:

.PHONY: build-bifrost-kusama-release # build bifrost kusama release
build-bifrost-kusama-release: copy-genesis-config-release
cargo build -p node-cli --locked --features "with-bifrost-kusama-runtime" --release
cargo build -p bifrost-cli --locked --features "with-bifrost-kusama-runtime" --release

.PHONY: build-bifrost-polkadot-release # build bifrost polkadot release
build-bifrost-polkadot-release:
cargo build -p node-cli --locked --features "with-bifrost-polkadot-runtime" --release
cargo build -p bifrost-cli --locked --features "with-bifrost-polkadot-runtime" --release

.PHONY: build-all-release # build all runtime release
build-all-release: copy-genesis-config-release
cargo build -p node-cli --locked --features "with-all-runtime" --release
cargo build -p bifrost-cli --locked --features "with-all-runtime" --release

.PHONY: check-all # cargo check all runtime
check-all: format
SKIP_WASM_BUILD= cargo check -p node-cli --locked --features "with-all-runtime,runtime-benchmarks,try-runtime"
SKIP_WASM_BUILD= cargo check -p bifrost-cli --locked --features "with-all-runtime,runtime-benchmarks,try-runtime"

.PHONY: test-all # cargo test all
test-all: integration-test test-runtimes test-benchmarks
test-all: test-runtimes test-benchmarks


.PHONY: test-runtimes
Expand All @@ -39,7 +39,7 @@ test-runtimes:

.PHONY: test-benchmarks
test-benchmarks:
cargo test --all benchmarking --features="runtime-benchmarks, polkadot" --exclude "*integration*" --exclude "node-*" --exclude "*-runtime"
cargo test --all benchmarking --features="runtime-benchmarks, polkadot" --exclude "*integration*" --exclude "bifrost-cli" --exclude "bifrost-rpc" --exclude "bifrost-service" --exclude "*-runtime"

.PHONY: integration-test # integration test
integration-test:
Expand Down Expand Up @@ -72,16 +72,16 @@ clippy:

.PHONY: benchmarking-staking # benchmarking staking pallet
benchmarking-staking:
cargo run -p node-cli --locked --features "with-bifrost-kusama-runtime,runtime-benchmarks" --release \
cargo run -p bifrost-cli --locked --features "with-bifrost-kusama-runtime,runtime-benchmarks" --release \
-- benchmark --chain=bifrost-local --steps=50 \
--repeat=20 \
--pallet=parachain_staking \
--pallet=bifrost_parachain_staking \
--extrinsic="*" \
--execution=wasm \
--wasm-execution=compiled \
--heap-pages=4096 \
--header=./HEADER-GPL3 \
--output="./runtime/bifrost-kusama/src/weights/parachain_staking.rs"
--output="./runtime/bifrost-kusama/src/weights/bifrost_parachain_staking.rs"

.PHONY: generate-bifrost-kusama-weights # generate bifrost-kusama weights
generate-bifrost-kusama-weights:
Expand All @@ -96,7 +96,7 @@ generate-all-weights: generate-bifrost-kusama-weights generate-bifrost-polkadot-

.PHONY: build-all-release-with-bench # build all release with benchmarking
build-all-release-with-bench: copy-genesis-config-release
cargo build -p node-cli --locked --features "with-all-runtime,runtime-benchmarks" --release
cargo build -p bifrost-cli --locked --features "with-all-runtime,runtime-benchmarks" --release

# Build docker image
.PHONY: build-docker-image # build docker image
Expand Down Expand Up @@ -163,7 +163,7 @@ copy-genesis-config-production:

.PHONY: production-release # build release for production
production-release:
cargo build -p node-cli --locked --features "with-all-runtime" --profile production
cargo build -p bifrost-cli --locked --features "with-all-runtime" --profile production

.PHONY: help # generate list of targets with descriptions
help:
Expand Down
2 changes: 1 addition & 1 deletion docs/eos/references-for-w3m1.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#### P2P protocol for EOS
Basicly, we have developed a customized EOS([bifrost-eos-relay](https://github.com/bifrost-finance/bifrost-eos-relay)) node which is capable of p2p communication already.
Basically, we have developed a customized EOS([bifrost-eos-relay](https://github.com/bifrost-finance/bifrost-eos-relay)) node which is capable of p2p communication already.
We add a plugin named [bridge-plugin](https://github.com/bifrost-finance/bifrost-eos-relay/tree/master/plugins/bridge_plugin).
And you have tested it as well, start two EOS nodes, one is for producing blocks, and another one as relay node to synchronize blocks and send block headers and transactions
to Bifrost node to verify and map transactions to to Bifrost node.
Expand Down
56 changes: 28 additions & 28 deletions integration-tests/bifrost-kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,40 @@ authors = ["Ron Yang <[email protected]>"]
edition = "2021"

[dependencies]
env_logger = "0.10.0"
log = { version = "0.4.17" }
hex-literal = "0.3.1"
codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false }
env_logger = { workspace = true }
log = { workspace = true }
hex-literal = { workspace = true }
parity-scale-codec = { workspace = true }

# Substrate
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
pallet-referenda = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
pallet-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
sp-runtime = { workspace = true }
sp-io = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
pallet-balances = { workspace = true }
pallet-assets = { workspace = true }
pallet-conviction-voting = { workspace = true }
pallet-referenda = { workspace = true }
pallet-staking = { workspace = true }

# Polkadot
polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
kusama-runtime = { package = "staging-kusama-runtime", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
polkadot-parachain-primitives = { workspace = true }
kusama-runtime = { workspace = true }
xcm = { workspace = true }
pallet-xcm = { workspace = true }
pallet-message-queue = { workspace = true }

# Cumulus
parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
xcm-emulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
parachains-common = { workspace = true }
xcm-emulator = { workspace = true }

# Local
integration-tests-common = { path = "../common", default-features = false}
bifrost-slp = { path = "../../pallets/slp" }
bifrost-vtoken-voting = { path = "../../pallets/vtoken-voting" }
bifrost-primitives = { path = "../../primitives" }
bifrost-asset-registry = { path = "../../pallets/asset-registry" }
bifrost-kusama-runtime = { path = "../../runtime/bifrost-kusama" }
bifrost-runtime-common = { path = "../../runtime/common" }
orml-traits = "0.4.1-dev"
orml-tokens = "0.4.1-dev"
bifrost-slp = { workspace = true }
bifrost-vtoken-voting = { workspace = true }
bifrost-primitives = { workspace = true }
bifrost-asset-registry = { workspace = true }
bifrost-kusama-runtime = { workspace = true }
bifrost-runtime-common = { workspace = true }
orml-traits = { workspace = true }
orml-tokens = { workspace = true }
2 changes: 1 addition & 1 deletion integration-tests/bifrost-kusama/src/general_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use bifrost_primitives::{CurrencyId, TokenSymbol};
use codec::Encode;
use integration_tests_common::BifrostKusama;
use parity_scale_codec::Encode;
use sp_runtime::BoundedVec;
use xcm::prelude::*;
use xcm_emulator::TestExt;
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/bifrost-kusama/src/transact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
use crate::vtoken_voting::set_balance_proposal_bounded;
use bifrost_kusama_runtime::{Runtime, RuntimeCall, RuntimeEvent, System};
use bifrost_primitives::Balance;
use codec::Encode;
use frame_support::{
assert_ok,
dispatch::{GetDispatchInfo, RawOrigin},
};
use integration_tests_common::{BifrostKusama, Kusama, KusamaAlice};
use pallet_conviction_voting::{AccountVote, Vote};
use parity_scale_codec::Encode;
use xcm::v3::{prelude::*, Weight};
use xcm_emulator::{bx, Parachain, RelayChain, TestExt};

Expand Down
32 changes: 16 additions & 16 deletions integration-tests/bifrost-polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ authors = ["Ron Yang <[email protected]>"]
edition = "2021"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false }
parity-scale-codec = { workspace = true }

# Substrate
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
sp-runtime = { workspace = true }
sp-io = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
pallet-balances = { workspace = true }

# Polkadot
polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
polkadot-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
polkadot-parachain-primitives = { workspace = true }
polkadot-runtime-parachains = { workspace = true }
polkadot-runtime = { workspace = true }
xcm = { workspace = true }
pallet-xcm = { workspace = true }

# Cumulus
parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
xcm-emulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
parachains-common = { workspace = true }
xcm-emulator = { workspace = true }

# Local
integration-tests-common = { path = "../common", default-features = false}
bifrost-primitives = { path = "../../primitives" }
bifrost-asset-registry = { path = "../../pallets/asset-registry" }
bifrost-polkadot-runtime = { path = "../../runtime/bifrost-polkadot" }
bifrost-primitives = { workspace = true }
bifrost-asset-registry = { workspace = true }
bifrost-polkadot-runtime = { workspace = true }
68 changes: 34 additions & 34 deletions integration-tests/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,44 @@ authors = ["hqwangningbo <[email protected]>"]
edition = "2021"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false }
paste = "1.0.14"
parity-scale-codec = { workspace = true }
paste = { workspace = true }

# Substrate
grandpa = { package = "sc-consensus-grandpa", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
pallet-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
pallet-im-online = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
beefy-primitives = { package = "sp-consensus-beefy", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-consensus-grandpa = { workspace = true }
sp-authority-discovery = { workspace = true }
sp-runtime = { workspace = true }
frame-support = { workspace = true }
sp-core = { workspace = true }
sp-consensus-babe = { workspace = true }
pallet-assets = { workspace = true }
pallet-staking = { workspace = true }
pallet-message-queue = { workspace = true }
pallet-im-online = { workspace = true }
sp-consensus-beefy = { workspace = true }

# Polkadot
polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
polkadot-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, features = ["full-node"] }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
polkadot-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
polkadot-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
kusama-runtime = { package = "staging-kusama-runtime", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
kusama-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
polkadot-core-primitives = { workspace = true }
polkadot-parachain-primitives = { workspace = true }
polkadot-service = { workspace = true }
polkadot-primitives = { workspace = true }
polkadot-runtime-parachains = { workspace = true }
polkadot-runtime = { workspace = true }
polkadot-runtime-constants = { workspace = true }
kusama-runtime = { workspace = true }
kusama-runtime-constants = { workspace = true }
xcm = { workspace = true }
pallet-xcm = { workspace = true }

# Cumulus
parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
xcm-emulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false}
cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
parachains-common = { workspace = true }
cumulus-primitives-core = { workspace = true }
xcm-emulator = { workspace = true }
cumulus-pallet-dmp-queue = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
cumulus-pallet-parachain-system = { workspace = true }

bifrost-polkadot-runtime = { path = "../../runtime/bifrost-polkadot" }
bifrost-kusama-runtime = { path = "../../runtime/bifrost-kusama" }
parachain-staking = { path = "../../pallets/parachain-staking" }
bifrost-primitives = { path = "../../primitives" }
bifrost-polkadot-runtime = { workspace = true }
bifrost-kusama-runtime = { workspace = true }
bifrost-parachain-staking = { workspace = true }
bifrost-primitives = { workspace = true }
10 changes: 6 additions & 4 deletions integration-tests/common/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.

// Substrate
use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId;
use grandpa::AuthorityId as GrandpaId;
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use sc_consensus_grandpa::AuthorityId as GrandpaId;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_consensus_babe::AuthorityId as BabeId;
use sp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId;
use sp_core::{sr25519, storage::Storage, Pair, Public};
use sp_runtime::{
traits::{IdentifyAccount, Verify},
Expand Down Expand Up @@ -141,7 +141,9 @@ pub mod collators {

pub fn inflation_config() -> InflationInfo<Balance> {
fn to_round_inflation(annual: Range<Perbill>) -> Range<Perbill> {
use parachain_staking::inflation::{perbill_annual_to_perbill_round, BLOCKS_PER_YEAR};
use bifrost_parachain_staking::inflation::{
perbill_annual_to_perbill_round, BLOCKS_PER_YEAR,
};
perbill_annual_to_perbill_round(
annual,
// rounds per year
Expand Down Expand Up @@ -529,7 +531,7 @@ pub mod bifrost_kusama {
})
.collect(),
},
// parachain_staking: bifrost_kusama_runtime::ParachainStakingConfig {
// bifrost_parachain_staking: bifrost_kusama_runtime::ParachainStakingConfig {
// candidates: collators::candidates(),
// delegations: collators::delegations(),
// inflation_config: collators::inflation_config(),
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/common/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

pub use codec::{Decode, Encode};
pub use parity_scale_codec::{Decode, Encode};
pub use paste;

pub use crate::{
Expand Down
Loading

0 comments on commit b784a34

Please sign in to comment.