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
Introduce caching of PowerTable CIDs #784
Introduce caching of PowerTable CIDs #784
Changes from all commits
4bb99f0
302fbdb
e800ac7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 36 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L35-L36
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 would return an error based on the principle that panics should be used rarely. I understand there are pre-existing practices in this repo on use of panic. So not a blocker for me.
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 is a pet peeve of mine not to introduce errors, especially in constructors, when they cannot happen.
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.
How big do tipset keys get? do we want to hash these?
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.
on expectation ~5x the hash size
Check warning on line 63 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L62-L63
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 function would collect the entire chain that could be finalised irrespective of max chain length of 100. Right?
Specifically, during bootstrap this function would, at best, collect a chain of 900, then a chain of 800, 700, and so on even though each instance would only use at most 100 tipsets of the returned chain as proposal.
Is that the most efficient we can be here? How fast/expensive is
GetParent
?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 isn't that expensive in comparison to getting the power table, it could be more efficient but it is tricky given null rounds.
Check warning on line 81 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L77-L81
Check warning on line 86 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L85-L86
Check warning on line 111 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L110-L111
Check warning on line 117 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L116-L117
Check warning on line 124 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L123-L124
Check warning on line 128 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L127-L128
Check warning on line 133 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L132-L133
Check warning on line 152 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L151-L152
Check warning on line 167 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L166-L167
Check warning on line 173 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L172-L173
Check warning on line 178 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L177-L178
Check warning on line 197 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L196-L197
Check warning on line 202 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L201-L202
Check warning on line 208 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L207-L208
Check warning on line 215 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L214-L215
Check warning on line 225 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L224-L225
Check warning on line 232 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L231-L232
Check warning on line 237 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L236-L237
Check warning on line 240 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L239-L240
Check warning on line 251 in consensus_inputs.go
Codecov / codecov/patch
consensus_inputs.go#L250-L251