diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-11-26 10:00:31 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:18 +0800 |
commit | afc6a417210dc43a5a38ece5302de6801785316f (patch) | |
tree | bdf34181a628038f935e161433fe1b612a5b3bae /core | |
parent | 82d138debeac23029d3640ee7bc31c4ed093ff28 (diff) | |
download | go-tangerine-afc6a417210dc43a5a38ece5302de6801785316f.tar.gz go-tangerine-afc6a417210dc43a5a38ece5302de6801785316f.tar.zst go-tangerine-afc6a417210dc43a5a38ece5302de6801785316f.zip |
core: various changes on tps tuning (#46)
Diffstat (limited to 'core')
-rw-r--r-- | core/blockchain.go | 2 | ||||
-rw-r--r-- | core/genesis.go | 4 | ||||
-rw-r--r-- | core/tx_pool.go | 2 | ||||
-rw-r--r-- | core/tx_pool_test.go | 2 | ||||
-rw-r--r-- | core/types/transaction_signing.go | 15 |
5 files changed, 14 insertions, 11 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index 3d7171cd7..81e9f05b2 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1834,6 +1834,8 @@ func (bc *BlockChain) processPendingBlock( bc.addPendingBlock(newPendingBlock, receipts) events = append(events, BlockConfirmedEvent{newPendingBlock}) + log.Debug("Inserted pending block", "height", newPendingBlock.Number(), "hash", newPendingBlock.Hash()) + // Start insert available pending blocks into db for pendingHeight := bc.CurrentBlock().NumberU64() + 1; pendingHeight <= witness.Height; pendingHeight++ { pendingIns, exist := bc.pendingBlocks[pendingHeight] diff --git a/core/genesis.go b/core/genesis.go index 09ab5b701..0b59f4bbb 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -387,7 +387,7 @@ func DefaultGenesisBlock() *Genesis { Timestamp: 1540024964, Nonce: 0x42, ExtraData: hexutil.MustDecode("0x5765692d4e696e6720536f6e696320426f6a696520323031382d31302d32302e"), - GasLimit: 80000000, + GasLimit: 40000000, Difficulty: big.NewInt(1), Alloc: decodePrealloc(mainnetAllocData), } @@ -399,7 +399,7 @@ func DefaultTestnetGenesisBlock() *Genesis { Config: params.TestnetChainConfig, Nonce: 0x42, ExtraData: hexutil.MustDecode("0x3535353535353535353535353535353535353535353535353535353535353535"), - GasLimit: 80000000, + GasLimit: 40000000, Difficulty: big.NewInt(1), Alloc: decodePrealloc(testnetAllocData), } diff --git a/core/tx_pool.go b/core/tx_pool.go index b7f8896fa..1d69ea506 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -152,7 +152,7 @@ var DefaultTxPoolConfig = TxPoolConfig{ PriceLimit: 1, PriceBump: 10, - AccountSlots: 192, + AccountSlots: 512, GlobalSlots: 40960, AccountQueue: 1024, GlobalQueue: 20240, diff --git a/core/tx_pool_test.go b/core/tx_pool_test.go index 4c1d78f7f..dc664eedd 100644 --- a/core/tx_pool_test.go +++ b/core/tx_pool_test.go @@ -1437,7 +1437,9 @@ func TestTransactionPoolStableUnderpricing(t *testing.T) { blockchain := &testBlockChain{statedb, 1000000, new(event.Feed), new(event.Feed)} config := testTxPoolConfig + config.AccountSlots = 16 config.GlobalSlots = 128 + config.AccountQueue = 1024 config.GlobalQueue = 0 pool := NewTxPool(config, params.TestChainConfig, blockchain, false) diff --git a/core/types/transaction_signing.go b/core/types/transaction_signing.go index 47c7a2f91..99e0c7896 100644 --- a/core/types/transaction_signing.go +++ b/core/types/transaction_signing.go @@ -173,9 +173,13 @@ func Sender(signer Signer, tx *Transaction) (common.Address, error) { } } - addr, err := signer.Sender(tx) - if err != nil { - return common.Address{}, err + addr, ok := GlobalSigCache.Get(tx.Hash()) + if !ok { + var err error + addr, err = signer.Sender(tx) + if err != nil { + return common.Address{}, err + } } tx.from.Store(sigCache{signer: signer, from: addr}) return addr, nil @@ -218,11 +222,6 @@ func (s EIP155Signer) Equal(s2 Signer) bool { var big8 = big.NewInt(8) func (s EIP155Signer) Sender(tx *Transaction) (common.Address, error) { - addr, ok := GlobalSigCache.Get(tx.Hash()) - if ok { - return addr, nil - } - if !tx.Protected() { return HomesteadSigner{}.Sender(tx) } |