Skip to content
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
176 changes: 104 additions & 72 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chainx"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"
description = "Fully Decentralized Interchain Crypto Asset Management on Polkadot"
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chainx-cli"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
description = "Implementation of protocol https://chainx.org in Rust based on the Substrate framework."
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion client/rpc/finality/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bevm-finality-rpc"
description = "An experimental RPC to check for block and transaction finality in the bevm chain"
version = "5.2.2"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion executor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chainx-executor"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chainx-primitives"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion primitives/assets-registrar/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xp-assets-registrar"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion primitives/gateway/bitcoin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xp-gateway-bitcoin"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion primitives/gateway/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xp-gateway-common"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion primitives/genesis-builder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xp-genesis-builder"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion primitives/io/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xp-io"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion primitives/mining/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xp-mining-common"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion primitives/mining/staking/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xp-mining-staking"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion primitives/protocol/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xp-protocol"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion primitives/rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xp-rpc"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion primitives/runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xp-runtime"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chainx-rpc"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down
7 changes: 6 additions & 1 deletion runtime/chainx/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chainx-runtime"
version = "5.2.3"
version = "5.2.4"
authors = ["The ChainX Authors"]
edition = "2021"

Expand Down Expand Up @@ -102,6 +102,8 @@ xpallet-btc-ledger-runtime-api = { path = "../../xpallets/btc-ledger/rpc/runtime
pallet-evm = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18-btc-fix2", default-features = false, features = ["chainx-adaptor"] }
pallet-ethereum = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18-btc-fix2", default-features = false }
pallet-base-fee = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18-btc-fix2", default-features = false }
pallet-evm-rent = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18-btc-fix2", default-features = false }

xpallet-ethereum-chain-id = { path = "../../xpallets/ethereum-chain-id", default-features = false }
xpallet-assets-bridge = { path = "../../xpallets/assets-bridge", default-features = false }

Expand All @@ -116,6 +118,7 @@ pallet-evm-precompile-blake2 = { git = "https://github.com/chainx-org/frontier",
# ETH API
fp-rpc = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18-btc-fix2", default-features = false }
fp-self-contained = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18-btc-fix2", default-features = false }
fp-rent = { git = "https://github.com/chainx-org/frontier", branch = "polkadot-v0.9.18-btc-fix2", default-features = false }

[build-dependencies]
substrate-wasm-builder = { git = "https://github.com/chainx-org/substrate", branch = "polkadot-v0.9.18-fix2" }
Expand Down Expand Up @@ -206,11 +209,13 @@ std = [
"pallet-evm/std",
"pallet-ethereum/std",
"pallet-base-fee/std",
"pallet-evm-rent/std",
"xpallet-ethereum-chain-id/std",
"xpallet-assets-bridge/std",
"fp-evm/std",
"fp-rpc/std",
"fp-self-contained/std",
"fp-rent/std",
]
runtime-benchmarks = [
"hex-literal",
Expand Down
29 changes: 10 additions & 19 deletions runtime/chainx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("chainx"),
impl_name: create_runtime_str!("chainx-net"),
authoring_version: 1,
spec_version: 35,
spec_version: 36,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 8,
Expand Down Expand Up @@ -688,7 +688,7 @@ parameter_types! {
pub const VotingBond: Balance = DOLLARS;
pub const TermDuration: BlockNumber = DAYS;
pub const DesiredMembers: u32 = 6;
pub const DesiredRunnersUp: u32 = 0;
pub const DesiredRunnersUp: u32 = 3;
pub const ElectionsPhragmenPalletId: LockIdentifier = *b"pcx/phre";
}

Expand Down Expand Up @@ -1159,6 +1159,7 @@ impl pallet_evm::Config for Runtime {
type OnChargeTransaction = pallet_evm::EVMCurrencyAdapter<XBtcLedger, DealWithBTCFees>;
type BlockGasLimit = BlockGasLimit;
type FindAuthor = ();
type EvmRentCalculator = EvmRent;
type WeightInfo = pallet_evm::weights::SubstrateWeight<Self>;
}

Expand Down Expand Up @@ -1203,6 +1204,12 @@ impl xpallet_assets_bridge::Config for Runtime {
type ClaimBond = ClaimBond;
}

impl pallet_evm_rent::Config for Runtime {
type Event = Event;
type CouncilOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 2, 3>;
}

construct_runtime!(
pub enum Runtime where
Block = Block,
Expand Down Expand Up @@ -1281,6 +1288,7 @@ construct_runtime!(
XAssetsBridge: xpallet_assets_bridge::{Pallet, Call, Storage, Config<T>, Event<T>} = 45,

XBtcLedger: xpallet_btc_ledger::{Pallet, Call, Storage, Config<T>, Event<T>} = 46,
EvmRent: pallet_evm_rent::{Pallet, Call, Storage, Event<T>} = 47,
}
);

Expand Down Expand Up @@ -1322,25 +1330,8 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
AssetsBridgeMigration,
>;

pub struct AssetsBridgeMigration;
impl OnRuntimeUpgrade for AssetsBridgeMigration {
fn on_runtime_upgrade() -> Weight {
use frame_support::storage::migration;

frame_support::log::info!("🔍️ AssetsBridgeMigration start");

// Remove the storage value `HotAccount` from pallet `XAssetsBridge`
migration::remove_storage_prefix(b"XAssetsBridge", b"HotAccount", b"");

frame_support::log::info!("🚀 AssetsBridgeMigration end");

<Runtime as frame_system::Config>::DbWeight::get().writes(1)
}
}

pub struct TransactionConverter;
impl fp_rpc::ConvertTransaction<UncheckedExtrinsic> for TransactionConverter {
fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic {
Expand Down
3 changes: 2 additions & 1 deletion runtime/chainx/src/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ impl<R> PrecompileSet for ChainXPrecompiles<R>
where
R: xpallet_assets_bridge::Config
+ xpallet_gateway_common::Config
+ xpallet_gateway_records::Config,
+ xpallet_gateway_records::Config
+ pallet_evm_rent::Config,
Dispatch<R>: Precompile,
{
fn execute(
Expand Down
Loading
Loading