From 816ce69308b4e2a4a0e1649d02560700177d3d89 Mon Sep 17 00:00:00 2001 From: ArchetypicalDude Date: Tue, 6 Mar 2018 14:00:57 +0100 Subject: [PATCH] - bring changes in line with official repository --- core/tx_pool.go | 16 ++++------------ ethdb/badger.go | 23 +++++++++++------------ 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/core/tx_pool.go b/core/tx_pool.go index 10951bc322..0534fe57a1 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -144,15 +144,15 @@ type TxPoolConfig struct { // pool. var DefaultTxPoolConfig = TxPoolConfig{ Journal: "transactions.rlp", - Rejournal: 24*time.Hour, + Rejournal: time.Hour, - PriceLimit: 50, + PriceLimit: 1, PriceBump: 10, AccountSlots: 16, - GlobalSlots: 200, + GlobalSlots: 4096, AccountQueue: 64, - GlobalQueue: 100, + GlobalQueue: 1024, Lifetime: 3 * time.Hour, } @@ -351,14 +351,6 @@ func (pool *TxPool) lockedReset(oldHead, newHead *types.Header) { // reset retrieves the current state of the blockchain and ensures the content // of the transaction pool is valid with regard to the chain state. func (pool *TxPool) reset(oldHead, newHead *types.Header) { - log.Info("TxPool reset exec") - /* - pool.pending = make(map[common.Address]*txList) // All currently processable transactions - pool.queue = make(map[common.Address]*txList) // Queued but non-processable transactions - pool.beats = make(map[common.Address]time.Time) // Last heartbeat from each known account - pool.all = make(map[common.Hash]*types.Transaction) // All transactions to allow lookups - pool.priced = nil // All transactions sorted by price*/ - return // If we're reorging an old state, reinject all dropped transactions var reinject types.Transactions diff --git a/ethdb/badger.go b/ethdb/badger.go index 4289618af4..df59d7bd28 100644 --- a/ethdb/badger.go +++ b/ethdb/badger.go @@ -23,12 +23,11 @@ import ( "time" "github.com/ethereum/go-ethereum/log" - //"github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/metrics" "github.com/dgraph-io/badger" "github.com/dgraph-io/badger/options" "github.com/ethereum/go-ethereum/common" - gometrics "github.com/rcrowley/go-metrics" ) @@ -37,15 +36,15 @@ type BadgerDatabase struct { fn string // filename for reporting db *badger.DB badgerCache *BadgerCache - getTimer gometrics.Timer // Timer for measuring the database get request counts and latencies - putTimer gometrics.Timer // Timer for measuring the database put request counts and latencies - delTimer gometrics.Timer // Timer for measuring the database delete request counts and latencies - missMeter gometrics.Meter // Meter for measuring the missed database get requests - readMeter gometrics.Meter // Meter for measuring the database get request data usage - writeMeter gometrics.Meter // Meter for measuring the database put request data usage - compTimeMeter gometrics.Meter // Meter for measuring the total time spent in database compaction - compReadMeter gometrics.Meter // Meter for measuring the data read during compaction - compWriteMeter gometrics.Meter // Meter for measuring the data written during compaction + getTimer metrics.Timer // Timer for measuring the database get request counts and latencies + putTimer metrics.Timer // Timer for measuring the database put request counts and latencies + delTimer metrics.Timer // Timer for measuring the database delete request counts and latencies + missMeter metrics.Meter // Meter for measuring the missed database get requests + readMeter metrics.Meter // Meter for measuring the database get request data usage + writeMeter metrics.Meter // Meter for measuring the database put request data usage + compTimeMeter metrics.Meter // Meter for measuring the total time spent in database compaction + compReadMeter metrics.Meter // Meter for measuring the data read during compaction + compWriteMeter metrics.Meter // Meter for measuring the data written during compaction quitLock sync.Mutex // Mutex protecting the quit channel access quitChan chan chan error // Quit channel to stop the metrics collection before closing the database @@ -75,7 +74,7 @@ func NewBadgerDatabase(file string) (*BadgerDatabase, error) { log: logger, } - ret.badgerCache = &BadgerCache{db: ret, c: make(map[string][]byte), size: 0, limit: 100000000} + ret.badgerCache = &BadgerCache{db: ret, c: make(map[string][]byte), size: 0, limit: 500000000} return ret, nil }