-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: syncer: optimize syncFork for one-epoch forks #11533
Conversation
} | ||
|
||
if commonParent { | ||
// known contains at least one of incoming's Parents => the common ancestor is known's Parents (incoming's Grandparents) |
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.
Pretty sure this is a typo, as I parse it we only have the guarantee about common grandparents
// known contains at least one of incoming's Parents => the common ancestor is known's Parents (incoming's Grandparents) | |
// known contains at least one of incoming's Parents => the common ancestor is known's Grandparents (also incoming's Grandparents) |
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 logic does appear to be correct tho)
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.
@magik6k No, I don't think this is right? The logic in 891-895 is checking whether incoming.Parents()
has any blocks in common with known
(so known = {A,B,C,D}
in your diagram).
Merging cuz the only outstanding discussion is about a comment, but happy to revisit. |
feat: syncer: optimize syncFork for one-epoch forks
feat: syncer: optimize syncFork for one-epoch forks
Related Issues
Towards #11530 (comment)
Logging and analysis have shown that nearly 100% of calls to syncFork are for a very specific case: when
incoming.Parents() ⊂ known
. Currently, we fetch 900 tipsets in this case. We actually need to fetch ZERO.Proposed Changes
Check if there are any common blocks between
known
andincoming.Parents()
. If there are, we simply need to return [incoming.Parents, incoming]. We know we already haveincoming
, so we just needincoming.Parents
. We now check our local store to fetchincoming.Parents
(which according to experiments we almost always do), and if we don't we fallback onto the network requesting the ONE tipset.Additional Info
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, testarea
, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps