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

Discussion for swap-cli progress <ID> #274

Closed
h4sh3d opened this issue Dec 1, 2021 · 2 comments · Fixed by #761
Closed

Discussion for swap-cli progress <ID> #274

h4sh3d opened this issue Dec 1, 2021 · 2 comments · Fixed by #761
Labels
client discussion Topic to share or discuss before moving ahead

Comments

@h4sh3d
Copy link
Member

h4sh3d commented Dec 1, 2021

In progress I propose that we show these events:

  • When a protocol step has been crossed (i.e. state transitions)
  • When waiting on a transaction
  • When a transaction we were waiting on is "final"
  • When we need to introduce coin in the system (address and amount in BTC/XMR)

Below I tried to do an example for alice and bob

For Alice role:

Swap starting...
State transition: AliceState(Start) -> AliceState(Commit)
State transition: AliceState(Commit) -> AliceState(Reveal)
State transition: AliceState(Reveal) -> AliceState(RefundProcSigs)
Waiting for locking BTC...
Bitcoin locked!
Funding required: send 0.001000000000 XMR to 55GAd9ddNjKRAyi74PwhTKXkhyfDwvVmTGh7NTNHsaA2BfwShd5v8VHPWJaKuKNJYFJwvEx5nZ6fiMr4BC6UkoPzHjryVNK
Waiting for locking XMR...
XMR locked!
State transition: AliceState(RefundProcSigs) -> AliceState(Finish)
Success: swapped BTC received at address tb1q9az0e0w67y33md3l58jwwvq7d3jan2xqspmcga

For Bob role:

Swap starting...
State transition: BobState(Start) -> BobState(Commit)
Funding required: send 0.00001500 BTC to tb1qx78xnxj4wxjgy28cvs6v6f7an9cgcxh8ps446r
Waiting for funding...
Funding seen!
State transition: BobState(Commit) -> BobState(Reveal)
State transition: BobState(Reveal) -> BobState(CoreArb)
Waiting for locking BTC...
Bitcoin locked!
Waiting for locking XMR...
XMR locked!
State transition: BobState(CoreArb) -> BobState(BuyProcSig)
State transition: BobState(BuyProcSig) -> BobState(Finish)
Success: swapped XMR received at address 56DzEiq4m8u4CYViSD2YdSUXmHKLninnZKDwsmYsz1e1RsbYrF5qcTjZ7ey9f1hQ4wjJ1D4B8rNMZD7J9YH8zbjoVrwjcnK

Do we need maker/taker to be mentioned in these logs?

EDIT: Integrating improvments from @TheCharlatan #274 (comment)

@TheCharlatan
Copy link
Member

TheCharlatan commented Dec 1, 2021

I'm happy with the flow, but some small improvements that I would suggest:

  1. Add a message to describe the final state (e.g. was it a success, refund, cancel)
  2. Put the funding address and amount on the same line
  3. The "parameter" messages are ugly -> Remove, only add a message if something goes wrong
  4. The first message does not contain much useful information for the user -> Remove swapid and peer id, just indicate that it is starting
  5. Generating swap transactions also does not provide useful information -> Remove, only add a message if something goes wrong here

@h4sh3d h4sh3d added the discussion Topic to share or discuss before moving ahead label Dec 5, 2021
@zkao zkao added the client label Jan 17, 2022
@Lederstrumpf
Copy link
Member

bumping up this old discussion: should integrate the new trade state machine into the progress output. I'd suggest that the high level is represented by the trade state machine state, and then in case the swap is running, we currently show the swap progress as currently done (and then migrate this too once swapd has a comparable finite state machine implementation)

@TheCharlatan TheCharlatan linked a pull request Nov 8, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client discussion Topic to share or discuss before moving ahead
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants