decouple negative chain selection from base fee lower bound validation

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
vyzo 2020-09-07 22:28:23 +03:00 committed by Jakub Sztandera
parent 97fddc45d9
commit 172ff846fd
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
2 changed files with 6 additions and 2 deletions

View File

@ -83,7 +83,7 @@ const (
// this is *temporary* mutilation until we have implemented uncapped miner penalties -- it will go
// away in the next fork.
var allowNegativeChains = true
var strictBaseFeeValidation = false
func init() {
// if the republish interval is too short compared to the pubsub timecache, adjust it
@ -393,7 +393,7 @@ func (mp *MessagePool) verifyMsgBeforeAdd(m *types.SignedMessage, curTs *types.T
// Note that for local messages, we always add them so that they can be accepted and republished
// automatically.
publish := local
if !allowNegativeChains && len(curTs.Blocks()) > 0 {
if strictBaseFeeValidation && len(curTs.Blocks()) > 0 {
baseFee := curTs.Blocks()[0].ParentBaseFee
baseFeeLowerBound := types.BigDiv(baseFee, baseFeeLowerBoundFactor)
if m.Message.GasFeeCap.LessThan(baseFeeLowerBound) {

View File

@ -18,6 +18,10 @@ import (
var bigBlockGasLimit = big.NewInt(build.BlockGasLimit)
// this is *temporary* mutilation until we have implemented uncapped miner penalties -- it will go
// away in the next fork.
var allowNegativeChains = true
const MaxBlocks = 15
type msgChain struct {