-
Notifications
You must be signed in to change notification settings - Fork 773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pre-shanghai: Shandong/EOF testnet setup #2316
Conversation
Codecov Report
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
48ceea3
to
070165d
Compare
|
||
// ------------EIP 3670 tests------------------------------- | ||
t.test(' EIP 3670 tests', async (st) => { | ||
const data = '0x67EF0001010001006060005260086018F3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we get a description to whatever is being tested here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, great work, some questions!
dc8a56f
to
e2e7e82
Compare
e2e7e82
to
75350f4
Compare
075686a
to
79762da
Compare
828e0a3
to
e23ebf4
Compare
290b6db
to
4fda8f6
Compare
916d052
to
4ed42ba
Compare
f18c2c9
to
4361d5f
Compare
be70b88
to
abb5ed0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Eof sim setup
This sim test is to setup a single ethereumjs<>lodestar instance to allow executing testvectors for the EIPs targetting Shanghai hardfork.
EIP(s) testing
Target EIPs are:
3540,3651,3670,3855,3860
Prerequisite(s)
sudo
, else prefixsudo
in from of docker commands intest/sim/single-run.sh
docker
and install directly install and use lodestar binary as instructed belowHow to run
npm install
theethereumjs-monorepo
cd packages/client
docker pull chainsafe/lodestar:latest
, for MAC users:npm install -g @chainsafe/lodestar:latest
jq
is not installeddata/eof
(or any other place convinient for you).There are three ways to run tests with varying degree of automation:
Fully automated sim run
Just run:
for MAC add extra env variable
LODE_BINARY="lodestar"
(orLODE_BINARY="npx lodestar"
if you didn't install lodestar globally) , i.e.It will auto run the script to run custom network, run tests and in end tear it down. You can modify
test/sim/eof.spec.ts
transaction scenarios to test your custom functionality.Semi-Auto run using script to start custom network
Currently you can just start the local instance by
DATADIR=data/eof test/sim/./single-run.sh
MAC users:
DATADIR=data/eof LODE_BINARY="lodestar" test/sim/./single-run.sh
This command run should start both ethereumjs and lodestar in terminal. Soon you should see lodestar driving ethereumjs in PoS configuration.
Once the network looks synced to you, you can run tests:
Manual run to setup network
rm -rf data/eof/*
) in start of each run and domkdir data/eof/ethereumjs && mkdir data/eof/lodestar
npm run client:start -- --datadir data/eof/ethereumjs --gethGenesis test/sim/configs/geth-genesis.json --rpc --rpcEngine --rpcEngineAuth false
ethereumjs
client:Currently it should give you
0x3feda37f61eaa3d50deaa39cf04e352af0b54c521b0f16d26f826b54edeef756
date +%s
and add30
to it which gives you current time +30
seconds for e.g.1664538222
--genesisTime
:docker run --rm --name beacon --network host chainsafe/lodestar:latest dev --dataDir data/eof/lodestar --genesisValidators 8 --startValidators 0..7 --enr.ip 127.0.0.1 --genesisEth1Hash 0x3feda37f61eaa3d50deaa39cf04e352af0b54c521b0f16d26f826b54edeef756 --params.ALTAIR_FORK_EPOCH 0 --params.BELLATRIX_FORK_EPOCH 0 --params.TERMINAL_TOTAL_DIFFICULTY 0x01 --genesisTime 1664538222
For MAC users:
lodestar dev --dataDir data/eof/lodestar --genesisValidators 8 --startValidators 0..7 --enr.ip 127.0.0.1 --genesisEth1Hash $GENESIS_HASH --params.ALTAIR_FORK_EPOCH 0 --params.BELLATRIX_FORK_EPOCH 0 --params.TERMINAL_TOTAL_DIFFICULTY 0x01 --genesisTime 1664538222
Test the sim tests using the set network as:
Custom Transaction testing/development
You may want to do your own custom transaction development/testing to target the EIP functionality in the hardfork. Using Semi Auto network script or via Manual network setup steps, you may start
ethereumjs<>lodestar
custom network.Ethereumjs rpc endpoint should now be available at
http://127.0.0.1:8545
for you to play with!happy Testing the Shanghai!
Process cleanup
The script should auto clean the processes. In case it fails to do so:
docker rm -f beacon
ps -a | grep client
and dokill <process id>
Multi peer setup
Start peer 1
As soon as you see lodestar started and see a count down to genesis, you can start peer 2:
(Pls use lodestar stable version i.e.
latest
tag, if you omitLODE_BINARY
thenchainsafe/lodestar:latest
docker image will be used)TODOs: (cc: @holgerd77 )
Extract total difficulty from the genesis to pass to lodestar instead of hardcoding [@g11tech]NOT relevant for CI spec run