Skip to content

Commit

Permalink
cargo: Update experimental litep2p to latest version (paritytech#4344)
Browse files Browse the repository at this point in the history
This PR updates the litep2p crate to the latest version.

This fixes the build for developers that want to perform `cargo update`
on all their dependencies:
paritytech#4343, by porting the
latest changes.

The peer records were introduced to litep2p to be able to distinguish
and update peers with outdated records.
It is going to be properly used in substrate via:
paritytech#3786, however that is
pending the commit to merge on litep2p master:
paritytech/litep2p#96.

Closes: paritytech#4343

---------

Signed-off-by: Alexandru Vasile <[email protected]>
  • Loading branch information
lexnv authored and koushiro committed May 11, 2024
1 parent 0bb6249 commit ef8c4b3
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 28 deletions.
50 changes: 25 additions & 25 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion substrate/client/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ sp-blockchain = { path = "../../primitives/blockchain" }
sp-core = { path = "../../primitives/core" }
sp-runtime = { path = "../../primitives/runtime" }
wasm-timer = "0.2"
litep2p = { git = "https://github.com/paritytech/litep2p", branch = "master" }
litep2p = { git = "https://github.com/paritytech/litep2p", rev = "e03a6023882db111beeb24d8c0ceaac0721d3f0f" }
once_cell = "1.18.0"
void = "1.0.2"
schnellru = "0.2.1"
Expand Down
5 changes: 4 additions & 1 deletion substrate/client/network/src/litep2p/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,10 @@ impl Stream for Discovery {
"`GET_RECORD` succeeded for {query_id:?}: {record:?}",
);

return Poll::Ready(Some(DiscoveryEvent::GetRecordSuccess { query_id, record }));
return Poll::Ready(Some(DiscoveryEvent::GetRecordSuccess {
query_id,
record: record.record,
}));
},
Poll::Ready(Some(KademliaEvent::PutRecordSucess { query_id, key: _ })) =>
return Poll::Ready(Some(DiscoveryEvent::PutRecordSuccess { query_id })),
Expand Down
2 changes: 1 addition & 1 deletion substrate/client/network/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ documentation = "https://docs.rs/sc-network-types"
[dependencies]
bs58 = "0.4.0"
libp2p-identity = { version = "0.1.3", features = ["ed25519", "peerid"] }
litep2p = { git = "https://github.com/paritytech/litep2p", branch = "master" }
litep2p = { git = "https://github.com/paritytech/litep2p", rev = "e03a6023882db111beeb24d8c0ceaac0721d3f0f" }
multiaddr = "0.17.0"
multihash = { version = "0.17.0", default-features = false, features = ["identity", "multihash-impl", "sha2", "std"] }
rand = "0.8.5"
Expand Down

0 comments on commit ef8c4b3

Please sign in to comment.