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

[ADP-3479] Amend wallet page to host wallet status #4865

Conversation

paolino
Copy link
Collaborator

@paolino paolino commented Dec 6, 2024

  • Add wallet status to wallet page
  • Add wallet tip tracer

ADP-3479

@paolino paolino changed the title Paolino/ADP-3479/amend-wallet-page-to-host-wallet-status [ADP-3479] Amend wallet page to host wallet status Dec 6, 2024
@paolino paolino force-pushed the paolino/ADP-3479/amend-wallet-page-to-host-wallet-status branch from 6a21e81 to 6c6d79a Compare December 6, 2024 08:40
@paolino paolino self-assigned this Dec 6, 2024
@paolino paolino added Deposit UI UI related changes labels Dec 6, 2024
@paolino paolino force-pushed the paolino/ADP-3479/add-payment-page branch from bf9a4a7 to bb8e1d7 Compare December 6, 2024 08:55
@paolino paolino force-pushed the paolino/ADP-3479/amend-wallet-page-to-host-wallet-status branch from 6c6d79a to d0a4d38 Compare December 6, 2024 08:56
@paolino paolino force-pushed the paolino/ADP-3479/amend-wallet-page-to-host-wallet-status branch from d0a4d38 to ec9bd83 Compare December 6, 2024 10:13
Copy link
Member

@Anviking Anviking left a comment

Choose a reason for hiding this comment

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

Very nice to have! Lgtm.

@@ -68,25 +68,30 @@ api :: Proxy API
api = Proxy

server
:: Tracer IO String
:: Tracer IO ()
Copy link
Member

@Anviking Anviking Dec 6, 2024

Choose a reason for hiding this comment

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

Was curious: did you consider using TVar IO () or I guess TVar IO WalletState? (edit: meant to be used as STM () or STM WalletState, yes, probably that's the better spelling of them)

And taking the latter one step further, we get the question whether we could have DBVar STM WalletState instead of in IO 🤔 cc @HeinrichApfelmus

Copy link
Collaborator Author

@paolino paolino Dec 6, 2024

Choose a reason for hiding this comment

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

For the way it is used ATM, the STM composability is not a requirement. We are serving this signal as a long poll over the network. It's also dangerous for the signal producer which could get stuck (in theory) by other concurrent producers. STM () could be better ? But I would not dig into that until we have a real need.
About dangers IIRC there is a fan out in the code that ensure the tracer never locks at the expense of dropping events.

@@ -228,7 +234,7 @@ withWalletDBVar
[ walletTip
, Read.GenesisPoint
]
, rollForward = rollForward w
, rollForward = rollForward w wtc
, rollBackward = rollBackward w
Copy link
Member

Choose a reason for hiding this comment

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

For the sake of showing sync progress this is probably what we want (or practically what we want), but techincally the rollBackward would also update the wallet tip.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes I cut that corner for the demo. I feel like we can keep it like this for now.

For the sake of showing sync progress this is probably what we want (or practically what we want), but techincally the rollBackward would also update the wallet tip.

@abailly abailly merged commit 5718b41 into paolino/ADP-3479/add-payment-page Dec 9, 2024
24 checks passed
@abailly abailly deleted the paolino/ADP-3479/amend-wallet-page-to-host-wallet-status branch December 9, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deposit UI UI related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants