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

feat(rpc): add StateMinerInitialPledgeForSector method #5096

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

virajbhartiya
Copy link
Contributor

Summary of changes

Changes introduced in this pull request:

  • Implements StateMinerInitialPledgeForSector

Reference issue to close (if applicable)

Closes #4907

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

@virajbhartiya virajbhartiya requested a review from a team as a code owner December 18, 2024 06:03
@virajbhartiya virajbhartiya requested review from lemmih and elmattic and removed request for a team December 18, 2024 06:03
@elmattic
Copy link
Contributor

I don't see the different checks that Lotus is doing:

	if sectorDuration <= 0 {
		return types.EmptyInt, xerrors.Errorf("sector duration must greater than 0")
	}
	if sectorSize == 0 {
		return types.EmptyInt, xerrors.Errorf("sector size must be non-zero")
	}
	if verifiedSize > uint64(sectorSize) {
		return types.EmptyInt, xerrors.Errorf("verified size must be less than or equal to sector size")
	}

Don't we need them?

@virajbhartiya
Copy link
Contributor Author

@elmattic added these checks

src/rpc/methods/state.rs Outdated Show resolved Hide resolved
src/rpc/methods/state.rs Outdated Show resolved Hide resolved
src/rpc/methods/state.rs Outdated Show resolved Hide resolved
…on in StateMinerInitialPledgeForSector method
…parameters calculation in StateMinerInitialPledgeForSector method
src/rpc/methods/state.rs Outdated Show resolved Hide resolved
src/rpc/methods/state.rs Outdated Show resolved Hide resolved
src/rpc/methods/state.rs Outdated Show resolved Hide resolved
src/rpc/methods/state.rs Outdated Show resolved Hide resolved
@elmattic
Copy link
Contributor

lgtm. Just a lint error to fix for the CI to pass successfully.

@virajbhartiya
Copy link
Contributor Author

@lemmih can you please take a look once

@elmattic
Copy link
Contributor

elmattic commented Dec 20, 2024

) -> Result<(ChainEpoch, u64), anyhow::Error> { 
                                               ^
                                               |
 There is a trailing space here, please enable format on save in your editor

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.

Implement StateMinerInitialPledgeForSector
2 participants