1
0
mirror of https://github.com/fluencelabs/tendermint synced 2025-06-26 11:11:41 +00:00
Files
.circleci
.github
DOCKER
abci
behaviour
benchmarks
blockchain
cmd
config
consensus
crypto
docs
.vuepress
app-dev
architecture
guides
imgs
interviews
introduction
networks
research
spec
abci
blockchain
consensus
p2p
reactors
block_sync
consensus
evidence
mempool
concurrency.md
config.md
functionality.md
messages.md
reactor.md
pex
scripts
software
README.md
tendermint-core
tools
.python-version
.textlintrc.json
DOCS_README.md
README.md
stop-words.txt
tendermint-core-image.jpg
evidence
libs
lite
mempool
mock
networks
node
p2p
privval
proxy
rpc
scripts
state
test
tools
types
version
.editorconfig
.gitignore
.golangci.yml
CHANGELOG.md
CHANGELOG_PENDING.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
Makefile
PHILOSOPHY.md
README.md
ROADMAP.md
SECURITY.md
UPGRADING.md
Vagrantfile
appveyor.yml
codecov.yml
docker-compose.yml
go.mod
go.sum
tendermint/docs/spec/reactors/mempool/functionality.md

44 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

# Mempool Functionality
The mempool maintains a list of potentially valid transactions,
both to broadcast to other nodes, as well as to provide to the
consensus reactor when it is selected as the block proposer.
There are two sides to the mempool state:
- External: get, check, and broadcast new transactions
- Internal: return valid transaction, update list after block commit
## External functionality
External functionality is exposed via network interfaces
to potentially untrusted actors.
- CheckTx - triggered via RPC or P2P
- Broadcast - gossip messages after a successful check
## Internal functionality
Internal functionality is exposed via method calls to other
code compiled into the tendermint binary.
- ReapMaxBytesMaxGas - get txs to propose in the next block. Guarantees that the
size of the txs is less than MaxBytes, and gas is less than MaxGas
- Update - remove tx that were included in last block
- ABCI.CheckTx - call ABCI app to validate the tx
What does it provide the consensus reactor?
What guarantees does it need from the ABCI app?
(talk about interleaving processes in concurrency)
## Optimizations
The implementation within this library also implements a tx cache.
This is so that signatures don't have to be reverified if the tx has
already been seen before.
However, we only store valid txs in the cache, not invalid ones.
This is because invalid txs could become good later.
Txs that are included in a block aren't removed from the cache,
as they still may be getting received over the p2p network.
These txs are stored in the cache by their hash, to mitigate memory concerns.