go-ethereum/cmd/workload
Felix Lange 48ec86abbb
core: initialize history pruning in BlockChain (#31636)
I added the history mode configuration in eth/ethconfig initially, since
it seemed like the logical place. But it turns out we need access to the
intended pruning setting at a deeper level, and it actually needs to be
integrated with the blockchain startup procedure.

With this change applied, if a node previously had its history pruned,
and is subsequently restarted **without** the `--history.chain
postmerge` flag, the `BlockChain` initialization code will now verify
the freezer tail against the known pruning point of the predefined
network and will restore pruning status. Note that this logic is quite
restrictive, we allow non-zero tail only for known networks, and only
for the specific pruning point that is defined.
2025-04-15 14:32:46 +02:00
..
queries cmd/workload: RPC workload tests for filters and history (#31189) 2025-02-27 00:07:14 +01:00
filtertest.go cmd/workload: fixed filter test request error handling (#31424) 2025-03-20 09:23:10 +01:00
filtertestgen.go cmd/workload: fixed filter test request error handling (#31424) 2025-03-20 09:23:10 +01:00
filtertestperf.go cmd/workload: fixed filter test request error handling (#31424) 2025-03-20 09:23:10 +01:00
historytest.go cmd/workload: implement checks for history-pruned node (#31355) 2025-03-13 15:21:47 +01:00
historytestgen.go cmd/workload: RPC workload tests for filters and history (#31189) 2025-02-27 00:07:14 +01:00
main.go cmd/workload: RPC workload tests for filters and history (#31189) 2025-02-27 00:07:14 +01:00
README.md cmd/workload: RPC workload tests for filters and history (#31189) 2025-02-27 00:07:14 +01:00
testsuite.go core: initialize history pruning in BlockChain (#31636) 2025-04-15 14:32:46 +02:00

Workload Testing Tool

This tool performs RPC calls against a live node. It has tests for the Sepolia testnet and Mainnet. Note the tests require a fully synced node.

To run the tests against a Sepolia node, use:

> ./workload test --sepolia http://host:8545

To run a specific test, use the --run flag to filter the test cases. Filtering works similar to the go test command. For example, to run only tests for eth_getBlockByHash and eth_getBlockByNumber, use this command:

> ./workload test --sepolia --run History/getBlockBy http://host:8545

Regenerating tests

There is a facility for updating the tests from the chain. This can also be used to generate the tests for a new network. As an example, to recreate tests for mainnet, run the following commands (in this directory) against a synced mainnet node:

> go run . filtergen --queries queries/filter_queries_mainnet.json http://host:8545
> go run . historygen --history-tests queries/history_mainnet.json http://host:8545