diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-11-26 10:00:31 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2018-12-19 20:54:27 +0800 |
commit | ce9dd85433e342b9ee13848414bc694921be1100 (patch) | |
tree | 892af82873805fb2e98eb7ef7e56b6130ea0438a /core | |
parent | 8b0b015937c02207df440eee6e4c96eec846fae6 (diff) | |
download | dexon-ce9dd85433e342b9ee13848414bc694921be1100.tar dexon-ce9dd85433e342b9ee13848414bc694921be1100.tar.gz dexon-ce9dd85433e342b9ee13848414bc694921be1100.tar.bz2 dexon-ce9dd85433e342b9ee13848414bc694921be1100.tar.lz dexon-ce9dd85433e342b9ee13848414bc694921be1100.tar.xz dexon-ce9dd85433e342b9ee13848414bc694921be1100.tar.zst dexon-ce9dd85433e342b9ee13848414bc694921be1100.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/types/transaction_signing.go | 15 |
4 files changed, 12 insertions, 11 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index aeec35cf0..2355e9490 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1828,6 +1828,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 c0231d922..57b7c619b 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -386,7 +386,7 @@ func DefaultGenesisBlock() *Genesis { Timestamp: 1540024964, Nonce: 0x42, ExtraData: hexutil.MustDecode("0x5765692d4e696e6720536f6e696320426f6a696520323031382d31302d32302e"), - GasLimit: 80000000, + GasLimit: 40000000, Difficulty: big.NewInt(1), Alloc: decodePrealloc(mainnetAllocData), } @@ -398,7 +398,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 001aee6f9..2e8211208 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/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) } |