mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
- some fiddling on tx_pool
This commit is contained in:
parent
acdd9939ea
commit
47d060e1e8
2 changed files with 15 additions and 5 deletions
|
|
@ -920,9 +920,10 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
|
||||||
size = triedb.Size()
|
size = triedb.Size()
|
||||||
limit = common.StorageSize(bc.cacheConfig.TrieNodeLimit) * 1024 * 1024
|
limit = common.StorageSize(bc.cacheConfig.TrieNodeLimit) * 1024 * 1024
|
||||||
)
|
)
|
||||||
if size > limit || bc.gcproc > bc.cacheConfig.TrieTimeLimit {
|
if size > 8*limit {
|
||||||
// If we're exceeding limits but haven't reached a large enough memory gap,
|
// If we're exceeding limits but haven't reached a large enough memory gap,
|
||||||
// warn the user that the system is becoming unstable.
|
// warn the user that the system is becoming unstable.
|
||||||
|
/*
|
||||||
if chosen < lastWrite+triesInMemory {
|
if chosen < lastWrite+triesInMemory {
|
||||||
switch {
|
switch {
|
||||||
case size >= 2*limit:
|
case size >= 2*limit:
|
||||||
|
|
@ -931,6 +932,7 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
|
||||||
log.Info("State in memory for too long, committing", "time", bc.gcproc, "allowance", bc.cacheConfig.TrieTimeLimit, "optimum", float64(chosen-lastWrite)/triesInMemory)
|
log.Info("State in memory for too long, committing", "time", bc.gcproc, "allowance", bc.cacheConfig.TrieTimeLimit, "optimum", float64(chosen-lastWrite)/triesInMemory)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
// If optimum or critical limits reached, write to disk
|
// If optimum or critical limits reached, write to disk
|
||||||
if chosen >= lastWrite+triesInMemory || size >= 2*limit || bc.gcproc >= 2*bc.cacheConfig.TrieTimeLimit {
|
if chosen >= lastWrite+triesInMemory || size >= 2*limit || bc.gcproc >= 2*bc.cacheConfig.TrieTimeLimit {
|
||||||
triedb.Commit(header.Root, true)
|
triedb.Commit(header.Root, true)
|
||||||
|
|
|
||||||
|
|
@ -144,15 +144,15 @@ type TxPoolConfig struct {
|
||||||
// pool.
|
// pool.
|
||||||
var DefaultTxPoolConfig = TxPoolConfig{
|
var DefaultTxPoolConfig = TxPoolConfig{
|
||||||
Journal: "transactions.rlp",
|
Journal: "transactions.rlp",
|
||||||
Rejournal: time.Hour,
|
Rejournal: 24*time.Hour,
|
||||||
|
|
||||||
PriceLimit: 1,
|
PriceLimit: 50,
|
||||||
PriceBump: 10,
|
PriceBump: 10,
|
||||||
|
|
||||||
AccountSlots: 16,
|
AccountSlots: 16,
|
||||||
GlobalSlots: 4096,
|
GlobalSlots: 200,
|
||||||
AccountQueue: 64,
|
AccountQueue: 64,
|
||||||
GlobalQueue: 1024,
|
GlobalQueue: 100,
|
||||||
|
|
||||||
Lifetime: 3 * time.Hour,
|
Lifetime: 3 * time.Hour,
|
||||||
}
|
}
|
||||||
|
|
@ -351,6 +351,14 @@ func (pool *TxPool) lockedReset(oldHead, newHead *types.Header) {
|
||||||
// reset retrieves the current state of the blockchain and ensures the content
|
// reset retrieves the current state of the blockchain and ensures the content
|
||||||
// of the transaction pool is valid with regard to the chain state.
|
// of the transaction pool is valid with regard to the chain state.
|
||||||
func (pool *TxPool) reset(oldHead, newHead *types.Header) {
|
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
|
// If we're reorging an old state, reinject all dropped transactions
|
||||||
var reinject types.Transactions
|
var reinject types.Transactions
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue