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: stmgr: check message validity before invoking vm #10259

Merged
merged 1 commit into from
Feb 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions chain/stmgr/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ func (sm *StateManager) callInternal(ctx context.Context, msg *types.Message, pr
}
}

// This isn't strictly necessary, but the underlying VM will assume that the message is
// valid and may not return helpful debugging information. Checking here makes message
// validity issues easier to debug.
nv := sm.GetNetworkVersion(ctx, ts.Height())
if err := msg.ValidForBlockInclusion(0, nv); err != nil {
return nil, xerrors.Errorf("message not valid for network version %d: %w", nv, err)
}

// Unless executing on a specific state cid, apply all the messages from the current tipset
// first. Unfortunately, we can't just execute the tipset, because that will run cron. We
// don't want to apply miner messages after cron runs in a given epoch.
Expand Down