Skip to content

Commit

Permalink
fix: Upgrade rust-dlc dependency
Browse files Browse the repository at this point in the history
Drop pending `Accept` and `CloseAccept` messages after peer disconnects.
  • Loading branch information
holzeis committed Aug 28, 2023
1 parent e9bdf05 commit 5ec59d2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 24 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

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

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ resolver = "2"

[patch.crates-io]
# We should usually track the `feature/ln-dlc-channels[-10101]` branch
dlc-manager = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "22b7052" }
dlc-messages = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "22b7052" }
dlc = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "22b7052" }
dlc-sled-storage-provider = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "22b7052" }
p2pd-oracle-client = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "22b7052" }
dlc-trie = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "22b7052" }
simple-wallet = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "22b7052" }
dlc-manager = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "fe7cfa3d2de7d3414b21c1bbd58932d2d83191c5" }
dlc-messages = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "fe7cfa3d2de7d3414b21c1bbd58932d2d83191c5" }
dlc = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "fe7cfa3d2de7d3414b21c1bbd58932d2d83191c5" }
dlc-sled-storage-provider = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "fe7cfa3d2de7d3414b21c1bbd58932d2d83191c5" }
p2pd-oracle-client = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "fe7cfa3d2de7d3414b21c1bbd58932d2d83191c5" }
dlc-trie = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "fe7cfa3d2de7d3414b21c1bbd58932d2d83191c5" }
simple-wallet = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "fe7cfa3d2de7d3414b21c1bbd58932d2d83191c5" }

# We should usually track the `split-tx-experiment[-10101]` branch
lightning = { git = "https://github.com/p2pderivatives/rust-lightning/", rev = "420d961d" }
Expand Down
13 changes: 3 additions & 10 deletions crates/ln-dlc-node/src/tests/dlc/dlc_setup_with_reconnects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,18 +541,14 @@ async fn can_lose_connection_before_processing_subchannel_accept() {
app.reconnect(coordinator.info).await.unwrap();

// Process the app's `Accept` and send `Confirm`
// Invalid state: Misuse error: Invalid commitment signed: Close : Invalid commitment tx
// signature from peer
let result = wait_until_dlc_channel_state(
wait_until_dlc_channel_state(
Duration::from_secs(30),
&coordinator,
app.info.pubkey,
SubChannelStateName::Confirmed,
)
.await;

assert!(result.is_err());
tracing::error!("{:#}", result.err().unwrap());
.await
.unwrap();

// Create `Accept` message from pending `ReAccept` Action
sub_channel_manager_periodic_check(app.sub_channel_manager.clone(), &app.dlc_message_handler)
Expand Down Expand Up @@ -580,7 +576,6 @@ async fn can_lose_connection_before_processing_subchannel_accept() {
.unwrap();

// Process the app's `Finalize` and send `Revoke`
// This will panic: Commitment txids are unique outside of fuzzing, where hashes can collide
wait_until_dlc_channel_state(
Duration::from_secs(30),
&coordinator,
Expand Down Expand Up @@ -672,8 +667,6 @@ async fn can_lose_connection_before_processing_subchannel_close_accept() {
.unwrap();

// Process `CloseAccept` and send `CloseConfirm`
// Invalid state: Misuse error: Invalid commitment signed: Close : Invalid commitment tx
// signature from peer
wait_until_dlc_channel_state(
Duration::from_secs(30),
&coordinator,
Expand Down

0 comments on commit 5ec59d2

Please sign in to comment.