Skip to content

Commit

Permalink
Revamp subcoin-network (#69)
Browse files Browse the repository at this point in the history
* Replace Arc<AtomicBool> with tokio::sync::watch channel

* Nits

* Priority latency when selecting peer for sync

* Try headers request action when block download batches are empty

* Rename to DownloadingInv

* Rename BlockDownloadManager to BlockDownloader

* Reorg strategy module

* Rename to BlockFirstStrategy and HeadersFirstStrategy

* Nit

* Revamp blocks-first

* Set sync status to Importing when all missing blocks are downloaded

* Fix lost sync action on chain_sync.add_new_peer()

* Start chain sync only with enough peers

* TODO

* Handle block annoucements via inv

* Handle block announce via headers

* Add log prefix in network tests

* Refactor headers-first using new BlockDownloader

* Fix test

* Fix clippy

* Abstract BlockListDownloader

* Remove DownloadedHeaders

* Separate missing_block_list()

* Separate schedule_block_download()

* Overhaul HeadersFirstStrategy

* Overhaul BlocksFirstStrategy

* Remove unused dep in subcoin-network

* Reorg sync module in subcoin-network

* Renamings

* Fix test

* Move downloaded_blocks_count into BlockDownloader

* Rename worker.rs to net_processor.rs

* Rename network_api.rs
  • Loading branch information
liuchengxu authored Nov 2, 2024
1 parent 8c51137 commit ec7ff20
Show file tree
Hide file tree
Showing 18 changed files with 1,893 additions and 1,694 deletions.
1 change: 1 addition & 0 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 @@ -77,6 +77,7 @@ sc-service = { git = "https://github.com/subcoin-project/polkadot-sdk", branch =
sc-storage-monitor = { git = "https://github.com/subcoin-project/polkadot-sdk", branch = "subcoin-v3" }
sc-sysinfo = { git = "https://github.com/subcoin-project/polkadot-sdk", branch = "subcoin-v3" }
sc-telemetry = { git = "https://github.com/subcoin-project/polkadot-sdk", branch = "subcoin-v3" }
sc-tracing = { git = "https://github.com/subcoin-project/polkadot-sdk", branch = "subcoin-v3" }
sc-transaction-pool = { git = "https://github.com/subcoin-project/polkadot-sdk", branch = "subcoin-v3" }
sc-transaction-pool-api = { git = "https://github.com/subcoin-project/polkadot-sdk", branch = "subcoin-v3" }
sc-utils = { git = "https://github.com/subcoin-project/polkadot-sdk", branch = "subcoin-v3" }
Expand Down
1 change: 1 addition & 0 deletions crates/subcoin-network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ tokio = { workspace = true, features = ["full"] }
tracing = { workspace = true }

[dev-dependencies]
sc-tracing = { workspace = true }
sp-tracing = { workspace = true }
subcoin-service = { workspace = true }
subcoin-test-service = { workspace = true }
Expand Down
Loading

0 comments on commit ec7ff20

Please sign in to comment.