Skip to content

Commit cccff3c

Browse files
committed
Add archiving to make sure node sync from DSN succeeds
1 parent 93d33d2 commit cccff3c

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/subspace-node/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ sc-cli = { version = "0.10.0-dev", git = "https://github.com/subspace/substrate"
3838
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/subspace/substrate", rev = "6d57dbc639bb3d9460dabeccb063cc6556452535" }
3939
sc-consensus = { version = "0.10.0-dev", git = "https://github.com/subspace/substrate", rev = "6d57dbc639bb3d9460dabeccb063cc6556452535" }
4040
sc-consensus-slots = { version = "0.10.0-dev", git = "https://github.com/subspace/substrate", rev = "6d57dbc639bb3d9460dabeccb063cc6556452535" }
41+
sc-consensus-subspace = { version = "0.1.0", path = "../sc-consensus-subspace" }
4142
sc-subspace-chain-specs = { version = "0.1.0", path = "../sc-subspace-chain-specs" }
4243
sc-executor = { version = "0.10.0-dev", git = "https://github.com/subspace/substrate", rev = "6d57dbc639bb3d9460dabeccb063cc6556452535", features = ["wasmtime"] }
4344
sc-service = { version = "0.10.0-dev", git = "https://github.com/subspace/substrate", rev = "6d57dbc639bb3d9460dabeccb063cc6556452535", default-features = false, features = ["wasmtime"] }

crates/subspace-node/src/bin/subspace-node.rs

+10
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,18 @@ fn main() -> Result<(), Error> {
196196
client,
197197
import_queue,
198198
task_manager,
199+
other: (_block_import, subspace_link, _telemetry),
199200
..
200201
} = subspace_service::new_partial::<RuntimeApi, ExecutorDispatch>(&config)?;
202+
203+
sc_consensus_subspace::start_subspace_archiver(
204+
&subspace_link,
205+
client.clone(),
206+
None,
207+
&task_manager.spawn_essential_handle(),
208+
config.role.is_authority(),
209+
);
210+
201211
Ok((
202212
cmd.run(client, import_queue, task_manager.spawn_essential_handle())
203213
.map_err(Error::SubstrateCli),

crates/subspace-node/src/import_blocks_from_dsn.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl<B: BlockT> Link<B> for WaitLink<B> {
121121
B::Hash,
122122
)>,
123123
) {
124-
println!("Imported {imported} blocks");
124+
debug!("Imported {imported} blocks");
125125
self.imported_blocks += imported as u64;
126126

127127
for result in results {
@@ -297,9 +297,11 @@ where
297297
}
298298

299299
info!(
300-
"🎉 Imported {} blocks, best #{}, exiting...",
300+
"🎉 Imported {} blocks, best #{}/#{}, check against reliable sources to make sure it is a \
301+
block on canonical chain",
301302
imported_blocks,
302-
client.info().best_number
303+
client.info().best_number,
304+
client.info().best_hash
303305
);
304306

305307
Ok(())

0 commit comments

Comments
 (0)