2021-09-18 13:58:23 +00:00
|
|
|
|
# TxPool v2
|
2021-09-17 11:21:21 +00:00
|
|
|
|
|
2022-01-26 09:11:22 +00:00
|
|
|
|
Transaction Pool - place where living "not-included-to-block-yet transactions".
|
|
|
|
|
Erigon's TxPool can work inside Erigon (default) and as separated process.
|
2022-01-24 07:11:10 +00:00
|
|
|
|
|
2022-01-26 09:11:22 +00:00
|
|
|
|
Erigon's pool implementation is not fork of Geth’s, has Apache license - Design
|
|
|
|
|
docs: https://github.com/ledgerwatch/erigon/wiki/Transaction-Pool-Design
|
|
|
|
|
95% of pool-related code (from p2p message parsing, to sorting logic) is inside this
|
|
|
|
|
folder: https://github.com/ledgerwatch/erigon-lib/tree/main/txpool
|
2021-09-17 11:21:21 +00:00
|
|
|
|
|
|
|
|
|
## Internal mode
|
|
|
|
|
|
2022-01-26 09:11:22 +00:00
|
|
|
|
It's default. No special flags required - just start Erigon.
|
|
|
|
|
RPCDaemon - flags `--private.api.addr` and `--txpool.api.addr` must have same value in this case.
|
2021-09-17 11:21:21 +00:00
|
|
|
|
|
|
|
|
|
## External mode
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
make txpool
|
|
|
|
|
|
2022-01-26 09:11:22 +00:00
|
|
|
|
# Add `--txpool.disable` flag to Erigon
|
2021-09-17 11:21:21 +00:00
|
|
|
|
|
2022-01-26 09:11:22 +00:00
|
|
|
|
# External TxPool require(!) external Sentry
|
|
|
|
|
./build/bin/sentry --sentry.api.addr=localhost:9091 --datadir=<your_datadir>
|
2021-09-17 11:21:21 +00:00
|
|
|
|
|
2022-01-26 09:11:22 +00:00
|
|
|
|
# Start TxPool service (it connects to Erigon and Sentry):
|
|
|
|
|
# --private.api.addr - connect to Erigon's grpc api
|
|
|
|
|
# --sentry.api.addr - connect to Sentry's grpc api
|
|
|
|
|
# --txpool.api.addr - other services to connect TxPool's grpc api
|
|
|
|
|
# Increase limits flags: --txpool.globalslots, --txpool.globalbasefeeeslots, --txpool.globalqueue
|
|
|
|
|
# --txpool.trace.senders - print more logs about Txs with senders in this list
|
|
|
|
|
./build/bin/txpool --private.api.addr=localhost:9090 --sentry.api.addr=localhost:9091 --txpool.api.addr=localhost:9094 --datadir=<your_datadir>
|
2021-09-17 11:21:21 +00:00
|
|
|
|
|
2022-01-26 09:11:22 +00:00
|
|
|
|
# Add flag `--txpool.api.addr` to RPCDaemon
|
2021-09-17 11:21:21 +00:00
|
|
|
|
```
|
2021-09-18 13:58:23 +00:00
|
|
|
|
|
|
|
|
|
## ToDo list
|
|
|
|
|
|
2021-10-28 10:50:49 +00:00
|
|
|
|
[] Hard-forks support (now TxPool require restart - after hard-fork happens)
|
2021-09-18 13:58:23 +00:00
|
|
|
|
[] Add pool to docker-compose
|
|
|
|
|
[] Add pool (db table) - where store recently mined txs - for faster unwind/reorg.
|
|
|
|
|
[] Save history of local transactions - with 1 day expiration
|
2021-11-08 13:40:56 +00:00
|
|
|
|
[] move tx.rlp field to separated map, to make tx immutable
|
|
|
|
|
|