Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat(congestion): write stats to a csv file #10719
feat(congestion): write stats to a csv file #10719
Changes from 5 commits
d8653a7
199c684
3cce98b
30ccf14
043cdca
300f8b6
bf3c46f
55b9873
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 this still needed, or just an artefact from previous code iterations? If it's not necessary, I'd prefer this to stay private.
Making it
pub
is okay for our little model if it makes things easier. But generally speaking, it breaks the intended type safety. While the value is private, we can guarantee thatShardId
can only be created inside this file. So it's easy to check invariants on it. That's about halve the motivation for wrapping theusize
in a new type. It's the same pattern I used forQueueId
,TransactionId
, andReceiptId
.If you just need read-only access to the number, adding a simple getter method, or maybe
impl From<ShardId> for usize {}
or evenimpl Deref for ShardId { type Target = usize }
could do the trick without breaking type properties but still allows reading the number withid.into()
or*id
, which seems just as convenient asid.0
.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.
What the heck is mailbox? :)
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.
Borrowed vocabulary from the actor model
https://www.brianstorti.com/the-actor-model/
The model basically treats each shard as an actor and the implicit incoming receipts queue is the actor's mailbox. And that's no coincidence. I always like to map problems to solutions that already exist.
Not only is the model implemented this way, I think even the real implementation can be thought of this way. Taking inspiration from Erlang, Akka, Actix, and other established actor frameworks could be useful. But it's also quite limited since they generally react to full queues by dropping messages / returning failures (which I still think we can avoid) and they don't operate on a global round-based clock that the blockchain has thanks to block heights. I think those are the main differences in constraints.
Anyway, sorry for the off-topic rambling... "mailbox" as the queue name makes sense in my mind but open to other names :)