Skip to content

Commit

Permalink
refactor: update code to match lint expectation
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Paitrault <[email protected]>
  • Loading branch information
Freyskeyd committed Jul 10, 2023
1 parent 77b0623 commit ff9ae91
Show file tree
Hide file tree
Showing 34 changed files with 1,900 additions and 592 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:

jobs:
test_stable:
runs-on: ubuntu-latest
runs-on: ubuntu-latest-16-core
strategy:
fail-fast: false
name: stable - Test
Expand All @@ -26,10 +26,10 @@ jobs:

- run: cargo nextest run --workspace --exclude topos-sequencer-subnet-runtime && cargo test --doc --workspace
env:
RUST_LOG: topos=warn
RUST_LOG: warn,topos=info

test_nightly:
runs-on: ubuntu-latest
runs-on: ubuntu-latest-16-core
strategy:
fail-fast: false
name: nightly - Test
Expand Down
87 changes: 53 additions & 34 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ http = "0.2.9"
tower-http = { version = "0.4", features = ["cors"] }

# P2P related
# libp2p = { version = "0.52", default-features = false, features = ["noise"]}
libp2p = { branch = "bump-yamux", git = "https://github.com/libp2p/rust-libp2p.git", default-features = false, features = ["noise"]}
libp2p = { version = "0.52", default-features = false, features = ["noise"]}

# Serialization & Deserialization
bincode = { version = "1.3", default-features = false }
byteorder = { version = "1.4", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions crates/topos-metrics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,5 @@ pub fn init_metrics() {
CERTIFICATE_RECEIVED_FROM_GOSSIP_TOTAL.reset();
CERTIFICATE_RECEIVED_FROM_API_TOTAL.reset();
CERTIFICATE_DELIVERED_TOTAL.reset();
STORAGE_COMMAND_CHANNEL_CAPACITY_TOTAL.reset();
}
1 change: 1 addition & 0 deletions crates/topos-p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ tokio-stream.workspace = true
tracing = { workspace = true, features = ["attributes"] }

libp2p = { workspace = true, features = ["macros", "gossipsub", "tcp", "dns", "tokio", "request-response", "identify", "kad", "serde", "yamux"] }

void = "1"

topos-metrics = { path = "../topos-metrics/" }
Expand Down
7 changes: 3 additions & 4 deletions crates/topos-p2p/src/behaviour/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ impl DiscoveryBehaviour {
) -> Self {
let local_peer_id = peer_key.public().to_peer_id();
let kademlia_config = KademliaConfig::default()
.set_protocol_names(vec![StreamProtocol::new(TRANSMISSION_PROTOCOL)])
.set_replication_factor(config.replication_factor)
.set_kbucket_inserts(KademliaBucketInserts::Manual)
.set_replication_interval(config.replication_interval)
Expand All @@ -57,9 +56,9 @@ impl DiscoveryBehaviour {
kademlia.add_address(&known_peer.0, known_peer.1.clone());
}

if let Err(store_error) = kademlia.start_providing("topos-tce".as_bytes().to_vec().into()) {
warn!(reason = %store_error, "Could not start providing Kademlia protocol `topos-tce`")
}
// if let Err(store_error) = kademlia.start_providing("topos-tce".as_bytes().to_vec().into()) {
// warn!(reason = %store_error, "Could not start providing Kademlia protocol `topos-tce`")
// }

Self { inner: kademlia }
}
Expand Down
Loading

0 comments on commit ff9ae91

Please sign in to comment.