Merge pull request #1720 from filecoin-project/fix/check-gas-limits
check gas limits on messages more places
This commit is contained in:
commit
ea6121a951
@ -374,6 +374,10 @@ func (mp *MessagePool) addLocked(m *types.SignedMessage) error {
|
|||||||
mp.blsSigCache.Add(m.Cid(), m.Signature)
|
mp.blsSigCache.Add(m.Cid(), m.Signature)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if m.Message.GasLimit > build.BlockGasLimit {
|
||||||
|
return xerrors.Errorf("given message has too high of a gas limit")
|
||||||
|
}
|
||||||
|
|
||||||
if _, err := mp.api.PutMessage(m); err != nil {
|
if _, err := mp.api.PutMessage(m); err != nil {
|
||||||
log.Warnf("mpooladd cs.PutMessage failed: %s", err)
|
log.Warnf("mpooladd cs.PutMessage failed: %s", err)
|
||||||
return err
|
return err
|
||||||
|
@ -421,6 +421,12 @@ func SelectMessages(ctx context.Context, al ActorLookup, ts *types.TipSet, msgs
|
|||||||
|
|
||||||
for _, msg := range msgs {
|
for _, msg := range msgs {
|
||||||
|
|
||||||
|
// TODO: this should be in some more general 'validate message' call
|
||||||
|
if msg.Message.GasLimit > build.BlockGasLimit {
|
||||||
|
log.Warnf("message in mempool had too high of a gas limit (%d)", msg.Message.GasLimit)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if msg.Message.To == address.Undef {
|
if msg.Message.To == address.Undef {
|
||||||
log.Warnf("message in mempool had bad 'To' address")
|
log.Warnf("message in mempool had bad 'To' address")
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user