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

Prepare release 4.5.0 #1280

Merged
merged 2 commits into from
Nov 27, 2024
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
6 changes: 3 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "framenode"
version = "4.4.0"
version = "4.5.0"
authors = ["Parity Technologies <[email protected]>"]
build = "build.rs"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion node/chain_spec/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "framenode-chain-spec"
version = "4.4.0"
version = "4.5.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"

Expand Down
21 changes: 9 additions & 12 deletions node/chain_spec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,17 @@ use framenode_runtime::multicollateral_bonding_curve_pool::{
DistributionAccount, DistributionAccountData, DistributionAccounts,
};
use framenode_runtime::opaque::SessionKeys;
#[cfg(feature = "stage")] // EVM/TON bridge
use framenode_runtime::BridgeOutboundChannelConfig;
use framenode_runtime::{
assets, eth_bridge, frame_system, AccountId, AssetId, AssetName, AssetSymbol, AssetsConfig,
BabeConfig, BalancesConfig, BeefyConfig, BeefyId, BridgeMultisigConfig, CouncilConfig,
DEXAPIConfig, DEXManagerConfig, DemocracyConfig, EthBridgeConfig, GenesisConfig,
GetBaseAssetId, GetParliamentAccountId, GetPswapAssetId, GetSyntheticBaseAssetId,
GetValAssetId, GetXorAssetId, GrandpaConfig, ImOnlineId, IrohaMigrationConfig, KensetsuConfig,
LiquiditySourceType, MulticollateralBondingCurvePoolConfig, PermissionsConfig,
PswapDistributionConfig, RewardsConfig, Runtime, SS58Prefix, SessionConfig, Signature,
StakerStatus, StakingConfig, SystemConfig, TechAccountId, TechnicalCommitteeConfig,
TechnicalConfig, TokensConfig, TradingPair, TradingPairConfig, XSTPoolConfig, WASM_BINARY,
BabeConfig, BalancesConfig, BeefyConfig, BeefyId, BridgeMultisigConfig,
BridgeOutboundChannelConfig, CouncilConfig, DEXAPIConfig, DEXManagerConfig, DemocracyConfig,
EthBridgeConfig, GenesisConfig, GetBaseAssetId, GetParliamentAccountId, GetPswapAssetId,
GetSyntheticBaseAssetId, GetValAssetId, GetXorAssetId, GrandpaConfig, ImOnlineId,
IrohaMigrationConfig, KensetsuConfig, LiquiditySourceType,
MulticollateralBondingCurvePoolConfig, PermissionsConfig, PswapDistributionConfig,
RewardsConfig, Runtime, SS58Prefix, SessionConfig, Signature, StakerStatus, StakingConfig,
SystemConfig, TechAccountId, TechnicalCommitteeConfig, TechnicalConfig, TokensConfig,
TradingPair, TradingPairConfig, XSTPoolConfig, WASM_BINARY,
};

use hex_literal::hex;
Expand Down Expand Up @@ -2251,7 +2250,6 @@ fn mainnet_genesis(
)
}));
GenesisConfig {
#[cfg(feature = "stage")] // TON bridge
jetton_app: Default::default(),
#[cfg(feature = "wip")] // EVM bridge
evm_fungible_app: Default::default(),
Expand All @@ -2261,7 +2259,6 @@ fn mainnet_genesis(
#[cfg(feature = "wip")] // Trustless substrate bridge
beefy_light_client: Default::default(),

#[cfg(feature = "stage")] // EVM/TON bridge
bridge_outbound_channel: BridgeOutboundChannelConfig {
interval: 10,
},
Expand Down
15 changes: 5 additions & 10 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license = "BSD-4-Clause"
homepage = "https://sora.org"
repository = "https://github.com/sora-xor/sora2-network"
name = "framenode-runtime"
version = "4.4.0"
version = "4.5.0"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down Expand Up @@ -45,8 +45,8 @@ parachain-bridge-app = { git = "https://github.com/sora-xor/sora2-common.git", d
substrate-bridge-app = { git = "https://github.com/sora-xor/sora2-common.git", default-features = false }
substrate-bridge-channel = { git = "https://github.com/sora-xor/sora2-common.git", default-features = false }
evm-fungible-app = { git = "https://github.com/sora-xor/sora2-common.git", default-features = false, optional = true }
bridge-channel = { git = "https://github.com/sora-xor/sora2-common.git", default-features = false, optional = true }
jetton-app = { git = "https://github.com/sora-xor/sora2-common.git", default-features = false, optional = true }
bridge-channel = { git = "https://github.com/sora-xor/sora2-common.git", default-features = false }
jetton-app = { git = "https://github.com/sora-xor/sora2-common.git", default-features = false }

apollo-platform = { path = "../pallets/apollo-platform", default-features = false }
assets = { path = "../pallets/assets", default-features = false }
Expand Down Expand Up @@ -96,7 +96,7 @@ referrals = { path = "../pallets/referrals", default-features = false }
extended-assets = { path = "../pallets/extended-assets", default-features = false }
rewards = { path = "../pallets/rewards", default-features = false }
rewards-runtime-api = { path = "../pallets/rewards/runtime-api", default-features = false }
soratopia = { path = "../pallets/soratopia", default-features = false, optional = true }
soratopia = { path = "../pallets/soratopia", default-features = false }
technical = { path = "../pallets/technical", default-features = false }
trading-pair = { path = "../pallets/trading-pair", default-features = false }
trading-pair-runtime-api = { path = "../pallets/trading-pair/runtime-api", default-features = false }
Expand Down Expand Up @@ -316,12 +316,7 @@ wip = [
"vested-rewards/wip",
]

stage = [
"framenode-chain-spec/stage",
"jetton-app",
"bridge-channel",
"soratopia",
]
stage = ["framenode-chain-spec/stage"]

runtime-benchmarks = [
"apollo-platform/runtime-benchmarks",
Expand Down
41 changes: 14 additions & 27 deletions runtime/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,17 +308,11 @@ impl Dispatchable for DispatchableSubstrateBridgeCall {
post_info: Default::default(),
error: DispatchError::Other("Unavailable"),
}),
#[cfg(feature = "stage")] // TON bridge
bridge_types::substrate::BridgeCall::JettonApp(msg) => {
let call: jetton_app::Call<crate::Runtime> = msg.into();
let call: crate::RuntimeCall = call.into();
call.dispatch(origin)
}
#[cfg(not(feature = "stage"))] // TON bridge
bridge_types::substrate::BridgeCall::JettonApp(_) => Err(DispatchErrorWithPostInfo {
post_info: Default::default(),
error: DispatchError::Other("Unavailable"),
}),
}
}
}
Expand Down Expand Up @@ -354,13 +348,10 @@ impl GetDispatchInfo for DispatchableSubstrateBridgeCall {
}
#[cfg(not(feature = "wip"))] // EVM bridge
bridge_types::substrate::BridgeCall::FAApp(_) => Default::default(),
#[cfg(feature = "stage")] // TON bridge
bridge_types::substrate::BridgeCall::JettonApp(msg) => {
let call: jetton_app::Call<crate::Runtime> = msg.clone().into();
call.get_dispatch_info()
}
#[cfg(not(feature = "stage"))] // TON bridge
bridge_types::substrate::BridgeCall::JettonApp(_) => Default::default(),
}
}
}
Expand Down Expand Up @@ -536,34 +527,30 @@ impl Contains<DispatchableSubstrateBridgeCall> for SubstrateBridgeCallFilter {
bridge_types::substrate::BridgeCall::FAApp(_) => true,
#[cfg(not(feature = "wip"))] // EVM bridge
bridge_types::substrate::BridgeCall::FAApp(_) => false,
#[cfg(feature = "stage")] // TON bridge
bridge_types::substrate::BridgeCall::JettonApp(_) => true,
#[cfg(not(feature = "stage"))] // TON bridge
bridge_types::substrate::BridgeCall::JettonApp(_) => false,
}
}
}

#[cfg(feature = "wip")] // EVM bridge
pub struct EVMBridgeCallFilter;
pub struct GenericBridgeCallFilter;

#[cfg(all(feature = "wip", not(feature = "runtime-benchmarks")))] // EVM bridge
impl Contains<crate::RuntimeCall> for EVMBridgeCallFilter {
fn contains(call: &crate::RuntimeCall) -> bool {
match call {
crate::RuntimeCall::EVMFungibleApp(_) => true,
_ => false,
impl Contains<DispatchableSubstrateBridgeCall> for GenericBridgeCallFilter {
fn contains(call: &DispatchableSubstrateBridgeCall) -> bool {
match &call.0 {
bridge_types::substrate::BridgeCall::ParachainApp(_) => false,
bridge_types::substrate::BridgeCall::XCMApp(_) => false,
bridge_types::substrate::BridgeCall::DataSigner(_) => false,
bridge_types::substrate::BridgeCall::MultisigVerifier(_) => false,
bridge_types::substrate::BridgeCall::SubstrateApp(_) => false,
#[cfg(feature = "wip")] // EVM bridge
bridge_types::substrate::BridgeCall::FAApp(_) => true,
#[cfg(not(feature = "wip"))] // EVM bridge
bridge_types::substrate::BridgeCall::FAApp(_) => false,
bridge_types::substrate::BridgeCall::JettonApp(_) => true,
}
}
}

#[cfg(all(feature = "wip", feature = "runtime-benchmarks"))] // EVM bridge
impl Contains<crate::RuntimeCall> for EVMBridgeCallFilter {
fn contains(_call: &crate::RuntimeCall) -> bool {
true
}
}

#[cfg(test)]
mod test {
use super::*;
Expand Down
32 changes: 5 additions & 27 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ pub use sp_runtime::BuildStorage;
use eth_bridge::offchain::SignatureParams;
use eth_bridge::requests::{AssetKind, OffchainRequest, OutgoingRequestEncoded, RequestStatus};
use impls::{
CollectiveWeightInfo, DemocracyWeightInfo, NegativeImbalanceOf, OnUnbalancedDemocracySlash,
CollectiveWeightInfo, DemocracyWeightInfo, GenericBridgeCallFilter, NegativeImbalanceOf,
OnUnbalancedDemocracySlash,
};

use frame_support::traits::{Everything, ExistenceRequirement, Get, PrivilegeCmp, WithdrawReasons};
Expand Down Expand Up @@ -255,10 +256,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("sora-substrate"),
impl_name: create_runtime_str!("sora-substrate"),
authoring_version: 1,
spec_version: 105,
spec_version: 106,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 105,
transaction_version: 106,
state_version: 0,
};

Expand Down Expand Up @@ -991,7 +992,6 @@ parameter_types! {
pub const CheckInTransferAmount: Balance = balance!(1000);
}

#[cfg(feature = "stage")] // Soratopia
impl soratopia::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type AdminAccount = AdminAccount;
Expand Down Expand Up @@ -2161,7 +2161,6 @@ pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;

// Ethereum bridge pallets

#[cfg(feature = "stage")] // EVM/TON bridge
impl dispatch::Config<dispatch::Instance1> for Runtime {
type RuntimeEvent = RuntimeEvent;
type OriginOutput = bridge_types::types::CallOriginOutput<
Expand All @@ -2173,7 +2172,7 @@ impl dispatch::Config<dispatch::Instance1> for Runtime {
type MessageId = bridge_types::types::MessageId;
type Hashing = Keccak256;
type Call = DispatchableSubstrateBridgeCall;
type CallFilter = SubstrateBridgeCallFilter;
type CallFilter = GenericBridgeCallFilter;
type WeightInfo = dispatch::weights::SubstrateWeight<Runtime>;
}

Expand Down Expand Up @@ -2201,7 +2200,6 @@ parameter_types! {
pub const ThisNetworkId: GenericNetworkId = GenericNetworkId::Sub(bridge_types::SubNetworkId::Mainnet);
}

#[cfg(feature = "stage")] // EVM/TON bridge
impl bridge_channel::inbound::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Verifier = MultiVerifier;
Expand All @@ -2226,7 +2224,6 @@ impl bridge_channel::inbound::Config for Runtime {
type EVMPriorityFee = ();
}

#[cfg(feature = "stage")] // EVM/TON bridge
impl bridge_channel::outbound::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type MaxMessagePayloadSize = BridgeMaxMessagePayloadSize;
Expand Down Expand Up @@ -2281,7 +2278,6 @@ impl evm_fungible_app::Config for Runtime {
type WeightInfo = ();
}

#[cfg(feature = "stage")] // TON bridge
impl jetton_app::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type CallOrigin = dispatch::EnsureAccount<
Expand Down Expand Up @@ -2366,7 +2362,6 @@ pub enum MultiProof {
Beefy(<BeefyLightClient as Verifier>::Proof),
#[codec(index = 1)]
Multisig(<MultisigVerifier as Verifier>::Proof),
#[cfg(feature = "stage")] // EVM/TON bridge
#[codec(index = 2)]
EVMMultisig(<multisig_verifier::MultiEVMVerifier<Runtime> as Verifier>::Proof),
/// This proof is only used for benchmarking purposes
Expand All @@ -2387,7 +2382,6 @@ impl Verifier for MultiVerifier {
#[cfg(feature = "wip")] // Trustless substrate bridge
MultiProof::Beefy(proof) => BeefyLightClient::verify(network_id, message, proof),
MultiProof::Multisig(proof) => MultisigVerifier::verify(network_id, message, proof),
#[cfg(feature = "stage")] // EVM/TON bridge
MultiProof::EVMMultisig(proof) => {
multisig_verifier::MultiEVMVerifier::<Runtime>::verify(network_id, message, proof)
}
Expand All @@ -2401,7 +2395,6 @@ impl Verifier for MultiVerifier {
#[cfg(feature = "wip")] // Trustless substrate bridge
MultiProof::Beefy(proof) => BeefyLightClient::verify_weight(proof),
MultiProof::Multisig(proof) => MultisigVerifier::verify_weight(proof),
#[cfg(feature = "stage")] // EVM/TON bridge
MultiProof::EVMMultisig(proof) => {
multisig_verifier::MultiEVMVerifier::<Runtime>::verify_weight(proof)
}
Expand Down Expand Up @@ -2583,15 +2576,11 @@ construct_runtime! {
BridgeProxy: bridge_proxy::{Pallet, Call, Storage, Event} = 103,

// Trustless EVM bridge
#[cfg(feature = "stage")] // EVM/TON bridge
BridgeInboundChannel: bridge_channel::inbound::{Pallet, Call, Storage, Event<T>, ValidateUnsigned} = 96,
#[cfg(feature = "stage")] // EVM/TON bridge
BridgeOutboundChannel: bridge_channel::outbound::{Pallet, Config<T>, Storage, Event<T>} = 97,
#[cfg(feature = "stage")] // EVM/TON bridge
Dispatch: dispatch::<Instance1>::{Pallet, Storage, Event<T>, Origin<T>} = 98,
#[cfg(feature = "wip")] // EVM bridge
EVMFungibleApp: evm_fungible_app::{Pallet, Call, Storage, Event<T>, Config<T>} = 100,
#[cfg(feature = "stage")] // TON bridge
JettonApp: jetton_app::{Pallet, Call, Storage, Event<T>, Config<T>} = 101,

// Trustless substrate bridge
Expand Down Expand Up @@ -2630,7 +2619,6 @@ construct_runtime! {
ApolloPlatform: apollo_platform::{Pallet, Call, Storage, Event<T>, ValidateUnsigned} = 114,
ExtendedAssets: extended_assets::{Pallet, Call, Storage, Event<T>} = 115,

#[cfg(feature = "stage")]
Soratopia: soratopia::{Pallet, Call, Storage, Event<T>} = 116,
}
}
Expand Down Expand Up @@ -3370,19 +3358,15 @@ impl_runtime_apis! {
list_benchmark!(list, extra, order_book, OrderBookBench::<Runtime>);

// Trustless bridge
#[cfg(feature = "stage")] // EVM/TON bridge
list_benchmark!(list, extra, bridge_inbound_channel, BridgeInboundChannel);
#[cfg(feature = "stage")] // EVM/TON bridge
list_benchmark!(list, extra, bridge_outbound_channel, BridgeOutboundChannel);
#[cfg(feature = "wip")] // EVM bridge
list_benchmark!(list, extra, evm_fungible_app, EVMFungibleApp);
#[cfg(feature = "stage")] // TON bridge
list_benchmark!(list, extra, jetton_app, JettonApp);

list_benchmark!(list, extra, evm_bridge_proxy, BridgeProxy);
// Dispatch pallet benchmarks is strictly linked to EVM bridge params
// TODO: fix
#[cfg(feature = "stage")] // EVM/TON bridge
list_benchmark!(list, extra, dispatch, Dispatch);
list_benchmark!(list, extra, substrate_bridge_channel::inbound, SubstrateBridgeInboundChannel);
list_benchmark!(list, extra, substrate_bridge_channel::outbound, SubstrateBridgeOutboundChannel);
Expand All @@ -3392,7 +3376,6 @@ impl_runtime_apis! {
list_benchmark!(list, extra, multisig_verifier, MultisigVerifier);
list_benchmark!(list, extra, extended_assets, ExtendedAssets);

#[cfg(feature = "stage")] // Soratopia
list_benchmark!(list, extra, soratopia, Soratopia);

let storage_info = AllPalletsWithSystem::storage_info();
Expand Down Expand Up @@ -3471,19 +3454,15 @@ impl_runtime_apis! {
add_benchmark!(params, batches, order_book, OrderBookBench::<Runtime>);

// Trustless bridge
#[cfg(feature = "stage")] // EVM/TON bridge
add_benchmark!(params, batches, bridge_inbound_channel, BridgeInboundChannel);
#[cfg(feature = "stage")] // EVM/TON bridge
add_benchmark!(params, batches, bridge_outbound_channel, BridgeOutboundChannel);
#[cfg(feature = "wip")] // EVM bridge
add_benchmark!(params, batches, evm_fungible_app, EVMFungibleApp);
#[cfg(feature = "stage")] // TON bridge
add_benchmark!(params, batches, jetton_app, JettonApp);

add_benchmark!(params, batches, evm_bridge_proxy, BridgeProxy);
// Dispatch pallet benchmarks is strictly linked to EVM bridge params
// TODO: fix
#[cfg(feature = "stage")] // EVM/TON bridge
add_benchmark!(params, batches, dispatch, Dispatch);
add_benchmark!(params, batches, substrate_bridge_channel::inbound, SubstrateBridgeInboundChannel);
add_benchmark!(params, batches, substrate_bridge_channel::outbound, SubstrateBridgeOutboundChannel);
Expand All @@ -3493,7 +3472,6 @@ impl_runtime_apis! {
add_benchmark!(params, batches, multisig_verifier, MultisigVerifier);
add_benchmark!(params, batches, extended_assets, ExtendedAssets);

#[cfg(feature = "stage")] // Soratopia
add_benchmark!(params, batches, soratopia, Soratopia);

if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
Expand Down
1 change: 0 additions & 1 deletion runtime/src/xor_fee_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ impl CustomFees {
Some(SMALL_FEE)
}
RuntimeCall::Band(..) => Some(MINIMAL_FEE),
#[cfg(feature = "stage")]
RuntimeCall::Soratopia(soratopia::Call::check_in {}) => Some(MINIMAL_FEE),
_ => None,
}
Expand Down