-
Notifications
You must be signed in to change notification settings - Fork 217
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
[ADP-3479] Amend wallet page to host wallet status #4865
Conversation
6a21e81
to
6c6d79a
Compare
bf9a4a7
to
bb8e1d7
Compare
6c6d79a
to
d0a4d38
Compare
d0a4d38
to
ec9bd83
Compare
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.
Very nice to have! Lgtm.
@@ -68,25 +68,30 @@ api :: Proxy API | |||
api = Proxy | |||
|
|||
server | |||
:: Tracer IO String | |||
:: Tracer IO () |
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.
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
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.
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 |
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.
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.
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.
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.
ADP-3479