-
Notifications
You must be signed in to change notification settings - Fork 5
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
refactor(swap): Upgrade libp2p to 0.53.2 #109
base: master
Are you sure you want to change the base?
Conversation
- Update libp2p dependency to 0.53.2 in Cargo.toml - Add libp2p-swarm-derive dependency - Update imports and usage of libp2p types and traits - Refactor NetworkBehaviour implementations to match new API - Update Identify and Ping behavior configurations - Adjust event handling in network behaviors - Fix compiler errors and warnings related to API changes
…nal cbor impl, remove custom one (See: Remove custom cbor request response implementation, replaced with one from library (See: github.com/libp2p/rust-libp2p/pull/3952)
Here's an updated TODO list generated by Claude. Again, mostly for getting an overview over what needs to be done. Each issue needs to be looked into individually of course. Claude Compiler SummaryUnresolved Imports
Missing Trait Members
Type Mismatches
Other Errors
|
@Einliterflasche I think this is reasonably distributed across the code base that it'll be possible to work on this concurrently. Feel free to push to this branch. |
…ailed in swap/src/asb/event_loop.rs
Todo List for Compiler Errors
|
See: libp2p/rust-libp2p#3920 This should be backwards compatible because SelectUpgrade should allow older clients to use yamux instead of mplex
These functions were removed in this PR. I haven't been able to figure out quite what to replace our current approach with. Probably some combination of asynchronous-codec, quick-protobuf-codec and unsigned-varint. We should use libp2p/rust-libp2p#4787 as a starting point on how to migrate. |
…epalive and something else
@Einliterflasche Do you want to work on swap/src/network/swap_setup/alice.rs? I'll work on what I described in the comment above. |
I partially implemented swap/src/network/swap_setup/alice.rs, I'll have to check if I moved the function bodies correctly. I also fixed some of the import issues. It's down to 27 errors now, though there are two things I don't know how to fix: |
swap/src/asb/event_loop.rs
Outdated
|
||
/// Tracks [`transfer_proof::Request`]s which could not yet be sent because | ||
/// we are currently disconnected from the peer. | ||
buffered_transfer_proofs: HashMap<PeerId, Vec<(transfer_proof::Request, bmrng::Responder<()>)>>, | ||
/// | ||
/// If we are not connected to the peer, the transfer proof is essentially moved from [`send_transfer_proof`] to here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved from outgoing_transfer_proof_queue (renamed)
…n case of bmrng channel error
…Failure OutEvent type
…on timeout, dont retry on bmrng channel error
Nit: in cli/event_loop.rs we could unnest the error handling introduced in 3e457ed to match result {
Ok(..) => ...,
Err(bmrng::Error::TimeOutError) => ...,
Err(bmrng::Error::RecvError) => ...,
} Beyond that, I'm very excited we're cleaning up the network stack ;) |
adb9782
to
1a438fc
Compare
These bmrng channels are driving me insane.
|
Also, the crate hasn't been updated in 3 years. We could switch to a more maintained channel implementation and implement the (simple (the original crate is <100 lines)) request-response mechanism ourselves |
To be fair: It's a pretty simple crate. Not a lot to maintain. |
…m through event loop channel
…forward transfer proofs and encrypted signatures
46fbc94
to
58c2793
Compare
…perative xmr redeem requests. This is now handled by propagating network timeouts
…e tokio task which was used to forward transfer proof from one channel to another, send transfer proof directly to event loop channel
6343088
to
9ca133a
Compare
…te where it is clear we have already processed it
…gement to EventLoopHandler
Our libp2p version is out of date, and we need to tackle the upgrade even though it's a significant undertaking. This'll also fix some other issues.