Merge pull request #8163 from filecoin-project/steb/fix-inclusion-price-at-upgrade
Fix the epoch used for gas in the message pool & validation
This commit is contained in:
commit
64b13afee5
@ -467,7 +467,7 @@ func (filec *FilecoinEC) checkBlockMessages(ctx context.Context, b *types.FullBl
|
|||||||
}
|
}
|
||||||
|
|
||||||
nv := filec.sm.GetNetworkVersion(ctx, b.Header.Height)
|
nv := filec.sm.GetNetworkVersion(ctx, b.Header.Height)
|
||||||
pl := vm.PricelistByEpoch(baseTs.Height())
|
pl := vm.PricelistByEpoch(b.Header.Height)
|
||||||
var sumGasLimit int64
|
var sumGasLimit int64
|
||||||
checkMsg := func(msg types.ChainMsg) error {
|
checkMsg := func(msg types.ChainMsg) error {
|
||||||
m := msg.VMMessage()
|
m := msg.VMMessage()
|
||||||
|
@ -106,7 +106,7 @@ func (mp *MessagePool) checkMessages(ctx context.Context, msgs []*types.Message,
|
|||||||
curTs := mp.curTs
|
curTs := mp.curTs
|
||||||
mp.curTsLk.Unlock()
|
mp.curTsLk.Unlock()
|
||||||
|
|
||||||
epoch := curTs.Height()
|
epoch := curTs.Height() + 1
|
||||||
|
|
||||||
var baseFee big.Int
|
var baseFee big.Int
|
||||||
if len(curTs.Blocks()) > 0 {
|
if len(curTs.Blocks()) > 0 {
|
||||||
|
@ -628,7 +628,7 @@ func (mp *MessagePool) addLocal(ctx context.Context, m *types.SignedMessage) err
|
|||||||
// For non local messages, if the message cannot be included in the next 20 blocks it returns
|
// For non local messages, if the message cannot be included in the next 20 blocks it returns
|
||||||
// a (soft) validation error.
|
// a (soft) validation error.
|
||||||
func (mp *MessagePool) verifyMsgBeforeAdd(m *types.SignedMessage, curTs *types.TipSet, local bool) (bool, error) {
|
func (mp *MessagePool) verifyMsgBeforeAdd(m *types.SignedMessage, curTs *types.TipSet, local bool) (bool, error) {
|
||||||
epoch := curTs.Height()
|
epoch := curTs.Height() + 1
|
||||||
minGas := vm.PricelistByEpoch(epoch).OnChainMessage(m.ChainLength())
|
minGas := vm.PricelistByEpoch(epoch).OnChainMessage(m.ChainLength())
|
||||||
|
|
||||||
if err := m.VMMessage().ValidForBlockInclusion(minGas.Total(), build.NewestNetworkVersion); err != nil {
|
if err := m.VMMessage().ValidForBlockInclusion(minGas.Total(), build.NewestNetworkVersion); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user