Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Add evochain light client #108

Merged
37 commits merged into from
Aug 29, 2023
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
78752e5
Only client side compile errors
dastanbeksamatov Aug 3, 2023
1a5189c
Upgrade to v1.0.0
dastanbeksamatov Aug 4, 2023
d16b040
Add grandpa bridge to runtime
dastanbeksamatov Aug 4, 2023
e43fdac
Fix clippy and tests
dastanbeksamatov Aug 4, 2023
3414679
Merge branch 'dev' of github-freeverse:freeverseio/laos-ownership-nod…
dastanbeksamatov Aug 4, 2023
ef4e8ae
Merge branch 'dev' into feat/grandpa-bridge
Aug 4, 2023
00262c9
Fix lints
dastanbeksamatov Aug 4, 2023
ade7089
Merge branch 'feat/grandpa-bridge' of github-freeverse:freeverseio/la…
dastanbeksamatov Aug 4, 2023
e02fff8
Fix tests and clippy
dastanbeksamatov Aug 4, 2023
b0bb716
Remove comment
dastanbeksamatov Aug 4, 2023
cc97592
Add ownership chain relayer part
dastanbeksamatov Aug 4, 2023
72b663d
Merge branch 'dev' of github-freeverse:freeverseio/laos-ownership-nod…
dastanbeksamatov Aug 4, 2023
c73309b
Fix tests
dastanbeksamatov Aug 4, 2023
c154b1e
Remove 0x from hex
dastanbeksamatov Aug 4, 2023
1852460
Add bridge relayer
dastanbeksamatov Aug 15, 2023
436593c
Update branch commits
dastanbeksamatov Aug 17, 2023
b69e233
Working state
dastanbeksamatov Aug 22, 2023
8201b0a
Add laos relay
dastanbeksamatov Aug 22, 2023
147051e
Remove unused deps
dastanbeksamatov Aug 22, 2023
9b9b661
Fix lints and prepare for PR
dastanbeksamatov Aug 22, 2023
9926e23
Fix clippy
dastanbeksamatov Aug 22, 2023
1da04d9
Merge branch 'dev' of github-freeverse:freeverseio/laos-ownership-nod…
dastanbeksamatov Aug 22, 2023
68dd5a1
Generate new lock file
dastanbeksamatov Aug 22, 2023
184d0f4
Evochain different branch
dastanbeksamatov Aug 24, 2023
dead57c
Add documentation
dastanbeksamatov Aug 24, 2023
0775b4b
Remove millau related code
dastanbeksamatov Aug 24, 2023
c28b64a
Improve documentation
dastanbeksamatov Aug 24, 2023
a88adf6
Fix lint
dastanbeksamatov Aug 24, 2023
7bad16d
Remove bridge relayer
dastanbeksamatov Aug 25, 2023
e911754
Merge branch 'dev' of github-freeverse:freeverseio/laos-ownership-nod…
dastanbeksamatov Aug 25, 2023
f22143b
Use workspace deps
dastanbeksamatov Aug 25, 2023
0522701
Change crate authors
dastanbeksamatov Aug 25, 2023
4bb12b3
Revert gitignore
dastanbeksamatov Aug 28, 2023
5f60293
Update parity bridges common branch
dastanbeksamatov Aug 29, 2023
3b11c46
Update crate name
dastanbeksamatov Aug 29, 2023
56a4bd8
removed wrong comment
asiniscalchi Aug 29, 2023
147485e
fmt
asiniscalchi Aug 29, 2023
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
1,021 changes: 509 additions & 512 deletions Cargo.lock

Large diffs are not rendered by default.

23 changes: 11 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -6,10 +6,10 @@ members = [
"node",
"runtime",
"precompile/*",
"pallets/*"
"pallets/*",
"primitives",
]


[workspace.dependencies]
parity-scale-codec = { version = "3.2.2", default-features = false, features = ["derive"] }
hex-literal = "0.4.1"
@@ -29,6 +29,7 @@ similar-asserts = { version = "1.1.0" }
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "1.0" }
static_assertions = "1.1"

# Wasm builder
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
@@ -208,16 +209,11 @@ polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "relea
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v1.0.0" }

# Bridge dependencies
bp-header-chain = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "polkadot-v1.0.0", default-features = false }
bp-messages = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "polkadot-v1.0.0", default-features = false }
bp-evochain = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "polkadot-v1.0.0", default-features = false }
bp-relayers = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "polkadot-v1.0.0", default-features = false }
bp-runtime = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "polkadot-v1.0.0", default-features = false }
bp-ownership-parachain = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "polkadot-v1.0.0", default-features = false }
bridge-runtime-common = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "polkadot-v1.0.0", default-features = false }
pallet-bridge-grandpa = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "polkadot-v1.0.0", default-features = false }
pallet-bridge-messages = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "polkadot-v1.0.0", default-features = false }
pallet-bridge-relayers = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "polkadot-v1.0.0", default-features = false }
bp-laos-evolution = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "laos-crates", default-features = false }
bp-header-chain = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "laos-crates", default-features = false }
bp-runtime = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "laos-crates", default-features = false }
bridge-runtime-common = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "laos-crates", default-features = false }
pallet-bridge-grandpa = { git = "https://github.com/freeverseio/parity-bridges-common.git", branch = "laos-crates", default-features = false }

# LAOS pallets
pallet-living-assets-ownership = { path = "./pallets/living-assets-ownership", default-features = false }
@@ -228,5 +224,8 @@ pallet-evm-erc721 = { path = "./precompile/erc721", default-features = false }
precompile-utils = { path = "./precompile/utils", default-features = false }
precompile-utils-macro = { path = "./precompile/utils/macro", default-features = false }

# Primitives
ownership-parachain-primitives = { path = "./primitives", default-features = false }

# runtime
laos-runtime = { path = "./runtime" }
7 changes: 2 additions & 5 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
@@ -270,7 +270,7 @@ fn testnet_genesis(
.iter()
.map(|&address| {
(
address.into(),
address,
GenesisAccount {
nonce: Default::default(),
balance: Default::default(),
@@ -337,9 +337,6 @@ fn testnet_genesis(
},
..Default::default()
},
ethereum: Default::default(),
// dynamic_fee: Default::default(),
base_fee: Default::default(),
bridge_evochain_grandpa: Default::default(),
..Default::default()
}
}
2 changes: 1 addition & 1 deletion pallets/living-assets-ownership/src/lib.rs
Original file line number Diff line number Diff line change
@@ -182,7 +182,7 @@ pub mod pallet {
// concatenate base_uri with asset_id
let mut token_uri = base_uri.to_vec();
token_uri.push(b'/');
token_uri.extend_from_slice(&asset_id.to_string().as_bytes());
token_uri.extend_from_slice(asset_id.to_string().as_bytes());
Ok(token_uri)
}
}
23 changes: 23 additions & 0 deletions primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "ownership-parachain-primitives"
description = "Primitives of Ownership parachain runtime."
version = "0.1.0"
authors = ["Freeverse"]
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
# Substrate Based Dependencies
frame-support = { workspace = true }
frame-system = { workspace = true }
sp-core = { workspace = true }
sp-runtime = { workspace = true }

[features]
default = ["std"]
std = [
"frame-support/std",
"frame-system/std",
"sp-core/std",
"sp-runtime/std",
]
66 changes: 66 additions & 0 deletions primitives/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
//! Primitives of the Ownership parachain.

#![warn(missing_docs)]
#![cfg_attr(not(feature = "std"), no_std)]

use frame_support::weights::{constants::WEIGHT_REF_TIME_PER_SECOND, IdentityFee, Weight};
use frame_system::limits;
use sp_core::Hasher as HasherT;
use sp_runtime::{
traits::{BlakeTwo256, IdentifyAccount, Verify},
MultiSignature, MultiSigner, Perbill,
};

/// Maximal weight of single OwnershipParachain block.
///
/// This represents two seconds of compute assuming a target block time of six seconds.
///
/// Max PoV size is set to `5Mb` as all Cumulus-based parachains do.
pub const MAXIMUM_BLOCK_WEIGHT: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), 5 * 1024 * 1024);

/// Represents the portion of a block that will be used by Normal extrinsics.
pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);

/// Block number type used in Ownership chain.
pub type BlockNumber = u32;

/// Hash type used in Ownership chain.
pub type Hash = <BlakeTwo256 as HasherT>::Out;

/// The type of object that can produce hashes on Ownership chain.
pub type Hasher = BlakeTwo256;

/// The header type used by Ownership chain.
pub type Header = sp_runtime::generic::Header<BlockNumber, Hasher>;

/// Alias to 512-bit hash when used in the context of a transaction signature on the chain.
pub type Signature = MultiSignature;

/// Some way of identifying an account on the chain. We intentionally make it equivalent
/// to the public key of our transaction signing scheme.
pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;

/// Public key of the chain account that may be used to verify signatures.
pub type AccountSigner = MultiSigner;

/// Balance of an account.
pub type Balance = u128;

/// An instant or duration in time.
pub type Moment = u64;

/// Nonce of a transaction in the parachain.
pub type Nonce = u32;

/// Weight-to-Fee type used by Ownership parachain.
pub type WeightToFee = IdentityFee<Balance>;

frame_support::parameter_types! {
/// Size limit of the Ownership parachain blocks.
pub BlockLength: limits::BlockLength =
limits::BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
/// Weight limit of the Ownership parachain blocks.
pub BlockWeights: limits::BlockWeights =
limits::BlockWeights::with_sensible_defaults(MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO);
}
26 changes: 10 additions & 16 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -20,6 +20,9 @@ hex-literal = { workspace = true, optional = true }
scale-info = { workspace = true, features = ["derive"] }
smallvec = { workspace = true }

# Runtime primitives
ownership-parachain-primitives = { workspace = true }

# Substrate
frame-benchmarking = { workspace = true, optional = true }
frame-executive = { workspace = true }
@@ -89,15 +92,15 @@ pallet-evm-precompile-simple = { workspace = true }

# Bridge dependencies
bp-header-chain = { workspace = true }
bp-messages = { workspace = true }
bp-evochain = { workspace = true }
bp-relayers = { workspace = true }
bp-laos-evolution = { workspace = true }
bp-runtime = { workspace = true }
bp-ownership-parachain = { workspace = true }
bridge-runtime-common = { workspace = true }
pallet-bridge-grandpa = { workspace = true }
pallet-bridge-messages = { workspace = true }
pallet-bridge-relayers = { workspace = true }

[dev-dependencies]
bridge-runtime-common = { workspace = true, features = ["integrity-test"] }
static_assertions = { workspace = true }
hex-literal = { workspace = true }

[features]
default = [
@@ -166,16 +169,11 @@ std = [
"frame-try-runtime",
"pallet-evm-living-assets-ownership/std",
# Bridge deps,
"bp-evochain/std",
"bp-laos-evolution/std",
"bp-header-chain/std",
"bp-messages/std",
"bp-ownership-parachain/std",
"bp-relayers/std",
"bp-runtime/std",
"bridge-runtime-common/std",
"pallet-bridge-grandpa/std",
"pallet-bridge-messages/std",
"pallet-bridge-relayers/std",
]

runtime-benchmarks = [
@@ -203,8 +201,6 @@ runtime-benchmarks = [
"xcm-executor/runtime-benchmarks",
"bridge-runtime-common/runtime-benchmarks",
"pallet-bridge-grandpa/runtime-benchmarks",
"pallet-bridge-messages/runtime-benchmarks",
"pallet-bridge-relayers/runtime-benchmarks",
]

try-runtime = [
@@ -236,6 +232,4 @@ try-runtime = [
"polkadot-runtime-common/try-runtime",
"sp-runtime/try-runtime",
"pallet-bridge-grandpa/try-runtime",
"pallet-bridge-messages/try-runtime",
"pallet-bridge-relayers/try-runtime",
]
Loading