From 57af2b5b99c6acceee27fd3126f0ba423f4a14a4 Mon Sep 17 00:00:00 2001 From: Daniil Lashin Date: Wed, 26 Dec 2018 11:26:58 +0300 Subject: [PATCH] Disable tx rechecking & fix issue with bag tx occupying mempool --- CHANGELOG.md | 11 +++++++++++ config/config.go | 2 ++ config/toml.go | 1 - core/transaction/executor.go | 8 +++++++- docker-compose.yml | 2 +- version/version.go | 4 ++-- 6 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7498f84c0..a467e7f68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ # Changelog ## 0.9.4 +*Dec 26th, 2018* + +IMPROVEMENT + +- [mempool] Disable tx rechecking + +BUG FIXES + +- [core] Fix issue with bag tx occupying mempool + +## 0.9.3 *Dec 25th, 2018* BUG FIXES diff --git a/config/config.go b/config/config.go index 11090b71b..e675f4de1 100644 --- a/config/config.go +++ b/config/config.go @@ -100,6 +100,8 @@ func GetConfig() *Config { cfg.RPC.GRPCListenAddress = "" } + cfg.Mempool.Recheck = false + cfg.SetRoot(utils.GetMinterHome()) EnsureRoot(utils.GetMinterHome()) diff --git a/config/toml.go b/config/toml.go index 5ede17b7e..b3fa42abe 100644 --- a/config/toml.go +++ b/config/toml.go @@ -202,7 +202,6 @@ private_peer_ids = "{{ .P2P.PrivatePeerIDs }}" ##### mempool configuration options ##### [mempool] -recheck = {{ .Mempool.Recheck }} broadcast = {{ .Mempool.Broadcast }} wal_dir = "{{ js .Mempool.WalPath }}" diff --git a/core/transaction/executor.go b/core/transaction/executor.go index b94d2164b..a684fc793 100644 --- a/core/transaction/executor.go +++ b/core/transaction/executor.go @@ -134,5 +134,11 @@ func RunTx(context *state.StateDB, isCheck bool, rawTx []byte, rewardPool *big.I Log: fmt.Sprintf("Unexpected nonce. Expected: %d, got %d.", expectedNonce, tx.Nonce)} } - return tx.decodedData.Run(tx, context, isCheck, rewardPool, currentBlock) + response := tx.decodedData.Run(tx, context, isCheck, rewardPool, currentBlock) + + if response.Code != code.TxFromSenderAlreadyInMempool && response.Code != code.OK { + delete(currentMempool, sender) + } + + return response } diff --git a/docker-compose.yml b/docker-compose.yml index 44600a50e..b38d86441 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: "3.4" services: minter: - image: minterteam/minter:0.9.3 + image: minterteam/minter:0.9.4 volumes: - ~/.minter:/minter ports: diff --git a/version/version.go b/version/version.go index 676d9e52d..49b566c0f 100755 --- a/version/version.go +++ b/version/version.go @@ -4,14 +4,14 @@ package version const ( Maj = "0" Min = "9" - Fix = "3" + Fix = "4" AppVer = 1 ) var ( // Must be a string because scripts like dist.sh read this file. - Version = "0.9.3" + Version = "0.9.4" // GitCommit is the current HEAD set using ldflags. GitCommit string