Skip to content

Commit

Permalink
Merge branch 'development' into amar-remove-buggy-pool-members
Browse files Browse the repository at this point in the history
  • Loading branch information
4meta5 authored Feb 12, 2025
2 parents cba322c + e77e6d3 commit 1202ea3
Show file tree
Hide file tree
Showing 19 changed files with 1,589 additions and 39 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/merge-docker-timenode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
- image: prod
profile: mainnet
features: default
- image: bridge
profile: mainnet
features: bridge
- image: test
profile: testnet
features: default
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-test-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ concurrency:
jobs:
test-basic:
runs-on: [self-hosted, integration]
timeout-minutes: 90
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down Expand Up @@ -57,7 +58,7 @@ jobs:
- name: Cleanup
if: ${{ always() }}
run: |
docker compose --profile "*" down
docker compose --profile "*" down --remove-orphans
- name: Cleanup working dir
if: ${{ always() }}
uses: eviden-actions/clean-self-hosted-runner@v1
10 changes: 5 additions & 5 deletions config/envs/development/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ networks:
chronicle_target_funds: .1
batch_size: 64
batch_offset: 0
batch_gas_limit: 10000
batch_gas_limit: 350000
gmp_margin: 0.0
shard_task_limit: 50
shard_task_limit: 100
route_gas_limit: 10000000
route_base_fee: 1400000000
shard_size: 1
Expand All @@ -103,7 +103,7 @@ networks:
chronicle_target_funds: .1
batch_size: 256
batch_offset: 0
batch_gas_limit: 10000
batch_gas_limit: 350000
gmp_margin: 0.0
shard_task_limit: 50
route_gas_limit: 10000000
Expand All @@ -120,9 +120,9 @@ networks:
chronicle_target_funds: .1
batch_size: 256
batch_offset: 0
batch_gas_limit: 10000
batch_gas_limit: 350000
gmp_margin: 0.0
shard_task_limit: 50
shard_task_limit: 100
route_gas_limit: 10000000
route_base_fee: 1400000000
shard_size: 1
Expand Down
10 changes: 6 additions & 4 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ timechain-runtime = { workspace = true, features = ["genesis-builder"] }
#try-runtime-core = { git = "https://github.com/paritytech/try-runtime-cli", tag = "v0.7.0", optional = true }

# HASHI Bridge
eth-bridge.workspace = true
eth-bridge = { workspace = true, optional = true }

[build-dependencies]
clap.workspace = true
Expand All @@ -130,10 +130,12 @@ polkadot-sdk = { workspace = true, features = [
[features]
default = [ "std" ]
std = [
"scale-codec/std",
"polkadot-sdk/std",
"eth-bridge/std"
"scale-codec/std",
"polkadot-sdk/std",
"eth-bridge?/std"
]
# Enable bridge code
bridge = [ "eth-bridge" ]
# Runtime variants
testnet = [
"time-primitives/testnet",
Expand Down
20 changes: 9 additions & 11 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,22 @@ use std::{path::Path, sync::Arc};

use polkadot_sdk::*;

#[cfg(feature = "testnet")]
#[cfg(feature = "bridge")]
use eth_bridge::{
common, PeerConfig, STORAGE_ETH_NODE_PARAMS, STORAGE_NETWORK_IDS_KEY, STORAGE_PEER_SECRET_KEY,
STORAGE_SUB_NODE_URL_KEY,
};
#[cfg(feature = "testnet")]
#[cfg(feature = "bridge")]
use scale_codec::Encode;
#[cfg(feature = "testnet")]
#[cfg(feature = "bridge")]
use sp_core::{offchain::OffchainStorage, ByteArray, Pair};
#[cfg(feature = "testnet")]
use sp_runtime::offchain::STORAGE_PREFIX;
#[cfg(feature = "testnet")]
use sp_runtime::traits::IdentifyAccount;
#[cfg(feature = "testnet")]
#[cfg(feature = "bridge")]
use sp_runtime::{offchain::STORAGE_PREFIX, traits::IdentifyAccount};
#[cfg(feature = "bridge")]
use sp_std::collections::btree_set::BTreeSet;
#[cfg(feature = "testnet")]
#[cfg(feature = "bridge")]
use std::fs::File;
#[cfg(feature = "testnet")]
#[cfg(feature = "bridge")]
use timechain_runtime::Runtime;

use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
Expand Down Expand Up @@ -136,7 +134,7 @@ where
)?;
let client = Arc::new(client);

#[cfg(feature = "testnet")]
#[cfg(feature = "bridge")]
{
// HASHI Bridge support
let mut bridge_peer_secret_key = None;
Expand Down
3 changes: 2 additions & 1 deletion pallets/bridge-multisig/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ type BalanceOf<T> =
pub type OpaqueCall = Vec<u8>;

pub use pallet::*;
pub use weights::WeightInfo;

const WEIGHT_PER_MICROS: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_MICROS, 0);
const WEIGHT_PER_NANOS: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS, 0);

#[frame_support::pallet]
pub mod pallet {
use super::*;
use crate::weights::{pays_no_with_maybe_weight, WeightInfo};
use crate::weights::pays_no_with_maybe_weight;
use frame_support::{dispatch::DispatchResultWithPostInfo, pallet_prelude::*};
use frame_system::pallet_prelude::*;
use sp_std::fmt::Debug;
Expand Down
6 changes: 0 additions & 6 deletions runtime/src/apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ use crate::RuntimeGenesisConfig;
use crate::{Members, Networks, Shards, Staking, Tasks};

// HASHI Bridge
#[cfg(feature = "testnet")]
use crate::configs::bridge::NetworkId as BridgeNetworkId;
#[cfg(feature = "testnet")]
use crate::EthBridge;
#[cfg(feature = "testnet")]
use eth_bridge::{
common::{AssetId as BridgeAssetId, BalancePrecision as BridgeBalancePrecision},
offchain::SignatureParams as BridgeSignatureParams,
Expand All @@ -57,7 +54,6 @@ use eth_bridge::{
RequestStatus as BridgeRequestStatus,
},
};
#[cfg(feature = "testnet")]
use sp_runtime::DispatchError;

// Original Author: ntn-x2 @ KILTprotocol
Expand Down Expand Up @@ -377,8 +373,6 @@ impl_runtime_apis! {
}
}


#[cfg(feature = "testnet")]
impl
eth_bridge_runtime_api::EthBridgeRuntimeApi<
Block,
Expand Down
6 changes: 3 additions & 3 deletions runtime/src/configs/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use polkadot_sdk::*;
use frame_support::parameter_types;

// Local module imports
use crate::{deposit, Balance, Balances, Runtime, RuntimeCall, RuntimeEvent};
use crate::{deposit, weights, Balance, Balances, Runtime, RuntimeCall, RuntimeEvent};

pub type NetworkId = u32;

Expand All @@ -26,7 +26,7 @@ impl eth_bridge::Config for Runtime {
type Currency = Balances;
type NetworkId = NetworkId;
type PeerId = eth_bridge::offchain::crypto::TestAuthId;
type WeightInfo = eth_bridge::weights::SubstrateWeight<Runtime>;
type WeightInfo = weights::eth_bridge::WeightInfo<Runtime>;
type AdminOrigin = ChronicleAdmin;
}

Expand All @@ -46,5 +46,5 @@ impl bridge_multisig::Config for Runtime {
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
type MaxSignatories = MaxSignatories;
type WeightInfo = bridge_multisig::weights::SubstrateWeight<Runtime>;
type WeightInfo = weights::bridge_multisig::WeightInfo<Runtime>;
}
1 change: 0 additions & 1 deletion runtime/src/configs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub mod staking;
pub mod tokenomics;
pub mod utilities;

#[cfg(feature = "testnet")]
pub mod bridge;
#[cfg(feature = "testnet")]
pub mod custom;
14 changes: 7 additions & 7 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("analog-timechain"),
impl_name: create_runtime_str!("analog-timechain"),
authoring_version: 0,
spec_version: 16,
spec_version: 17,
impl_version: 0,
apis: apis::RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand All @@ -252,7 +252,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("analog-testnet"),
impl_name: create_runtime_str!("analog-testnet"),
authoring_version: 0,
spec_version: 16,
spec_version: 17,
impl_version: 0,
apis: apis::RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand All @@ -266,7 +266,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("analog-develop"),
impl_name: create_runtime_str!("analog-develop"),
authoring_version: 0,
spec_version: 16,
spec_version: 17,
impl_version: 0,
apis: apis::RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down Expand Up @@ -489,11 +489,11 @@ mod runtime {

// HASHI Bridge

//#[runtime::pallet_index(50)]
//pub type EthBridge = eth_bridge;
#[runtime::pallet_index(50)]
pub type EthBridge = eth_bridge;

//#[runtime::pallet_index(51)]
//pub type BridgeMultisig = bridge_multisig;
#[runtime::pallet_index(51)]
pub type BridgeMultisig = bridge_multisig;
}

/// Testnet and develop runtime assembly
Expand Down
112 changes: 112 additions & 0 deletions runtime/src/weights/develop/bridge_multisig.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@

//! Autogenerated weights for `bridge_multisig`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.1
//! DATE: 2025-02-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `ns1026992`, CPU: `AMD EPYC 4244P 6-Core Processor`
//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024
// Executed Command:
// ./target/mainnet/timechain-node
// benchmark
// pallet
// --pallet
// bridge_multisig
// --extrinsic
// *
// --steps
// 50
// --repeat
// 20
// --output
// ./runtime/src/weights/mainnet/bridge_multisig.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]

use polkadot_sdk::*;

use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;

/// Weight functions for `bridge_multisig`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> bridge_multisig::WeightInfo for WeightInfo<T> {
/// Storage: `BridgeMultisig::Accounts` (r:1 w:0)
/// Proof: `BridgeMultisig::Accounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `BridgeMultisig::Multisigs` (r:1 w:1)
/// Proof: `BridgeMultisig::Multisigs` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `BridgeMultisig::DispatchedCalls` (r:1 w:0)
/// Proof: `BridgeMultisig::DispatchedCalls` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// The range of component `s` is `[2, 100]`.
/// The range of component `z` is `[0, 10000]`.
fn as_multi_create(s: u32, z: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `73 + s * (32 ±0)`
// Estimated: `3538 + s * (32 ±0)`
// Minimum execution time: 12_544_000 picoseconds.
Weight::from_parts(11_075_431, 0)
.saturating_add(Weight::from_parts(0, 3538))
// Standard Error: 247
.saturating_add(Weight::from_parts(19_327, 0).saturating_mul(s.into()))
// Standard Error: 2
.saturating_add(Weight::from_parts(770, 0).saturating_mul(z.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(1))
.saturating_add(Weight::from_parts(0, 32).saturating_mul(s.into()))
}
/// Storage: `BridgeMultisig::Accounts` (r:1 w:0)
/// Proof: `BridgeMultisig::Accounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `BridgeMultisig::Multisigs` (r:1 w:1)
/// Proof: `BridgeMultisig::Multisigs` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `BridgeMultisig::DispatchedCalls` (r:1 w:0)
/// Proof: `BridgeMultisig::DispatchedCalls` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// The range of component `s` is `[3, 100]`.
/// The range of component `z` is `[0, 10000]`.
fn as_multi_approve(s: u32, z: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `310 + s * (32 ±0)`
// Estimated: `3775 + s * (32 ±0)`
// Minimum execution time: 13_786_000 picoseconds.
Weight::from_parts(12_355_486, 0)
.saturating_add(Weight::from_parts(0, 3775))
// Standard Error: 255
.saturating_add(Weight::from_parts(18_497, 0).saturating_mul(s.into()))
// Standard Error: 2
.saturating_add(Weight::from_parts(803, 0).saturating_mul(z.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(1))
.saturating_add(Weight::from_parts(0, 32).saturating_mul(s.into()))
}
/// Storage: `BridgeMultisig::Accounts` (r:1 w:0)
/// Proof: `BridgeMultisig::Accounts` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `BridgeMultisig::Multisigs` (r:1 w:1)
/// Proof: `BridgeMultisig::Multisigs` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `BridgeMultisig::DispatchedCalls` (r:1 w:1)
/// Proof: `BridgeMultisig::DispatchedCalls` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `BridgeMultisig::Calls` (r:1 w:1)
/// Proof: `BridgeMultisig::Calls` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// The range of component `s` is `[2, 100]`.
/// The range of component `z` is `[0, 10000]`.
fn as_multi_complete(s: u32, z: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `385 + s * (53 ±0) + z * (1 ±0)`
// Estimated: `3845 + s * (53 ±0) + z * (1 ±0)`
// Minimum execution time: 20_899_000 picoseconds.
Weight::from_parts(18_111_497, 0)
.saturating_add(Weight::from_parts(0, 3845))
// Standard Error: 360
.saturating_add(Weight::from_parts(35_275, 0).saturating_mul(s.into()))
// Standard Error: 3
.saturating_add(Weight::from_parts(1_255, 0).saturating_mul(z.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(Weight::from_parts(0, 53).saturating_mul(s.into()))
.saturating_add(Weight::from_parts(0, 1).saturating_mul(z.into()))
}
}
Loading

0 comments on commit 1202ea3

Please sign in to comment.