Skip to content

Commit

Permalink
Polkadot v0.9.40 (#318)
Browse files Browse the repository at this point in the history
* runtime and node changes

* node changes

* runtime issues solved

* node and contracts addition

* alphanet old migration removed

* node changes

* version change

* version changes

* git modules to default
  • Loading branch information
Immanuel-john authored Jan 30, 2024
1 parent d5df9fe commit a1a825c
Show file tree
Hide file tree
Showing 105 changed files with 9,950 additions and 6,205 deletions.
Binary file modified .DS_Store
Binary file not shown.
3,828 changes: 2,564 additions & 1,264 deletions Cargo.lock

Large diffs are not rendered by default.

234 changes: 114 additions & 120 deletions Cargo.toml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions node/client/Cargo.toml → client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sp-storage = { workspace = true }
sp-transaction-pool = { workspace = true }
sp-consensus-babe = { workspace = true }
sp-authority-discovery = { workspace = true }
sp-finality-grandpa = { workspace = true }
sp-consensus-grandpa = { workspace = true }
sp-core = { workspace = true }
sp-keyring = { workspace = true }
sp-inherents = { workspace = true }
Expand All @@ -45,12 +45,12 @@ frame-benchmarking = { workspace = true }
frame-benchmarking-cli = { workspace = true }

# Ternoa
ternoa-core-primitives = { path = "../../core-primitives" }
ternoa-runtime-common = { path = "../../runtime/common" }
ternoa-core-primitives = { path = "../core-primitives" }
ternoa-runtime-common = { path = "../runtime/common" }

# Ternoa runtimes
alphanet-runtime = { path = "../../runtime/alphanet", optional = true }
mainnet-runtime = { path = "../../runtime/mainnet", optional = true }
alphanet-runtime = { path = "../runtime/alphanet", optional = true }
mainnet-runtime = { path = "../runtime/mainnet", optional = true }

[features]
default = ["mainnet"]
Expand Down
File renamed without changes.
79 changes: 28 additions & 51 deletions node/client/src/lib.rs → client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
pub mod benchmarking;

use sc_client_api::{
AuxStore, Backend as BackendT, BlockchainEvents, HeaderBackend, KeyIterator, UsageProvider,
AuxStore, Backend as BackendT, BlockchainEvents, HeaderBackend, KeysIter, UsageProvider, PairsIter,
};
use sc_executor::NativeElseWasmExecutor;
use sc_service::Arc;
use sp_api::{CallApiAt, NumberFor, ProvideRuntimeApi};
use sp_consensus::BlockStatus;
use sp_runtime::{
generic::{BlockId, SignedBlock},
generic::{SignedBlock},
traits::{BlakeTwo256, Block as BlockT},
Justifications,
};
Expand Down Expand Up @@ -79,7 +79,7 @@ pub trait RuntimeApiCollection:
sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
+ sp_api::ApiExt<Block>
+ sp_consensus_babe::BabeApi<Block>
+ sp_finality_grandpa::GrandpaApi<Block>
+ sp_consensus_grandpa::GrandpaApi<Block>
+ sp_block_builder::BlockBuilder<Block>
+ substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
Expand All @@ -97,7 +97,7 @@ where
Api: sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block>
+ sp_api::ApiExt<Block>
+ sp_consensus_babe::BabeApi<Block>
+ sp_finality_grandpa::GrandpaApi<Block>
+ sp_consensus_grandpa::GrandpaApi<Block>
+ sp_block_builder::BlockBuilder<Block>
+ substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
Expand Down Expand Up @@ -268,22 +268,25 @@ impl sc_client_api::BlockBackend<Block> for Client {
}
}

fn block(&self, id: &BlockId<Block>) -> sp_blockchain::Result<Option<SignedBlock<Block>>> {
fn block(
&self,
hash: <Block as BlockT>::Hash,
) -> sp_blockchain::Result<Option<SignedBlock<Block>>> {
with_client! {
self,
client,
{
client.block(id)
client.block(hash)
}
}
}

fn block_status(&self, id: &BlockId<Block>) -> sp_blockchain::Result<BlockStatus> {
fn block_status(&self, hash: <Block as BlockT>::Hash) -> sp_blockchain::Result<BlockStatus> {
with_client! {
self,
client,
{
client.block_status(id)
client.block_status(hash)
}
}
}
Expand Down Expand Up @@ -363,19 +366,6 @@ impl sc_client_api::StorageProvider<Block, crate::FullBackend> for Client {
}
}

fn storage_keys(
&self,
hash: <Block as BlockT>::Hash,
key_prefix: &StorageKey,
) -> sp_blockchain::Result<Vec<StorageKey>> {
with_client! {
self,
client,
{
client.storage_keys(hash, key_prefix)
}
}
}

fn storage_hash(
&self,
Expand All @@ -394,30 +384,33 @@ impl sc_client_api::StorageProvider<Block, crate::FullBackend> for Client {
fn storage_pairs(
&self,
hash: <Block as BlockT>::Hash,
key_prefix: &StorageKey,
) -> sp_blockchain::Result<Vec<(StorageKey, StorageData)>> {
key_prefix: Option<&StorageKey>,
start_key: Option<&StorageKey>,
) -> sp_blockchain::Result<
PairsIter<<crate::FullBackend as sc_client_api::Backend<Block>>::State, Block>,
> {
with_client! {
self,
client,
{
client.storage_pairs(hash, key_prefix)
client.storage_pairs(hash, key_prefix, start_key)
}
}
}

fn storage_keys_iter<'a>(
fn storage_keys(
&self,
hash: <Block as BlockT>::Hash,
prefix: Option<&'a StorageKey>,
prefix: Option<&StorageKey>,
start_key: Option<&StorageKey>,
) -> sp_blockchain::Result<
KeyIterator<'a, <crate::FullBackend as sc_client_api::Backend<Block>>::State, Block>,
KeysIter<<crate::FullBackend as sc_client_api::Backend<Block>>::State, Block>,
> {
with_client! {
self,
client,
{
client.storage_keys_iter(hash, prefix, start_key)
client.storage_keys(hash, prefix, start_key)
}
}
}
Expand All @@ -438,34 +431,19 @@ impl sc_client_api::StorageProvider<Block, crate::FullBackend> for Client {
}

fn child_storage_keys(
&self,
hash: <Block as BlockT>::Hash,
child_info: &ChildInfo,
key_prefix: &StorageKey,
) -> sp_blockchain::Result<Vec<StorageKey>> {
with_client! {
self,
client,
{
client.child_storage_keys(hash, child_info, key_prefix)
}
}
}

fn child_storage_keys_iter<'a>(
&self,
hash: <Block as BlockT>::Hash,
child_info: ChildInfo,
prefix: Option<&'a StorageKey>,
prefix: Option<&StorageKey>,
start_key: Option<&StorageKey>,
) -> sp_blockchain::Result<
KeyIterator<'a, <crate::FullBackend as sc_client_api::Backend<Block>>::State, Block>,
KeysIter<<crate::FullBackend as sc_client_api::Backend<Block>>::State, Block>,
> {
with_client! {
self,
client,
{
client.child_storage_keys_iter(hash, child_info, prefix, start_key)
client.child_storage_keys(hash, child_info, prefix, start_key)
}
}
}
Expand All @@ -487,16 +465,15 @@ impl sc_client_api::StorageProvider<Block, crate::FullBackend> for Client {
}

impl sp_blockchain::HeaderBackend<Block> for Client {
fn header(&self, id: BlockId<Block>) -> sp_blockchain::Result<Option<Header>> {
fn header(&self, hash: Hash) -> sp_blockchain::Result<Option<Header>> {
with_client! {
self,
client,
{
client.header(&id)
client.header(hash)
}
}
}

fn info(&self) -> sp_blockchain::Info<Block> {
with_client! {
self,
Expand All @@ -507,12 +484,12 @@ impl sp_blockchain::HeaderBackend<Block> for Client {
}
}

fn status(&self, id: BlockId<Block>) -> sp_blockchain::Result<sp_blockchain::BlockStatus> {
fn status(&self, hash: Hash) -> sp_blockchain::Result<sp_blockchain::BlockStatus> {
with_client! {
self,
client,
{
client.status(id)
client.status(hash)
}
}
}
Expand Down
103 changes: 103 additions & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
[package]
name = "ternoa-node"
version = "1.4.3"
description = "Ternoa node"
edition = "2021"
license = "GNU GPL v3"
build = "build.rs"


[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]


[[bin]]
name = "ternoa-node"

[dependencies]
clap = { version = "4.0.9", features = ["derive"] }
futures = { version = "0.3.21", features = ["thread-pool"]}
log = "0.4.17"
rand = "0.8"
hex-literal = "0.3.4"
serde = { version = "1.0.137", features = [ "derive" ] }

sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-chain-spec = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-network-common = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-network-sync = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-sysinfo = { version = "6.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-consensus-babe = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-consensus-babe = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-consensus-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-consensus-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-consensus-slots = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-storage-monitor = { version = "0.1.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-keystore = { version = "0.13.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-transaction-storage-proof = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false }
frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
pallet-im-online = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
pallet-staking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }

# These dependencies are used for the node template's RPCs
jsonrpsee = { version = "0.16.2", features = ["server"] }
sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-basic-authorship = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-consensus-babe-rpc = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-consensus-epochs = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-consensus-grandpa-rpc = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
sc-rpc-spec-v2 = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }

# These dependencies are used for runtime benchmarking
frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }
frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }

# Local Dependencies
alphanet-runtime = { version = "1.4.2", path = "../runtime/alphanet" }
ternoa-runtime-common = { version = "1.4.2", path = "../runtime/common" }

# Common types
ternoa-core-primitives = { version = "1.4.2", default-features = false, path = "../core-primitives" }

# CLI-specific dependencies
try-runtime-cli = { version = "0.10.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }

[build-dependencies]
substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.40" }

[features]
default = []
# Dependencies that are only required if runtime benchmarking should be build.
runtime-benchmarks = [
"alphanet-runtime/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
]
# Enable features that allow the runtime to be tried and debugged. Name might be subject to change
# in the near future.
try-runtime = ["alphanet-runtime/try-runtime", "try-runtime-cli/try-runtime"]
File renamed without changes.
63 changes: 0 additions & 63 deletions node/cli/Cargo.toml

This file was deleted.

Loading

0 comments on commit a1a825c

Please sign in to comment.