-
Notifications
You must be signed in to change notification settings - Fork 19
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
swapd: fee estimate from syncer (electrum) #533
Conversation
Codecov Report
@@ Coverage Diff @@
## main #533 +/- ##
=======================================
- Coverage 12.1% 12.1% -0.1%
=======================================
Files 34 34
Lines 10529 10573 +44
=======================================
Hits 1277 1277
- Misses 9252 9296 +44
Continue to review full report at Codecov.
|
The syncer is the one that is interacting externally, so we can't rely messages will be delivered in time. There are potential race conditions there, since we use Events to trigger actions in swapd (the sequence diagrams is the place to search for them). Especially at launch when too many messages are flying around.
As you probably know from the sequence diagrams, we do rely that for a given service bus, its msgs are received in the order they are sent.
And if there will be a race condition because one msg is being sent through Msg bus and the other through Ctl bus, then we have to put the two in the same bus, so that they're ordered correctly, and thus received in the correct order
…------- Original Message -------
On Monday, July 4th, 2022 at 10:56 PM, Reproducibility Matters ***@***.***> wrote:
@TheCharlatan commented on this pull request.
---------------------------------------------------------------
In [src/swapd/runtime.rs](#533 (comment)):
> +
+ // syncer takes too long to give a fee
+ std::thread::sleep(Duration::from_secs_f32(5.0));
+
The caching can be done, yes. Nevertheless it would be nice to not rely on the fee estimator to return in time. Do we make similar assumptions for other requests?
—
Reply to this email directly, [view it on GitHub](#533 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AIQJTBPTTQQUASOGWL66D3LVSNFXHANCNFSM52UD27IA).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Most of the tasks are While coding, one simplification that I did and that might still be around is, for example, that the act of sending a broadcast task actually broadcasts a tx. Haven't searched for those. |
9a2639b
to
b295c6c
Compare
So far, fee estimation happens only once, FIXME |
483ca52
to
a329856
Compare
discussion on handling bitcoin fees happened on #534 |
51630bb
to
5f47d2f
Compare
e1117ad
to
c71e7c9
Compare
From the logs:
Seems like the problem is when Bob is Maker, the swap daemon receives |
i had an embarrassing number of bugs -- hopefully this is the last |
The parallel swap test is failing now, no idea why, upon investigation it seems like 0.5 seconds are too fast for it. I bumped it to 2.0 and it is working again. |
|
i understand u guys dont want epsilon, but then how do i ensure all amounts are always exact at the sat or atomic unit level? reference from this discussion: #534 |
picked the dropped commits with epsilon for amounts, i know that is heavily objected, and the intend here is to move forward, not to challenge anyone those commits can be dropped or later reverted as far a another solution is provided |
i changed the epsilon to 2 sat or 2 pnero test for monero fixed, did not find test for btc |
@zkao , from which tests are these logs? Aren't they from the overfunding tests and therefore expected and correct behavior? The Bob incorrect funding test is here: https://github.com/farcaster-project/farcaster-node/blob/main/tests/functional-swap.rs#L75 Please state which test is failing because of these errors before proceeding.
In which scenario is the funding amount not exact right now? |
oh, thats great, there are parallel new error that i did not undertand, will drop commits |
have to understand what is wrong in bff0ec5 |
ah, it still is the syncer too late thingy |
i will add to pending requests, but i'd want a more general solution later |
43371ae
to
4b878f7
Compare
oh, boy, am i stupid, when syncer becomes online and triggers the pending requests, we already hit Msg::Reveal, too late not using pending request just left a longer sleep for bob maker to wait for the bitcoin syncer -- will grep sleep eventually and clean them all |
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.
Thank you for bearing through this one, I am happy we are this far now :)
No description provided.