From 04bc4405c782f390538d9c8e2c9dae6a471951c5 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 21 Feb 2022 14:29:17 +0000 Subject: [PATCH] fix: chain: check against the inclusion price at the correct height We need to use the height at which the messages will be executed, not the height of the previous tipset. This brings the gas checking for validation with the gas we actually _charge_ during message execution. This only matters for the Calico upgrade (the only upgrade where we changed the gas prices). This change could potentially cause a block at that height to be rejected if it includes a message with insufficient gas for inclusion. However, that _should_ have shown up as a miner penalty when we executed the blocks in the following tipset. Given that there were no miner penalties at 265199-265201, this change should be "safe". --- chain/consensus/filcns/filecoin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chain/consensus/filcns/filecoin.go b/chain/consensus/filcns/filecoin.go index 0adb79191..3aa85c7c5 100644 --- a/chain/consensus/filcns/filecoin.go +++ b/chain/consensus/filcns/filecoin.go @@ -467,7 +467,7 @@ func (filec *FilecoinEC) checkBlockMessages(ctx context.Context, b *types.FullBl } nv := filec.sm.GetNetworkVersion(ctx, b.Header.Height) - pl := vm.PricelistByEpoch(baseTs.Height()) + pl := vm.PricelistByEpoch(b.Header.Height) var sumGasLimit int64 checkMsg := func(msg types.ChainMsg) error { m := msg.VMMessage()