-
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:splitstore:retain tipset references in hot store #9960
Conversation
if pRef, err := tsRef(hdr.Parents); err != nil { | ||
return xerrors.Errorf("error computing cid reference to parent tipset") | ||
} else { | ||
if err := s.walkObjectIncomplete(pRef, visitor, fHot, stopWalk); err != nil { |
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.
Seems likely tipsets produced before nv18 won't retroactively get references added to the store so this is an incomplete walk.
8827fb0
to
8148783
Compare
Test failure is known unrelated |
@@ -905,6 +905,14 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp | |||
walkCnt := new(int64) | |||
scanCnt := new(int64) | |||
|
|||
tsRef := func(cids []cid.Cid) (cid.Cid, error) { |
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.
tsRef := func(cids []cid.Cid) (cid.Cid, error) { | |
tsRef := func(blkCids []cid.Cid) (cid.Cid, error) { |
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.
Just so it's a bit clearer what we're doing.
@@ -905,6 +905,14 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp | |||
walkCnt := new(int64) | |||
scanCnt := new(int64) | |||
|
|||
tsRef := func(cids []cid.Cid) (cid.Cid, error) { | |||
blk, err := types.NewTipSetKey(cids...).ToStorageBlock() |
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.
TipSetKey has a Cid() method you can call directly.
itests/splitstore_test.go
Outdated
e := check.Height() | ||
rawKey, err := check.Key().ToStorageBlock() | ||
require.NoError(t, err) | ||
checkRef := rawKey.Cid() |
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.
also directly Cid()
able, I think.
Related Issues
#9799
Proposed Changes
FEVM is introducing H(TipSetKey) to get a single blockhash to return in places where ethereum wants a single hash. This PR ensures that splitstore compaction will keep these cids pinned in the hotstore.
Additional Info
WIP as this still needs tests
Also I don't think we're actually writing tipset references to the chain store yet if I'm right about this we'll need to do that to actually test this out.
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