Skip to content

Commit

Permalink
Merge pull request #10258 from filecoin-project/steb/fix-msg-modify
Browse files Browse the repository at this point in the history
fix: stmgr: copy the message before modifying it
  • Loading branch information
jennijuju authored Feb 14, 2023
2 parents 11ac325 + 77fbc60 commit 86b4aee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chain/stmgr/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ var ErrExpensiveFork = errors.New("refusing explicit call due to state fork at e
// tipset's parent. In the presence of null blocks, the height at which the message is invoked may
// be less than the specified tipset.
func (sm *StateManager) Call(ctx context.Context, msg *types.Message, ts *types.TipSet) (*api.InvocResult, error) {
// Copy the message as we modify it below.
msgCopy := *msg
msg = &msgCopy

if msg.GasLimit == 0 {
msg.GasLimit = build.BlockGasLimit
}
Expand Down

0 comments on commit 86b4aee

Please sign in to comment.