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

storage module: add go docs and minor code quality refactors #6259

Merged
merged 13 commits into from
May 20, 2021

Conversation

raulk
Copy link
Member

@raulk raulk commented May 14, 2021

This absorbs #2340. Refer to the commit log for details.

chain/store/store.go Outdated Show resolved Hide resolved
storage/wdpost_run.go Outdated Show resolved Hide resolved
storage/wdpost_run.go Outdated Show resolved Hide resolved
@raulk
Copy link
Member Author

raulk commented May 14, 2021

@nonsense comments addressed!

Copy link
Contributor

@dirkmc dirkmc left a comment

Choose a reason for hiding this comment

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

A couple of nits but in general looks good 👍

chain/store/store.go Outdated Show resolved Hide resolved
adaptedAPI = NewSealingAPIAdapter(m.api)

// Instantiate a precommit policy.
defaultDuration = policy.GetMaxSectorExpirationExtension() - (md.WPoStProvingPeriod * 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest adding a comment to explain this calculation

pcp = sealing.NewBasicPreCommitPolicy(adaptedAPI, defaultDuration, provingBoundary)

// address selector.
as = func(ctx context.Context, mi miner.MinerInfo, use api.AddrUse, goodFunds, minFunds abi.TokenAmount) (address.Address, abi.TokenAmount, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest adding a comment explaining what the address selector does

@@ -833,6 +879,8 @@ func (s *WindowPoStScheduler) setSender(ctx context.Context, msg *types.Message,
minGasFeeMsg.GasFeeCap = msg.GasFeeCap
}

// goodFunds = funds needed for optimal inclusion probability.
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 👍

Co-authored-by: dirkmc <dirkmdev@gmail.com>
Comment on lines +47 to +49
// This object is the owner of the sealing pipeline. Most of the actual logic
// lives in the storage-sealing module (sealing.Sealing), and the Miner object
// exposes it to the rest of the system by proxying calls.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is mostly tech debt, but it's really tricky to untangle storage-sealing from this object, which is why it's here

@magik6k magik6k merged commit 5f2e163 into master May 20, 2021
@magik6k magik6k deleted the raulk/docs-storage branch May 20, 2021 19:42
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