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

fix(events): load actor from tipset state, not parent state #11945

Draft
wants to merge 1 commit into
base: masih/events-index-by-id
Choose a base branch
from

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Apr 30, 2024

PR against #11723 to load state of current tipset instead of parent.

Comment on lines 121 to 132
ts, err := sa.Chain.GetTipSetFromKey(ctx, ev.TipSetKey)
if err != nil {
return nil, xerrors.Errorf("loading tipset: %w", err)
}
stateRoot, _, err := sa.StateManager.TipSetState(ctx, ts)
if err != nil {
return nil, xerrors.Errorf("loading tipset state: %w", err)
}
actor, err := sa.StateManager.LoadActorRaw(ctx, emitterAddr, stateRoot)
Copy link
Member Author

Choose a reason for hiding this comment

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

this is the relevant section that I'm testing out

The problem with sa.StateGetActor(tsk) is that it it loads ParentState but the event may arise from a tipset where the actor id was first introduced, so we fail with an "unknown actor" error. But if we fast-forward by one then it's there.

@rvagg rvagg force-pushed the rvagg/events-index-by-id-fix branch from 510f015 to 57d5c86 Compare April 30, 2024 08:53
@rvagg
Copy link
Member Author

rvagg commented May 1, 2024

see comment in https://github.com/filecoin-project/lotus/pull/11905/files#r1585930424 regarding hasExpensiveForkBetween; do we want to try and handle that here? Maybe error if you call this when there's an expensive migration to be run on this tipset.

@rvagg rvagg force-pushed the rvagg/events-index-by-id-fix branch from 57d5c86 to e0d154b Compare May 2, 2024 05:45
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.

None yet

1 participant