mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
Filter by total gas rather than GasUsed
See https://github.com/ava-labs/coreth/pull/843
This commit is contained in:
committed by
Quentin Mc Gaw
parent
7b22ec6ef2
commit
b05cd69548
@@ -9,7 +9,6 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/ava-labs/coreth/plugin/evm/ap4"
|
||||
"github.com/ava-labs/subnet-evm/commontype"
|
||||
"github.com/ava-labs/subnet-evm/consensus/dummy"
|
||||
"github.com/ava-labs/subnet-evm/core/rawdb"
|
||||
@@ -1387,7 +1386,7 @@ func TestInsertChainValidBlockFee(t *testing.T, create func(db ethdb.Database, g
|
||||
signer := types.LatestSigner(params.TestChainConfig)
|
||||
tip := big.NewInt(50000 * params.GWei)
|
||||
transfer := big.NewInt(10000)
|
||||
_, chain, _, err := GenerateChainWithGenesis(gspec, blockchain.engine, 3, ap4.TargetBlockRate-1, func(i int, gen *BlockGen) {
|
||||
_, chain, _, err := GenerateChainWithGenesis(gspec, blockchain.engine, 3, 0, func(i int, gen *BlockGen) {
|
||||
feeCap := new(big.Int).Add(gen.BaseFee(), tip)
|
||||
tx := types.NewTx(&types.DynamicFeeTx{
|
||||
ChainID: params.TestChainConfig.ChainID,
|
||||
|
||||
@@ -92,10 +92,14 @@ func (f *feeInfoProvider) addHeader(ctx context.Context, header *types.Header) (
|
||||
timestamp: header.Time,
|
||||
baseFee: header.BaseFee,
|
||||
}
|
||||
|
||||
totalGasUsed := new(big.Int).SetUint64(header.GasUsed)
|
||||
minGasUsed := new(big.Int).SetUint64(f.minGasUsed)
|
||||
|
||||
// Don't bias the estimate with blocks containing a limited number of transactions paying to
|
||||
// expedite block production.
|
||||
var err error
|
||||
if f.minGasUsed <= header.GasUsed {
|
||||
if minGasUsed.Cmp(totalGasUsed) <= 0 {
|
||||
// Compute minimum required tip to be included in previous block
|
||||
//
|
||||
// NOTE: Using this approach, we will never recommend that the caller
|
||||
|
||||
Reference in New Issue
Block a user