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

[POC] Spawn embeded Container chain node on data preservers assignment #666

Merged
merged 30 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5533d82
wip
nanocryk Aug 9, 2024
9a1f79d
setup new moonwall profile (not working yet)
nanocryk Aug 13, 2024
bcc1545
get non-modified test suite working
nanocryk Aug 19, 2024
4fc4e5b
wip spawner
nanocryk Aug 19, 2024
6c0a964
fix runtime api call
nanocryk Aug 20, 2024
22186f4
hack to ignore absence of metrics in rpc mode
nanocryk Aug 20, 2024
98aad02
watcher properly reacts to assignment
nanocryk Aug 22, 2024
977850e
working RPC endpoint spawning with test
nanocryk Aug 23, 2024
c3822a7
Merge remote-tracking branch 'origin/master' into jeremy-spawn-cc-on-…
nanocryk Aug 26, 2024
ee7ba6c
rename interface fn
nanocryk Aug 26, 2024
91a9b93
update lock + data preservers flag in spawner
nanocryk Aug 27, 2024
fd9eb96
get rid of script
nanocryk Aug 28, 2024
51de92b
cleanup
nanocryk Aug 28, 2024
2016586
Merge remote-tracking branch 'origin/master' into jeremy-spawn-cc-on-…
nanocryk Aug 28, 2024
e2f02d2
cleanup
nanocryk Aug 28, 2024
302b0a9
Improve docs
nanocryk Aug 28, 2024
92c7757
add suite to CI
nanocryk Aug 29, 2024
3e34c36
cleanup and comments
nanocryk Aug 29, 2024
055e7ce
zepter
nanocryk Aug 29, 2024
4e22f63
api augment
nanocryk Aug 29, 2024
22e510b
Merge remote-tracking branch 'origin/master' into jeremy-spawn-cc-on-…
nanocryk Aug 29, 2024
59f96d3
add back log
nanocryk Aug 29, 2024
cd35c26
Merge remote-tracking branch 'origin/master' into jeremy-spawn-cc-on-…
nanocryk Sep 2, 2024
20fdcf7
spawner mock
nanocryk Sep 3, 2024
97f6ffa
Merge remote-tracking branch 'origin/master' into jeremy-spawn-cc-on-…
nanocryk Sep 3, 2024
b22442f
test + PR feedback
nanocryk Sep 4, 2024
a2efc47
lints
nanocryk Sep 5, 2024
02a5170
Merge remote-tracking branch 'origin/master' into jeremy-spawn-cc-on-…
nanocryk Sep 5, 2024
1f1b95e
improve test
nanocryk Sep 5, 2024
cf2bd36
Merge remote-tracking branch 'origin/master' into jeremy-spawn-cc-on-…
nanocryk Sep 6, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ jobs:
strategy:
fail-fast: false
matrix:
test_name: [zombie_tanssi, zombie_tanssi_parathreads, zombie_tanssi_rotation, zombie_tanssi_warp_sync, zombie_tanssi_relay]
test_name: [zombie_tanssi, zombie_tanssi_parathreads, zombie_tanssi_rotation, zombie_tanssi_warp_sync, zombie_tanssi_relay, zombie_data_preservers]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
44 changes: 31 additions & 13 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ pallet-collator-assignment = { path = "pallets/collator-assignment", default-fea
pallet-collator-assignment-runtime-api = { path = "pallets/collator-assignment/runtime-api", default-features = false }
pallet-configuration = { path = "pallets/configuration", default-features = false }
pallet-data-preservers = { path = "pallets/data-preservers", default-features = false }
pallet-data-preservers-runtime-api = { path = "pallets/data-preservers/runtime-api", default-features = false }
pallet-inflation-rewards = { path = "pallets/inflation-rewards", default-features = false }
pallet-initializer = { path = "pallets/initializer", default-features = false }
pallet-invulnerables = { path = "pallets/invulnerables", default-features = false }
Expand Down
44 changes: 35 additions & 9 deletions client/orchestrator-chain-rpc-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ use {
async_trait::async_trait,
core::pin::Pin,
dc_orchestrator_chain_interface::{
BlockNumber, ContainerChainGenesisData, OrchestratorChainError, OrchestratorChainInterface,
OrchestratorChainResult, PHash, PHeader,
BlockNumber, ContainerChainGenesisData, DataPreserverAssignment, DataPreserverProfileId,
OrchestratorChainError, OrchestratorChainInterface, OrchestratorChainResult, PHash,
PHeader,
},
dp_core::ParaId,
futures::{Stream, StreamExt},
Expand Down Expand Up @@ -114,7 +115,7 @@ impl OrchestratorChainRpcClient {
};
let res = self
.request_tracing::<sp_core::Bytes, _>("state_call", params, |err| {
tracing::trace!(
tracing::debug!(
target: LOG_TARGET,
%method_name,
%hash,
Expand Down Expand Up @@ -289,26 +290,38 @@ impl OrchestratorChainInterface for OrchestratorChainRpcClient {
orchestrator_parent: PHash,
para_id: ParaId,
) -> OrchestratorChainResult<Option<ContainerChainGenesisData>> {
self.call_remote_runtime_function("genesis_data", orchestrator_parent, Some(para_id))
.await
self.call_remote_runtime_function(
"RegistrarApi_genesis_data",
orchestrator_parent,
Some(para_id),
)
.await
}

async fn boot_nodes(
&self,
orchestrator_parent: PHash,
para_id: ParaId,
) -> OrchestratorChainResult<Vec<Vec<u8>>> {
self.call_remote_runtime_function("boot_nodes", orchestrator_parent, Some(para_id))
.await
self.call_remote_runtime_function(
"RegistrarApi_boot_nodes",
orchestrator_parent,
Some(para_id),
)
.await
}

async fn latest_block_number(
&self,
orchestrator_parent: PHash,
para_id: ParaId,
) -> OrchestratorChainResult<Option<BlockNumber>> {
self.call_remote_runtime_function("latest_block_number", orchestrator_parent, Some(para_id))
.await
self.call_remote_runtime_function(
"AuthorNotingApi_latest_block_number",
orchestrator_parent,
Some(para_id),
)
.await
}

async fn best_block_hash(&self) -> OrchestratorChainResult<PHash> {
Expand All @@ -318,4 +331,17 @@ impl OrchestratorChainInterface for OrchestratorChainRpcClient {
async fn finalized_block_hash(&self) -> OrchestratorChainResult<PHash> {
self.request("chain_getFinalizedHead", rpc_params![]).await
}

async fn data_preserver_active_assignment(
nanocryk marked this conversation as resolved.
Show resolved Hide resolved
&self,
orchestrator_parent: PHash,
profile_id: DataPreserverProfileId,
) -> OrchestratorChainResult<DataPreserverAssignment<ParaId>> {
self.call_remote_runtime_function(
"DataPreserversApi_get_active_assignment",
orchestrator_parent,
Some(profile_id),
)
.await
}
}
9 changes: 8 additions & 1 deletion client/service-container-chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ tokio = { workspace = true }
tokio-util = { workspace = true }

# Local
ccp-authorities-noting-inherent = { workspace = true }
ccp-authorities-noting-inherent = { workspace = true, features = [ "std" ] }
dancebox-runtime = { workspace = true, features = [ "std" ] }
manual-xcm-rpc = { workspace = true }
node-common = { workspace = true }
pallet-author-noting-runtime-api = { workspace = true, features = [ "std" ] }
pallet-data-preservers = { workspace = true, features = [ "std" ] }
services-payment-rpc = { workspace = true }
stream-payment-rpc = { workspace = true }
tc-consensus = { workspace = true }
Expand Down Expand Up @@ -81,6 +82,10 @@ cumulus-relay-chain-interface = { workspace = true }
nimbus-consensus = { workspace = true }
nimbus-primitives = { workspace = true }

[dev-dependencies]
polkadot-overseer = { workspace = true }
tokio-stream = { workspace = true }

[build-dependencies]
substrate-build-script-utils = { workspace = true }

Expand All @@ -90,13 +95,15 @@ runtime-benchmarks = [
"cumulus-primitives-core/runtime-benchmarks",
"dancebox-runtime/runtime-benchmarks",
"nimbus-primitives/runtime-benchmarks",
"pallet-data-preservers/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"dancebox-runtime/try-runtime",
"nimbus-primitives/try-runtime",
"pallet-data-preservers/try-runtime",
"sp-runtime/try-runtime",
]

Expand Down
Loading
Loading