Merge pull request #10258 from filecoin-project/steb/fix-msg-modify

fix: stmgr: copy the message before modifying it
This commit is contained in:
Jiaying Wang 2023-02-14 10:07:24 -05:00 committed by GitHub
commit 86b4aeef1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}