Skip to content
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

export range and small refactor #8640

Closed

Conversation

zengroundumbass
Copy link
Contributor

Related Issues

Proposed Changes

Hello I want to snapshot some but not a big amount of the chain! It should be in a range

I think this will be a good way to do it Please help me make it possible

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

  • All commits have a clear commit message.
  • The PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, test
    • area: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps
  • This PR has tests for new functionality or change in behaviour
  • If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or Discussion Tutorials.
  • CI is green

@travisperson
Copy link
Contributor

Please see #8641

Copy link
Contributor

@arajasek arajasek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! @travisperson's proposal in #8641 is different from this in a few ways:

  • the proposal has the method taking TSKs instead of heights
  • the proposal requests an option to also include message receipts.

Are these things you would be open to including in this PR?

@@ -23,6 +23,20 @@ func (cs *ChainStore) UnionStore() bstore.Blockstore {
}

func (cs *ChainStore) Export(ctx context.Context, ts *types.TipSet, inclRecentRoots abi.ChainEpoch, skipOldMsgs bool, w io.Writer) error {
pleaseVisit := func(b types.BlockHeader) bool {
return b.Height > ts.Height()-inclRecentRoots
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's redundantly also check that b.Height isn't greater than ts.Height() (and return false if it is)

@rjan90
Copy link
Contributor

rjan90 commented Sep 10, 2024

Closing as outdated. Zen is not a dumbass

@rjan90 rjan90 closed this Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants