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: add power actor claim extraction #172

Merged
merged 1 commit into from
Nov 3, 2020
Merged

Conversation

frrist
Copy link
Member

@frrist frrist commented Oct 29, 2020

What

This PR does the following:

  • adds a power_actor_claims table to track claimed power by all miners in the power actor's state.
  • updates power_test.go and mock api to work with power actor changes.
  • shares power actor extractor logic with genesis task

closes #171
blocked on filecoin-project/lotus#4628

@frrist frrist self-assigned this Oct 29, 2020
@frrist frrist force-pushed the frrist/power-claims-171 branch 2 times, most recently from 2001886 to e187f93 Compare November 2, 2020 19:33

prevState := curState
if a.Epoch != 0 {
prevActor, err := node.StateGetActor(ctx, a.Address, a.ParentTipSet)
Copy link
Contributor

Choose a reason for hiding this comment

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

has this been fixed in lotus to not be a VM run?

Copy link
Member Author

Choose a reason for hiding this comment

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

🤮 ughh probably not. This isn't an issue for the API lens (since lotus has a cache) but it will be expensive in the repolens, thanks for catching this.

Is the canonical way of dealing with this to load the state tree like this?

Copy link
Contributor

Choose a reason for hiding this comment

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

for consistency that seems like a good plan

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd like to avoid implementing this logic everywhere we call StateGetActor and have filed #196 to track/eventually address this concern. I propose we address this as a fix for #196, thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

i'm fine with that

@frrist frrist merged commit dede63b into master Nov 3, 2020
@frrist frrist deleted the frrist/power-claims-171 branch November 3, 2020 22:47
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.

Extract Power Actor Claimed Power HAMT
2 participants