config: reduce default mempool size (#2300)

* config: reduce default mempool size

This reduces the mempool size from 100k to 5k. Note that each secp256k1 sig
takes .5ms to compute. Therefore an adversary could previously delay every
node on the network's computation time upon receiving a block by 50 seconds.

This now reduces that ability to being able to only delay each node by 2.5
seconds. This change should be reverted once ABCI recheck is implemented.

* (squash this) fix test
This commit is contained in:
Dev Ojha 2018-08-30 14:41:58 -07:00 committed by Ethan Buchman
parent 3a6cc5e6af
commit 61ab10d655
3 changed files with 6 additions and 3 deletions

View File

@ -32,6 +32,7 @@ IMPROVEMENTS:
- [mempool] Now stores txs by hash inside of the cache, to mitigate memory leakage
- [config] Replace db_path with db_dir from automatically generated configuration files.
Issue reported to Cosmos SDK ([#1712](https://github.com/cosmos/cosmos-sdk/issues/1712))
- [config] Reduce default mempool size from 100k to 5k, until ABCI rechecking is implemented.
BUG FIXES:
- [mempool] No longer possible to fill up linked list without getting caching

View File

@ -421,8 +421,10 @@ func DefaultMempoolConfig() *MempoolConfig {
RecheckEmpty: true,
Broadcast: true,
WalPath: filepath.Join(defaultDataDir, "mempool.wal"),
Size: 100000,
CacheSize: 100000,
// Each signature verification takes .5ms, size reduced until we implement
// ABCI Recheck
Size: 5000,
CacheSize: 10000,
}
}

View File

@ -99,7 +99,7 @@ func TestMempoolTxConcurrentWithCommit(t *testing.T) {
height, round := cs.Height, cs.Round
newBlockCh := subscribe(cs.eventBus, types.EventQueryNewBlock)
NTxs := 10000
NTxs := 3000
go deliverTxsRange(cs, 0, NTxs)
startTestRound(cs, height, round)