Revert "Prevent Pushing messages not valid for block inclusion"

This commit is contained in:
Jakub Sztandera 2020-07-29 19:06:32 +02:00 committed by GitHub
parent 5ea9d2fa9f
commit 5eb74ba3f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,6 @@ import (
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/vm"
"github.com/filecoin-project/lotus/lib/sigs"
"github.com/filecoin-project/lotus/node/modules/dtypes"
@ -311,22 +310,7 @@ func (mp *MessagePool) addLocal(m *types.SignedMessage, msgb []byte) error {
return nil
}
func (mp *MessagePool) verifyMsgBeforePush(m *types.SignedMessage) error {
mp.curTsLk.Lock()
minGas := vm.PricelistByEpoch(mp.curTs.Height()).OnChainMessage(m.ChainLength())
mp.curTsLk.Unlock()
if err := m.VMMessage().ValidForBlockInclusion(minGas.Total()); err != nil {
return xerrors.Errorf("message will not be included in a block: %w", err)
}
return nil
}
func (mp *MessagePool) Push(m *types.SignedMessage) (cid.Cid, error) {
if err := mp.verifyMsgBeforePush(m); err != nil {
return cid.Undef, err
}
msgb, err := m.Serialize()
if err != nil {
return cid.Undef, err
@ -575,10 +559,6 @@ func (mp *MessagePool) PushWithNonce(ctx context.Context, addr address.Address,
return nil, err
}
if err := mp.verifyMsgBeforePush(msg); err != nil {
return nil, err
}
msgb, err := msg.Serialize()
if err != nil {
return nil, err