-
Notifications
You must be signed in to change notification settings - Fork 629
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
docs: Describe congestion fundamentals #10873
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #10873 +/- ##
==========================================
- Coverage 71.53% 71.52% -0.01%
==========================================
Files 759 759
Lines 151627 151627
Branches 151627 151627
==========================================
- Hits 108467 108456 -11
- Misses 38671 38678 +7
- Partials 4489 4493 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Fantastic explanation and I love the idea to present it as flow graphs!
But this is not ideal Just consider this example where everybody tries to access | ||
a contract on the same shard. | ||
|
||
![graph](../../images/congestion/receipt_flow_example_1.svg) |
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.
Depending on how it's interpreted the graph may also need a 999 Tgas arrow from shard 3 to itself and then the arrow to sink should be 2997 Tgas.
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.
Same for the graph below.
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.
I agree for the arrow shard3 -> shard3. But I think it should still be 2998 Tgas. Otherwise the sum of flows from the source is not equal to the sum to the sinks. It would be 2997 Tgas for the receipts and 1 Tgas for conversion, both should point to sink, showing that the gas has been burnt.
I'm adding the arrows to the two graphs as best as I can without it getting too unreadable... Aligning things isn't always easy in graphviz graphs^^
The sad thing is, there is no way around it in the most general case. A | ||
congestion control strategy that does apply this limit to this workload will | ||
always have infinitely sized queues. |
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.
It's the other way around, a strategy that accepts more than this limit will have unbounded queues.
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.
Right^^ I think a "not" went missing somewhere, I'll add one to correct it.
This document describes a few fundamental congestion control problems and ideas to solve them.
The added page serves as secondary document to NEP to summarise the thought process behind the most important design decisions. But it is generally applicable to congestion in Near Protocol's receipt execution system as it works today. It can even serve as documentation for how congestion can occur today.
The document includes 8 graphs generated using graphviz.
To regenerate after modifying the
*.dot
files, install the graphviz toolbox (on systems with apt:sudo apt install graphviz
) and then rundot -Tsvg img_name.dot > img_name.svg
.