check gas limits on messages more places
This commit is contained in:
parent
41ee20013e
commit
1d8c8b9a8e
@ -374,6 +374,10 @@ func (mp *MessagePool) addLocked(m *types.SignedMessage) error {
|
||||
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 {
|
||||
log.Warnf("mpooladd cs.PutMessage failed: %s", err)
|
||||
return err
|
||||
|
@ -421,6 +421,12 @@ func SelectMessages(ctx context.Context, al ActorLookup, ts *types.TipSet, 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 {
|
||||
log.Warnf("message in mempool had bad 'To' address")
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user