sync: enforce message gas limits
This commit is contained in:
parent
d124d10f7c
commit
4c64f0ca11
@ -114,6 +114,7 @@ const BlsSignatureCacheSize = 40000
|
||||
|
||||
// TODO: If this is gonna stay, it should move to specs-actors
|
||||
const BlockMessageLimit = 512
|
||||
const BlockGasLimit = 100_000_000
|
||||
|
||||
var DrandCoeffs = []string{
|
||||
"82c279cce744450e68de98ee08f9698a01dd38f8e3be3c53f2b840fb9d09ad62a0b6b87981e179e1b14bc9a2d284c985",
|
||||
|
@ -873,10 +873,9 @@ func (syncer *Syncer) checkBlockMessages(ctx context.Context, b *types.FullBlock
|
||||
return xerrors.New("'GasPrice' field cannot be negative")
|
||||
}
|
||||
|
||||
// TODO: This should be a thing
|
||||
//if m.GasLimit > BLOCK_GAS_LIMIT {
|
||||
// return xerrors.New("'GasLimit' field cannot be greater than a block's gas limit")
|
||||
//}
|
||||
if m.GasLimit > build.BlockGasLimit {
|
||||
return xerrors.New("'GasLimit' field cannot be greater than a block's gas limit")
|
||||
}
|
||||
|
||||
// since prices might vary with time, this is technically semantic validation
|
||||
if m.GasLimit < vm.PricelistByEpoch(baseTs.Height()).OnChainMessage(m.ChainLength()) {
|
||||
|
@ -568,7 +568,7 @@ func configureStorageMiner(ctx context.Context, api lapi.FullNode, addr address.
|
||||
Params: enc,
|
||||
Value: types.NewInt(0),
|
||||
GasPrice: gasPrice,
|
||||
GasLimit: 100000000,
|
||||
GasLimit: 99999999,
|
||||
}
|
||||
|
||||
smsg, err := api.MpoolPushMessage(ctx, msg)
|
||||
|
Loading…
Reference in New Issue
Block a user