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

Refactor common code among clients #316

Merged
merged 33 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
aef9a7f
new_partial signature
nanocryk Nov 3, 2023
5dfb323
common new_partial for tanssi and simple (not frontier)
nanocryk Nov 3, 2023
80326e9
extract divergent code with frontier new_partial
nanocryk Nov 3, 2023
6b71e47
cleanup
nanocryk Nov 3, 2023
3bb5279
update new_partial_dev
nanocryk Nov 3, 2023
f7840b7
use macro to reduce generics verbosity
nanocryk Nov 3, 2023
8cd2096
generic build_cumulus_network based on custom import_queue + toml-sort
nanocryk Nov 3, 2023
df1d4f7
sc_service::spawn_tasks with custom rpc_builder
nanocryk Nov 6, 2023
c3fca09
hwbench
nanocryk Nov 6, 2023
bc397ca
use `core_extensions::TypeIdentity` to simplify code
nanocryk Nov 6, 2023
5df2e95
support substrate/cumulus network + manual_seal
nanocryk Nov 7, 2023
f3e7dbc
use sink/senders in rpc builder
nanocryk Nov 7, 2023
0355595
replace new_dev by start_dev_node + remove async
nanocryk Nov 7, 2023
83b963a
NodeBuilder::start_full_node
nanocryk Nov 7, 2023
ea51604
replace macro with config trait+type
nanocryk Nov 8, 2023
3a32978
new_builder trait fn
nanocryk Nov 8, 2023
e47a688
start_collator
nanocryk Nov 8, 2023
63adfc3
update frontier template
nanocryk Nov 10, 2023
bb23236
method to not start a node yet
nanocryk Nov 16, 2023
18c3569
Merge remote-tracking branch 'origin/master' into jeremy-refactor-cli…
nanocryk Nov 16, 2023
3934056
start_node_impl_container + remove new_partial
nanocryk Nov 16, 2023
edf8a83
cleanup
nanocryk Nov 16, 2023
7bf1fb2
clippy
nanocryk Nov 20, 2023
b39b13d
remove new_partial in frontier template
nanocryk Nov 20, 2023
084253e
remove new_partial from substrate template
nanocryk Nov 20, 2023
0f35386
cleanup
nanocryk Nov 21, 2023
be5f9c1
fmt
girazoki Nov 22, 2023
46fd4a9
Merge remote-tracking branch 'origin/master' into jeremy-refactor-cli…
girazoki Nov 22, 2023
aeb34e9
rename
nanocryk Nov 23, 2023
77613bb
Merge remote-tracking branch 'origin/master' into jeremy-refactor-cli…
nanocryk Nov 24, 2023
aba5f2f
fmt
nanocryk Nov 24, 2023
e401ae6
Merge remote-tracking branch 'origin/master' into jeremy-refactor-cli…
nanocryk Nov 24, 2023
7595b1e
toml-sort
nanocryk Nov 24, 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
79 changes: 79 additions & 0 deletions Cargo.lock

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

56 changes: 30 additions & 26 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ container-chain-template-simple-runtime = { path = "container-chains/templates/s

dancebox-runtime = { path = "runtime/dancebox", default-features = false }
manual-xcm-rpc = { path = "client/manual-xcm" }
node-common = { path = "client/node-common" }
tc-consensus = { path = "client/consensus" }
tp-author-noting-inherent = { path = "primitives/author-noting-inherent", default-features = false }
tp-consensus = { path = "primitives/consensus", default-features = false }
Expand All @@ -47,13 +48,13 @@ tp-maths = { path = "primitives/maths", default-features = false }
tp-traits = { path = "primitives/traits", default-features = false }

# Dancekit (wasm)
ccp-authorities-noting-inherent = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
ccp-xcm = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
dp-core = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
dp-collator-assignment = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
dp-chain-state-snapshot = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
pallet-cc-authorities-noting = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
test-relay-sproof-builder = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
ccp-authorities-noting-inherent = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
ccp-xcm = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
dp-chain-state-snapshot = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
dp-collator-assignment = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
dp-core = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
pallet-cc-authorities-noting = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
test-relay-sproof-builder = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0", default-features = false }

# Dancekit (client)
dc-orchestrator-chain-interface = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.1.0" }
Expand All @@ -62,16 +63,15 @@ dc-orchestrator-chain-interface = { git = "https://github.com/moondance-labs/dan
nimbus-consensus = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.1.0" }
nimbus-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
pallet-author-inherent = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
pallet-maintenance-mode = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
pallet-migrations = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
xcm-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
pallet-evm-precompile-balances-erc20 = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
pallet-evm-precompile-batch = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
pallet-evm-precompile-call-permit = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
pallet-evm-precompile-xcm-utils = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
pallet-maintenance-mode = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
pallet-migrations = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.1.0", default-features = false }
xcm-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.1.0", default-features = false }

# Substrate (wasm)
sp-consensus-beefy = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
frame-benchmarking = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
frame-executive = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
frame-support = { git = "https://github.com/moondance-labs/polkadot-sdk.git", branch = "tanssi-polkadot-v1.1.0", version = "4.0.0-dev", default-features = false }
Expand All @@ -98,6 +98,7 @@ sp-block-builder = { git = "https://github.com/moondance-labs/polkadot-sdk", bra
sp-consensus = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
sp-consensus-aura = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
sp-consensus-babe = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
sp-consensus-beefy = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
sp-consensus-slots = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
sp-core = { git = "https://github.com/moondance-labs/polkadot-sdk.git", branch = "tanssi-polkadot-v1.1.0", version = "21.0.0", default-features = false }
sp-debug-derive = { git = "https://github.com/moondance-labs/polkadot-sdk.git", branch = "tanssi-polkadot-v1.1.0", default-features = false }
Expand Down Expand Up @@ -133,6 +134,7 @@ sc-network = { git = "https://github.com/moondance-labs/polkadot-sdk", branch =
sc-network-common = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0" }
sc-network-sync = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0" }
sc-network-test = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0" }
sc-network-transactions = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0" }
sc-offchain = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0" }
sc-rpc = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0" }
sc-service = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0" }
Expand All @@ -141,6 +143,7 @@ sc-telemetry = { git = "https://github.com/moondance-labs/polkadot-sdk", branch
sc-tracing = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0" }
sc-transaction-pool = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0" }
sc-transaction-pool-api = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0" }
sc-utils = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0" }
sp-blockchain = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0" }
sp-externalities = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
sp-keystore = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
Expand All @@ -161,11 +164,11 @@ pallet-xcm-benchmarks = { git = "https://github.com/moondance-labs/polkadot-sdk"
polkadot-parachain-primitives = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
polkadot-runtime-common = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
polkadot-runtime-parachains = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
westend-runtime = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
westend-runtime-constants = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
staging-xcm = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
staging-xcm-builder = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
staging-xcm-executor = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
westend-runtime = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }
westend-runtime-constants = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0", default-features = false }

# Polkadot (client)
polkadot-cli = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.1.0" }
Expand Down Expand Up @@ -228,17 +231,18 @@ fc-storage = { git = "https://github.com/moondance-labs/frontier", branch = "tan
# General (wasm)
bounded-collections = { version = "0.1.8", default-features = false }
hex-literal = { version = "0.3.4" }
impl-trait-for-tuples = "0.2.2"
log = { version = "0.4.17", default-features = false }
num_enum = { version = "0.7.1", default-features = false }
rand_chacha = { version = "0.3.1", default-features = false }
serde = { version = "1.0.152", default-features = false }
smallvec = "1.10.0"
rand_chacha = { version = "0.3.1", default-features = false }
num_enum = { version = "0.7.1", default-features = false }
impl-trait-for-tuples = "0.2.2"

# General (client)
async-io = "1.3"
async-trait = "0.1"
clap = { version = "4.1.6", default-features = false, features = [ "derive" ] }
core_extensions = "1.5.3"
exit-future = { version = "0.2.0" }
flume = "0.10.9"
futures = { version = "0.3.1" }
Expand All @@ -256,6 +260,16 @@ tokio = { version = "1.32.0", default-features = false }
tracing = { version = "0.1.37", default-features = false }
url = "2.2.2"

[patch.crates-io]
jsonrpsee = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
jsonrpsee-client-transport = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
jsonrpsee-core = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
jsonrpsee-http-client = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
jsonrpsee-proc-macros = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
jsonrpsee-server = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
jsonrpsee-types = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
jsonrpsee-ws-client = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }

[profile.production]
codegen-units = 1
inherits = "release"
Expand All @@ -265,13 +279,3 @@ lto = true
[profile.release]
opt-level = 3
panic = "unwind"

[patch.crates-io]
jsonrpsee = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
jsonrpsee-client-transport = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
jsonrpsee-core = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
jsonrpsee-types = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
jsonrpsee-http-client = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
jsonrpsee-proc-macros = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
jsonrpsee-server = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
jsonrpsee-ws-client = { git = "https://github.com/moondance-labs/jsonrpsee", branch = "tanssi-polkadot-v1.1.0" }
2 changes: 1 addition & 1 deletion client/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sc-consensus-manual-seal = { workspace = true }
sc-consensus-slots = { workspace = true }
sc-telemetry = { workspace = true }
sp-api = { workspace = true }
sp-application-crypto = { workspace = true, features = [ "std", "full_crypto"] }
sp-application-crypto = { workspace = true, features = [ "full_crypto", "std" ] }
sp-block-builder = { workspace = true }
sp-blockchain = { workspace = true }
sp-consensus = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion client/manual-xcm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ futures = { workspace = true, features = [ "compat" ] }
hex-literal = { workspace = true }
jsonrpsee = { workspace = true, features = [ "macros", "server" ] }
parity-scale-codec = { workspace = true, features = [ "std" ] }
tokio = { workspace = true, features = [ "sync", "time" ] }
staging-xcm = { workspace = true }
tokio = { workspace = true, features = [ "sync", "time" ] }

cumulus-primitives-core = { workspace = true, features = [ "std" ] }
84 changes: 84 additions & 0 deletions client/node-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[package]
name = "node-common"
authors = { workspace = true }
description = "Common code between various nodes"
edition = "2021"
license = "GPL-3.0-only"
version = "0.1.0"

[dependencies]
async-io = { workspace = true }
async-trait = { workspace = true }
clap = { workspace = true, features = [ "derive" ] }
core_extensions = { workspace = true, features = [ "type_identity" ] }
flume = { workspace = true }
futures = { workspace = true }
jsonrpsee = { workspace = true, features = [ "server" ] }
log = { workspace = true }
parity-scale-codec = { workspace = true }
serde = { workspace = true, features = [ "derive" ] }

# Local
tc-consensus = { workspace = true }

# Nimbus
nimbus-consensus = { workspace = true }
nimbus-primitives = { workspace = true, features = [ "std" ] }

# Substrate
frame-benchmarking = { workspace = true }
frame-benchmarking-cli = { workspace = true }
sc-basic-authorship = { workspace = true }
sc-chain-spec = { workspace = true }
sc-cli = { workspace = true }
sc-client-api = { workspace = true }
sc-consensus = { workspace = true }
sc-consensus-manual-seal = { workspace = true }
sc-executor = { workspace = true }
sc-network = { workspace = true }
sc-network-common = { workspace = true }
sc-network-sync = { workspace = true }
sc-network-transactions = { workspace = true }
sc-offchain = { workspace = true }
sc-rpc = { workspace = true }
sc-service = { workspace = true }
sc-sysinfo = { workspace = true }
sc-telemetry = { workspace = true }
sc-tracing = { workspace = true }
sc-transaction-pool = { workspace = true }
sc-transaction-pool-api = { workspace = true }
sc-utils = { workspace = true }
sp-api = { workspace = true, features = [ "std" ] }
sp-block-builder = { workspace = true }
sp-blockchain = { workspace = true }
sp-consensus = { workspace = true }
sp-consensus-aura = { workspace = true }
sp-core = { workspace = true, features = [ "std" ] }
sp-inherents = { workspace = true, features = [ "std" ] }
sp-io = { workspace = true, features = [ "std" ] }
sp-keystore = { workspace = true, features = [ "std" ] }
sp-offchain = { workspace = true, features = [ "std" ] }
sp-runtime = { workspace = true, features = [ "std" ] }
sp-session = { workspace = true, features = [ "std" ] }
sp-timestamp = { workspace = true, features = [ "std" ] }

sp-transaction-pool = { workspace = true }
substrate-frame-rpc-system = { workspace = true }
substrate-prometheus-endpoint = { workspace = true }
try-runtime-cli = { workspace = true, optional = true }

# Polkadot
polkadot-cli = { workspace = true }
polkadot-primitives = { workspace = true }
polkadot-service = { workspace = true }

# Cumulus
cumulus-client-cli = { workspace = true }
cumulus-client-collator = { workspace = true }
cumulus-client-consensus-aura = { workspace = true }
cumulus-client-consensus-common = { workspace = true }
cumulus-client-network = { workspace = true }
cumulus-client-service = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-parachain-inherent = { workspace = true }
cumulus-relay-chain-interface = { workspace = true }
17 changes: 17 additions & 0 deletions client/node-common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (C) Moondance Labs Ltd.
// This file is part of Tanssi.

// Tanssi is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Tanssi is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Tanssi. If not, see <http://www.gnu.org/licenses/>.

pub mod service;
Loading
Loading