-
Notifications
You must be signed in to change notification settings - Fork 549
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
Introduce and use Sink abstraction #9962
Conversation
}) ; | ||
Mina_net2.Validation_callback.set_message_type valid_cb `Block ; | ||
Mina_metrics.(Counter.inc_one Network.Block.received) ; | ||
notify_online ()) |
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.
Is it fine to run notify_online
without don't_wait_for
?
Can it produce a stale-lock?
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.
The pipe being written to under the hood of Broadcast_pipe
is an Async.Pipe
which is consumed with pushback. This means that the write call will block until a reader picks up the value and finishes processing it. I would just put a don't_wait_for
here to be safe because it's possible this could produce a stale lock in some conditions.
7eee16c
to
f175181
Compare
a4a61bf
to
0379e2f
Compare
0379e2f
to
051daba
Compare
}) ; | ||
Mina_net2.Validation_callback.set_message_type valid_cb `Block ; | ||
Mina_metrics.(Counter.inc_one Network.Block.received) ; | ||
notify_online ()) |
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.
The pipe being written to under the hood of Broadcast_pipe
is an Async.Pipe
which is consumed with pushback. This means that the write call will block until a reader picks up the value and finishes processing it. I would just put a don't_wait_for
here to be safe because it's possible this could produce a stale lock in some conditions.
src/lib/network_pool/pool_sink.ml
Outdated
let cb' = Msg.convert_callback cb in | ||
match%bind verify_impl ~logger ~trace_label pool rl env' cb' with | ||
| None -> | ||
(* TODO log unverified? *) |
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.
This TODO needs to be resolved.
243a1f4
to
74c7103
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.
LGTM. My last piece of feedback is that I'm not sure that block_sink.ml lives in a logical location right now (it's currently in the network_pool library, which currently contains snark and txn pool code, but not block code). Perhaps mina_transition (where blocks are defined) or transition_handler (where incoming blocks are processed) makes more sense.
f7fdd16
to
de25253
Compare
Problem: there are a few layers of pipes that are used between sites of pubsub message receival and pubsub message processing. These layers complicate reasoning about code and impose an unnecessary additional load onto Async scheduler. Solution: introduce a Sink abstraction and use it to handle all gossips.
de25253
to
b8a521c
Compare
aaf2dc5
to
b227493
Compare
Problem: during refactoring, tx pool and snark pool metrics were not updated properly. Solution: update metrics as needed.
5a5bd5e
to
42843d7
Compare
Problem: there are a few layers of pipes that are used between sites of
pubsub message receival and pubsub message processing. These layers
complicate reasoning about code and impose an unnecessary additional load
onto Async scheduler.
Solution: introduce a Sink abstraction and use it to handle all gossips.
Explain your changes:
Explain how you tested your changes:
Checklist: