From 77fbc60cb820ddd845c02492ec6edb55ee74f1f8 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 13 Feb 2023 10:06:59 -0800 Subject: [PATCH] fix: stmgr: copy the message before modifying it --- chain/stmgr/call.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chain/stmgr/call.go b/chain/stmgr/call.go index ea2758705fa..901fc2d1253 100644 --- a/chain/stmgr/call.go +++ b/chain/stmgr/call.go @@ -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 }