aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorAaron Buchwald <aaron.buchwald56@gmail.com>2020-09-20 15:25:50 -0400
committerAaron Buchwald <aaron.buchwald56@gmail.com>2020-09-20 15:25:50 -0400
commit99a0be028ab8df4bc6028f9a105e131a8984a599 (patch)
tree7a6a0f498c584e062a3125a9907d7aaf853241b3 /plugin
parent98e1e9f1f169fd9c8a4e5a7ca9547c77d923c4fc (diff)
Treat requests for pending block as requests for accepted block
Diffstat (limited to 'plugin')
-rw-r--r--plugin/evm/block.go3
-rw-r--r--plugin/evm/vm.go10
2 files changed, 5 insertions, 8 deletions
diff --git a/plugin/evm/block.go b/plugin/evm/block.go
index 1e1d710..ee5b7c6 100644
--- a/plugin/evm/block.go
+++ b/plugin/evm/block.go
@@ -8,6 +8,7 @@ import (
"fmt"
"github.com/ava-labs/coreth/core/types"
+ "github.com/ava-labs/coreth/params"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rlp"
@@ -80,7 +81,7 @@ func (b *Block) Verify() error {
if b.vm.ctx.IsBootstrapped() {
// Ensure the minimum gas price is paid for every transaction
for _, tx := range b.ethBlock.Transactions() {
- if tx.GasPrice().Cmp(minGasPrice) < 0 {
+ if tx.GasPrice().Cmp(params.MinGasPrice) < 0 {
return errInvalidBlock
}
}
diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go
index 13d4d3f..2c6dc1a 100644
--- a/plugin/evm/vm.go
+++ b/plugin/evm/vm.go
@@ -87,10 +87,6 @@ const (
)
var (
- // minGasPrice is the number of nAVAX required per gas unit for a transaction
- // to be valid, measured in wei
- minGasPrice = big.NewInt(470 * params.GWei)
-
txFee = units.MilliAvax
errEmptyBlock = errors.New("empty block")
@@ -258,10 +254,10 @@ func (vm *VM) Initialize(
// Set minimum price for mining and default gas price oracle value to the min
// gas price to prevent so transactions and blocks all use the correct fees
- config.Miner.GasPrice = minGasPrice
+ config.Miner.GasPrice = params.MinGasPrice
config.RPCTxFeeCap = 100 // 100 AVAX
- config.GPO.Default = minGasPrice
- config.TxPool.PriceLimit = minGasPrice.Uint64()
+ config.GPO.Default = params.MinGasPrice
+ config.TxPool.PriceLimit = params.MinGasPrice.Uint64()
config.TxPool.NoLocals = true
if err := config.SetGCMode("archive"); err != nil {