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: extract basic account actor states #278

Merged
merged 5 commits into from
Dec 2, 2020

Conversation

alanshaw
Copy link
Member

@alanshaw alanshaw commented Nov 30, 2020

This PR enables Sentinel to persist state for the burnt funds actor without having to extract and persist data for ALL accounts.

It registers an AccountExtractor for the Account Actor CID and introduces the concept of a FilteredExtractor. If an extractor is a FilteredExtractor then processActor will call it's Filter method to see if it wants to extract data for a given actor.

At the moment the AccountExtractor is only interested in the burnt funds account and has no specialized extraction needs beyond what is automatically extracted by the common extractor. It means it's Extract method is basically a noop.

This PR adds an account actor extractor so that basic state is extracted for account actors.

@alanshaw alanshaw requested review from iand and frrist November 30, 2020 16:27
Copy link
Contributor

@iand iand left a comment

Choose a reason for hiding this comment

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

What's the advantage of this over simply extracting basic actor state and json for every actor? That step is very fast compared to parsing the actor state into separate tables.

@alanshaw
Copy link
Member Author

Extracting the basic state for all actors will have a time and storage cost and querying the table will become more difficult due to the amount of data.

Given sentinel's remit perhaps this is acceptable and necessary?

@frrist
Copy link
Member

frrist commented Nov 30, 2020

I would prefer to modify the ActorStateProcessor such that all actor types are extracted to the actor_state table.

querying the table will become more difficult due to the amount of data

Is this a hunch or have we observed this to be the case with the actor_state table?

@alanshaw
Copy link
Member Author

I've modified so that it collects basic state for all account actors.

type AccountExtractor struct{}

func init() {
Register(builtin.AccountActorCodeID, AccountExtractor{})
Copy link
Member

Choose a reason for hiding this comment

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

Register the account actor v1 codeID in addition to the v2 (this) one.

@alanshaw alanshaw changed the title feat: extract filtered account actors feat: extract basic account actor states Nov 30, 2020
@iand iand merged commit 8eca6ed into master Dec 2, 2020
@iand iand deleted the feat/extract-filtered-account-actors branch December 2, 2020 16:21
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.

3 participants