-
Notifications
You must be signed in to change notification settings - Fork 9
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, reliable retry mechanisms #109
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)
This comment was marked as outdated.
This comment was marked as outdated.
@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
This comment was marked as outdated.
This comment was marked as outdated.
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: |
…ssed_transfer_proof
…network interface The reason for this is to ensure the asb does not crash if the websocket listen address is still present in the config file. Support for it has been removed.
a93e691
to
aec6bac
Compare
6e47bcb
to
f49396d
Compare
- Remove connection guards and channel timeout from request handling, dial directly - Implement retries for quote, swap setup and cooperative redeem requests. Max 60s timeout. Max interval 5s - Make NewSwap derive Clone to support retrying requests
f49396d
to
0163eab
Compare
- Remove redundant code - Only reset backoff interval when we connect
…r outbound connections
…enied by ConnectionHandler anyway
…109) 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](#95). - Breaking network protocol change: The libp2p version has been upgraded to 0.53 which includes breaking network protocol changes. ASBs and CLIs will not be able to swap if one of them is on the old version. - ASB: Transfer proofs will be repeatedly sent until they are acknowledged by the other party. This fixes a bug where it'd seem to Bob as if the Alice never locked the Monero. Forcing the swap to be refunded. - CLI: Encrypted signatures will be repeatedly sent until they are acknowledged by the other party - CLI+ASB: Libp2p network errors in request-response protocols are now propagated throught the event loop channels. This allows the caller to retry if an error occurs (e.g timeout) Closes #101, #95
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.
This PR includes the following changes:
Closes #101, #95