-
Notifications
You must be signed in to change notification settings - Fork 3
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
perf: add pass tipset to StateMinerInfo
#105
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
Did you check with Glif how well they can cache
Filecoin.ChainHead
requests? If they cannot cache it easily, then we are just shifting the difficult to a different place, aren't we?Also, what do you think about obtaining the chain head on the spark-api side as part of the initialization of a new round? Such a solution would ensure that all checkers are querying the same version of the miner info.
What does
Filecoin.ChainHead
return? The documentation is not very clear:https://docs.filecoin.io/reference/json-rpc/chain#chainhead
If you need
Height
, then you can use the value found in round details, the property is calledstartEpoch
- no need to make another RPC call.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.
Good question, I have asked Glif about the performance implications of this.
During our colo I suggested moving the
StateMinerInfo
calls tospark-api
and you were against it as it was moving us towards centralization. How is this different here?Yes, I had to perform the actual call to see what's being returned.
res.Cids
is tipSet key you expect.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.
ChainHead
always costs 1 CU. UncachedStateMinerInfo
costs 8 CU, cached 1 CU. Therefore, with the cache and the extra call we are at a total of 2 CU, instead of the current 8 CUThere 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 see your point.
In the current design, spark-api is keeping track of the rounds managed by the smart contract, and records the block number when a new round started. I am suggesting to rework that part to not only record the block number, but also the tipset CIDs.
That way, we preserve the current level of (de)centralisation.
That's a meaningful improvement 👍🏻
It may be good enough for the first iteration.
Having said that, I have an idea to try: how about using ChainGetTipSetByHeight?
ChainGetTipSetByHeight
with the block height (block number) of when the Spark round started.