aboutsummaryrefslogtreecommitdiffstats
path: root/dex/app.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-11-26 10:00:31 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:54 +0800
commit622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7 (patch)
tree995b1db1cb20fc0fecb240338d089f0c49d1d986 /dex/app.go
parentc11db35c2d3f5ca5f4b5749294e154f10ef6b1c1 (diff)
downloaddexon-622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7.tar.gz
dexon-622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7.tar.zst
dexon-622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7.zip
core: various changes on tps tuning (#46)
Diffstat (limited to 'dex/app.go')
-rw-r--r--dex/app.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/dex/app.go b/dex/app.go
index 623bb8dff..0e3f34f70 100644
--- a/dex/app.go
+++ b/dex/app.go
@@ -174,10 +174,9 @@ func (d *DexconApp) PreparePayload(position coreTypes.Position) (payload []byte,
chainID := new(big.Int).SetUint64(uint64(position.ChainID))
chainNums := new(big.Int).SetUint64(uint64(d.gov.GetNumChains(position.Round)))
- blockGasLimit := new(big.Int).SetUint64(core.CalcGasLimit(d.blockchain.CurrentBlock(),
- d.config.GasFloor, d.config.GasCeil))
+ blockGasLimit := new(big.Int).SetUint64(d.blockchain.CurrentBlock().GasLimit())
blockGasUsed := new(big.Int)
- var allTxs types.Transactions
+ allTxs := make([]*types.Transaction, 0, 3000)
addressMap:
for address, txs := range txsMap {
@@ -374,8 +373,7 @@ func (d *DexconApp) VerifyBlock(block *coreTypes.Block) coreTypes.BlockVerifySta
}
// Validate if balance is enough for TXs in this block.
- blockGasLimit := new(big.Int).SetUint64(core.CalcGasLimit(
- d.blockchain.CurrentBlock(), d.config.GasFloor, d.config.GasCeil))
+ blockGasLimit := new(big.Int).SetUint64(d.blockchain.CurrentBlock().GasLimit())
blockGasUsed := new(big.Int)
for _, tx := range transactions {
@@ -451,7 +449,6 @@ func (d *DexconApp) BlockDelivered(
}
d.chainLatestRoot.Store(block.Position.ChainID, root)
- log.Info("Insert pending block success", "height", result.Height)
d.blockchain.RemoveConfirmedBlock(chainID, blockHash)
}