-
Notifications
You must be signed in to change notification settings - Fork 107
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
2. change(state): Run AwaitUtxo read requests without shared mutable chain state #5107
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5107 +/- ##
==========================================
- Coverage 79.35% 79.29% -0.06%
==========================================
Files 307 307
Lines 39259 39323 +64
==========================================
+ Hits 31153 31181 +28
- Misses 8106 8142 +36 |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
721f6ec
to
b3257a7
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
b3257a7
to
cb0b6b2
Compare
This comment was marked as outdated.
This comment was marked as outdated.
I'm running a full sync and a checkpoint sync here: |
I did a full sync and an update sync locally:
|
I'm running a full sync here, but we don't need to wait for it before we merge this PR: |
2a044fc
to
097a4c6
Compare
```sh fastmod Utxos AddressUtxos zebra* ```
```sh fastmod transparent_utxos address_utxos zebra* ```
And move repeated comments to the module header.
097a4c6
to
019a75a
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.
All looks good. I left some minor comments.
Motivation
This PR runs
StateService::AwaitUtxo
read requests without accessing shared mutable chain state.As a useful side-effect, this makes all
StateService
read requests concurrent.Closes #5102.
Designs
See #4937 and https://docs.google.com/drawings/d/1FXpAUlenDAjl8nkftrypdAPsj0jr-Ut9gZlSP57nuyc/edit
Solution
Don't access shared mutable chain state in
StateService
read requests:AwaitUtxo
without accessing shared mutable chain state, usingStateService.pending_utxos
andReadStateService::AnyUtxo
NonFinalizedState
to theReadStateService
ChainUtxo
request toBestChainUtxo
AnyChainUtxo
requestRelated documentation:
Related Cleanups:
AwaitUtxos
next to the other shared writeable state requestsReadResponse::Utxos
toReadResponse::AddressUtxos
out_point
variable tooutpoint
for consistencytransparent_utxos
toaddress_utxos
QueuedBlock
type into thequeued_blocks
moduleTesting
We should run a full sync on this before we merge, and make sure it is not significantly slower than the
main
branch.Review
This PR is part of regular scheduled work.
Reviewer Checklist
Follow Up Work
Actually create a separate task to commit blocks to the state.