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

Rought PoST method #207

Merged
merged 6 commits into from
Sep 19, 2019
Merged

Rought PoST method #207

merged 6 commits into from
Sep 19, 2019

Conversation

Kubuxu
Copy link
Contributor

@Kubuxu Kubuxu commented Sep 18, 2019

No description provided.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
chain/actors/actor_miner.go Outdated Show resolved Hide resolved
@@ -247,11 +252,6 @@ func (sma StorageMinerActor) CommitSector(act *types.Actor, vmctx types.VMContex
return nil, aerrors.New(3, "not enough collateral")
}

// ensure that the miner cannot commit more sectors than can be proved with a single PoSt
if self.SectorSetSize >= POST_SECTORS_COUNT {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was removed from spec.

Copy link
Member

Choose a reason for hiding this comment

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

So, i chatted with @dignifiedquire.

This was removed from the spec because technically, rational post can handle an unlimited number of sectors. We agreed though that for practical purposes, there should be some limit (otherwise there are dos vectors with 'infinite' sized arrays of sectors being passed around, and other such nonsense).

Let's keep this code in for now, and file some spec issues to fix it up

Copy link

Choose a reason for hiding this comment

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

my take: there should be none with current construction, however we shouldn't assume so for future construction and backward compatibility, so we should pick a number

chain/actors/actor_miner.go Show resolved Hide resolved
chain/actors/actor_miner.go Outdated Show resolved Hide resolved
@@ -325,6 +413,10 @@ func (sma StorageMinerActor) SubmitPoSt(act *types.Actor, vmctx types.VMContext,
return nil, err
}

self.ProvingSet = self.Sectors
self.ProvingSetSize = self.SectorSetSize
Copy link
Member

Choose a reason for hiding this comment

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

Ah, we can drop the Size fields, the AMT tracks its own cardinality (the HAMT didnt)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is the Count field in AMT checked in any way so Eve can't change it at a whim?

Copy link
Member

@whyrusleeping whyrusleeping left a comment

Choose a reason for hiding this comment

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

Mostly LGTM, left some comments.

I'll write the AMT delete method and get back to you with that so we can use it here

}

var sectorInfos []sectorbuilder.SectorInfo
if err := pss.ForEach(func(id uint64, v *cbg.Deferred) error {
Copy link
Member

Choose a reason for hiding this comment

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

I'd pull this out into a separate function. Maybe we can dedupe some code with #205, can also do that later too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Problem is: either api or actor code (or both) would then have to convert types. API wants to use api.SectorInfo, chain wants to use sectorbuilder.SectorInfo.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
,
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

There are still some todos, but this moves us in the right direction

@Kubuxu Kubuxu merged commit 4b8461b into master Sep 19, 2019
@Kubuxu Kubuxu deleted the feat/post3 branch May 13, 2020 01:50
nonsense added a commit that referenced this pull request Nov 6, 2020
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