https://github.com/tendermint/tendermint
Revision 27909e5d2aee605a7cb562a53195b2e99d78eb8e authored by Anton Kaliaev on 07 May 2019, 08:25:35 UTC, committed by GitHub on 07 May 2019, 08:25:35 UTC
* mempool: remove only valid (Code==0) txs on Update

so evil proposers can't drop valid txs in Commit stage.

Also remove invalid (Code!=0) txs from the cache so they can be
resubmitted.

Fixes #3322

@rickyyangz:

In the end of commit stage, we will update mempool to remove all the txs
in current block.

// Update mempool.
err = blockExec.mempool.Update(
	block.Height,
	block.Txs,
	TxPreCheck(state),
	TxPostCheck(state),
)

Assum an account has 3 transactions in the mempool, the sequences are
100, 101 and 102 separately, So an evil proposal can only package the
101 and 102 transactions into its proposal block, and leave 100 still in
mempool, then the two txs will be removed from all validators' mempool
when commit. So the account lost the two valid txs.

@ebuchman:

In the longer term we may want to do something like #2639 so we can
validate txs before we commit the block. But even in this case we'd only
want to run the equivalent of CheckTx, which means the DeliverTx could
still fail even if the CheckTx passes depending on how the app handles
the ABCI Code semantics. So more work will be required around the ABCI
code. See also #2185

* add changelog entry and tests

* improve changelog message

* reformat code
1 parent 1e07381
History
Tip revision: 27909e5d2aee605a7cb562a53195b2e99d78eb8e authored by Anton Kaliaev on 07 May 2019, 08:25:35 UTC
mempool: remove only valid (Code==0) txs on Update (#3625)
Tip revision: 27909e5
File Mode Size
.circleci
.github
DOCKER
abci
benchmarks
blockchain
cmd
config
consensus
crypto
docs
evidence
libs
lite
mempool
mock
networks
node
p2p
privval
proxy
rpc
scripts
state
test
tools
types
version
.editorconfig -rw-r--r-- 280 bytes
.gitignore -rw-r--r-- 494 bytes
.golangci.yml -rw-r--r-- 1.1 KB
CHANGELOG.md -rw-r--r-- 104.6 KB
CHANGELOG_PENDING.md -rw-r--r-- 2.4 KB
CODE_OF_CONDUCT.md -rw-r--r-- 4.9 KB
CONTRIBUTING.md -rw-r--r-- 7.1 KB
Gopkg.lock -rw-r--r-- 15.3 KB
Gopkg.toml -rw-r--r-- 2.0 KB
LICENSE -rw-r--r-- 11.1 KB
Makefile -rw-r--r-- 10.4 KB
PHILOSOPHY.md -rw-r--r-- 7.5 KB
README.md -rw-r--r-- 6.9 KB
ROADMAP.md -rw-r--r-- 861 bytes
SECURITY.md -rw-r--r-- 1.7 KB
UPGRADING.md -rw-r--r-- 12.6 KB
Vagrantfile -rw-r--r-- 2.1 KB
appveyor.yml -rw-r--r-- 279 bytes
codecov.yml -rw-r--r-- 330 bytes
docker-compose.yml -rw-r--r-- 1.3 KB

README.md

back to top