Skip to content
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

Handle Results of waiting for timelocks to expire #705

Merged
merged 3 commits into from
Sep 1, 2021
Merged

Conversation

da-kami
Copy link
Member

@da-kami da-kami commented Aug 30, 2021

Fixes an issue where the CLI is transitioning into a CancelTimelockExpired state but the timelock is actually not expired yet.
This happened because watching for confirmations errored and the error was not handled but the same behaviour as reaching the cancel timelock height was applied.

For now this PR will fail the execution in case of the block height watching logic failing. Eventually there should be a more resilient strategy that includes retries.

Copy link
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Can we either remove this TODO or do something else about it?

swap/src/protocol/bob/swap.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a changelog entry.

@da-kami
Copy link
Member Author

da-kami commented Aug 30, 2021

@rishflab please take this one over

@rishflab rishflab linked an issue Aug 31, 2021 that may be closed by this pull request
@rishflab rishflab marked this pull request as ready for review August 31, 2021 05:55
@rishflab
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Aug 31, 2021
705: Handle Results of waiting for timelocks to expire r=rishflab a=da-kami

Fixes an issue where the CLI is transitioning into a `CancelTimelockExpired` state but the timelock is actually not expired yet. 
This happened because watching for confirmations errored and the error was not handled but the same behaviour as reaching the cancel timelock height was applied.

For now this PR will fail the execution in case of the block height watching logic failing. Eventually there should be a more resilient strategy that includes retries. 

Co-authored-by: Daniel Karzel <daniel@comit.network>
Co-authored-by: rishflab <rishflab@hotmail.com>
CHANGELOG.md Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors bot commented Aug 31, 2021

@thomaseizinger
Copy link
Contributor

@rishflab one of the tests in bors failed. Could take this opportunity to fixup the commits now that we have to retrigger anyway.

@rishflab
Copy link
Member

@rishflab one of the tests in bors failed. Could take this opportunity to fixup the commits now that we have to retrigger anyway.

im on it. It was Monero again

@rishflab rishflab force-pushed the cancel-result-fix branch 4 times, most recently from c7480f8 to 8c0a827 Compare August 31, 2021 08:05
da-kami and others added 3 commits August 31, 2021 18:26
Probably a failure when interacting with the electrum node to get script
 status updates
Bob was timing out if the encrypted signature could not be sent in 60
seconds. This behaviour is unnecessary because we are racing against
the cancel timelock anyway. By timing out before this, we remove the
opportunity for bob and alice to re-establish a connection.
@thomaseizinger
Copy link
Contributor

Thanks for improving the commits!

@rishflab
Copy link
Member

rishflab commented Sep 1, 2021

bors r+

@bors bors bot merged commit a27048c into master Sep 1, 2021
@bors bors bot deleted the cancel-result-fix branch September 1, 2021 00:23
@rishflab rishflab linked an issue Sep 2, 2021 that may be closed by this pull request
rishflab added a commit that referenced this pull request Sep 2, 2021
We were not thorough enough in PR #705 and there were some remaining
unhandled errors.
rishflab added a commit that referenced this pull request Sep 2, 2021
We were not thorough enough in PR #705 and there were some remaining
unhandled errors.
rishflab added a commit that referenced this pull request Sep 2, 2021
We were not thorough enough in PR #705 and there were some remaining
unhandled errors.
rishflab added a commit that referenced this pull request Sep 2, 2021
We were not thorough enough in PR #705 and there were some remaining
unhandled errors.
rishflab added a commit that referenced this pull request Sep 2, 2021
We were not thorough enough in PR #705 and there were some remaining
unhandled errors.
rishflab added a commit that referenced this pull request Sep 2, 2021
We were not thorough enough in PR #705 and there were some remaining
unhandled errors.

Co-authored-by: Daniel Karzel <daniel@comit.network>
bors bot added a commit that referenced this pull request Sep 2, 2021
724: Handle errors when waiting for subscriptions r=rishflab a=rishflab

We were not thorough enough in PR #705 and there were some remaining
unhandled errors.

Co-authored-by: rishflab <rishflab@hotmail.com>
@rishflab rishflab linked an issue Sep 5, 2021 that may be closed by this pull request
@rishflab rishflab linked an issue Sep 6, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants