Skip to content

Commit 998007e

Browse files
lightclientfjl
authored andcommitted
cmd/devp2p: update eth/snap protocol test suites for PoS (ethereum#28340)
Here we update the eth and snap protocol test suites with a new test chain, created by the hivechain tool. The new test chain uses proof-of-stake. As such, tests using PoW block propagation in the eth protocol are removed. The test suite now connects to the node under test using the engine API in order to make it accept transactions. The snap protocol test suite has been rewritten to output test descriptions and log requests more verbosely. --------- Co-authored-by: Felix Lange <[email protected]>
1 parent 5f3352c commit 998007e

30 files changed

+22738
-2083
lines changed

cmd/devp2p/README.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -108,31 +108,32 @@ Start the test by running `devp2p discv5 test -listen1 127.0.0.1 -listen2 127.0.
108108

109109
The Eth Protocol test suite is a conformance test suite for the [eth protocol][eth].
110110

111-
To run the eth protocol test suite against your implementation, the node needs to be initialized as such:
112-
113-
1. initialize the geth node with the `genesis.json` file contained in the `testdata` directory
114-
2. import the `halfchain.rlp` file in the `testdata` directory
115-
3. run geth with the following flags:
116-
```
117-
geth --datadir <datadir> --nodiscover --nat=none --networkid 19763 --verbosity 5
118-
```
119-
120-
Then, run the following command, replacing `<enode>` with the enode of the geth node:
121-
```
122-
devp2p rlpx eth-test <enode> cmd/devp2p/internal/ethtest/testdata/chain.rlp cmd/devp2p/internal/ethtest/testdata/genesis.json
123-
```
111+
To run the eth protocol test suite against your implementation, the node needs to be initialized
112+
with our test chain. The chain files are located in `./cmd/devp2p/internal/ethtest/testdata`.
113+
114+
1. initialize the geth node with the `genesis.json` file
115+
2. import blocks from `chain.rlp`
116+
3. run the client using the resulting database. For geth, use a command like the one below:
117+
118+
geth \
119+
--datadir <datadir> \
120+
--nodiscover \
121+
--nat=none \
122+
--networkid 3503995874084926 \
123+
--verbosity 5 \
124+
--authrpc.jwtsecret 0x7365637265747365637265747365637265747365637265747365637265747365
125+
126+
Note that the tests also require access to the engine API.
127+
The test suite can now be executed using the devp2p tool.
128+
129+
devp2p rlpx eth-test \
130+
--chain internal/ethtest/testdata \
131+
--node enode://.... \
132+
--engineapi http://127.0.0.1:8551 \
133+
--jwtsecret 0x7365637265747365637265747365637265747365637265747365637265747365
124134

125135
Repeat the above process (re-initialising the node) in order to run the Eth Protocol test suite again.
126136

127-
#### Eth66 Test Suite
128-
129-
The Eth66 test suite is also a conformance test suite for the eth 66 protocol version specifically.
130-
To run the eth66 protocol test suite, initialize a geth node as described above and run the following command,
131-
replacing `<enode>` with the enode of the geth node:
132-
133-
```
134-
devp2p rlpx eth66-test <enode> cmd/devp2p/internal/ethtest/testdata/chain.rlp cmd/devp2p/internal/ethtest/testdata/genesis.json
135-
```
136137

137138
[eth]: https://github.com/ethereum/devp2p/blob/master/caps/eth.md
138139
[dns-tutorial]: https://geth.ethereum.org/docs/developers/geth-developer/dns-discovery-setup

0 commit comments

Comments
 (0)