-
Notifications
You must be signed in to change notification settings - Fork 23
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
ChainSync client: simplify a correctness argument #222
Conversation
For direct reference, the comments from IntersectMBO/ouroboros-network#4313:
|
...boros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/MiniProtocol/ChainSync/Client.hs
Outdated
Show resolved
Hide resolved
We introduce a small generic helper function `cross` whose correctness follows immediately from the guarantees of `AF.intersect`; removing the need for ad-hoc inline justifications. Note that this change improves sharing when multiple ChainSync clients maintain candidate fragments that are (small) extensions of our selection. A priori, this is contrary to our design principle of "average case = worst case", but we think the effect is sufficiently small compared to the overall resource usage of a node in order to influence an SPO to downgrade their node due to this. Concretely, a Cardano header has a maximum size of `1.1 kB`, and `ourPre` contains at most `k = 2160` headers, so we get a maximum size decrease of 1.1 kB × 2160 × 100 = 237.6 MB very conservatively assuming 100 ChainSync clients. Co-authored-by: Alexander Esgen <alexander.esgen@iohk.io>
4645ec4
to
5be9544
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.
We reviewed this in a call, and agree that it makes sense, and that the increased sharing in a good case is unlikely to be significant, especially compared to the ledger state.
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 local definition is a good balance 👍
This is a single-commit PR; see its message.
Migrated from IntersectMBO/ouroboros-network#4313