[Merged by Bors] - Create a local testnet#2614
[Merged by Bors] - Create a local testnet#2614winksaville wants to merge 5 commits intosigp:unstablefrom
Conversation
The testnet will be on the local computer and have 1 eth1 node, 4 beacon nodes, 1 validator with 20 vc's.
pawanjay176
left a comment
There was a problem hiding this comment.
This is awesome! thanks for doing this :)
Just a few small changes.
The default is a the testnet will have 1 eth1 node, 4 beacon nodes, with 20 validators per node and 1 validator client using the 20 associated with beacon node 1.
@pawanjay176, I made your suggested changes and tweaked a few other things plus added some initial documentation, txs for the review! |
pawanjay176
left a comment
There was a problem hiding this comment.
A few more nits.
Also, I think we should still keep the instructions to run the individual scripts (setup, bootnode, ganache, beacon, validator) after the instructions to run with start_local_testnet
scripts/local_testnet/README.md
Outdated
| ```bash | ||
| ./bootnode.sh | ||
| ``` | ||
| This script takes two options `-c VC_COUNT` and `-d DEBUG_LEVEL`. |
There was a problem hiding this comment.
| This script takes two options `-c VC_COUNT` and `-d DEBUG_LEVEL`. | |
| The `start_local_testnet.sh` script takes two options `-c VC_COUNT` and `-d DEBUG_LEVEL`. |
There was a problem hiding this comment.
Done, but changed -c to -v
scripts/local_testnet/beacon_node.sh
Outdated
| exec lighthouse \ | ||
| --debug-level $DEBUG_LEVEL \ | ||
| bn \ | ||
| --subscribe-all-subnets \ |
There was a problem hiding this comment.
Not sure why this option was added. I don't think this should be present by default.
There was a problem hiding this comment.
@michaelsproul suggested I do that as it was needed when only using one vc. I've made it option -s.
| # Number of seconds to delay to start genesis block. | ||
| # If started by a script this can be 0, if starting by hand | ||
| # use something like 180. | ||
| GENESIS_DELAY=0 |
There was a problem hiding this comment.
I think this should be >0 by default (60secs maybe?) as we usually also want to check genesis as well when running local testnets.
There was a problem hiding this comment.
GENESIS_DELAY=0 appears to work and long values just forces the user to wait longer before "regular" work/output from BN's and VC's. I could make it an option to start_local_testnet.sh and make have it default to 0 or a small number if 0 is wrong. The simplest option is to leave it at the some minimum value, 0, and when a developer needs to "check genesis" they can change vars.env.
What would you like to do?
There was a problem hiding this comment.
I'm happy with genesis delay 0, tweaking vars.env is always an option.
README.md - Added back the original manual creation docs - Some cleanup beacon_node.sh - Add command line Options so as to allow --subscribe-all-subnets to be controlled by caller - Handle positional parameters using $ORIND from getopts setup.sh -Rename NODE_COUNT to BN_COUNT start_local_testnet.sh - rename -c to -v for VC_COUNT - Clean up -h - Use VC_COUNT and BN_COUNT - Use bn as for loop variable
winksaville
left a comment
There was a problem hiding this comment.
@pawanjay176, I believe I've address all of your comments except setting GENESIS_DELAY to zero, see my comment.
On a similar note, in start_local_testnet.sh I've got 3 sleeping x function calls and this is very fragile, what would you suggest as an alternatives solution?
scripts/local_testnet/README.md
Outdated
| ```bash | ||
| ./bootnode.sh | ||
| ``` | ||
| This script takes two options `-c VC_COUNT` and `-d DEBUG_LEVEL`. |
There was a problem hiding this comment.
Done, but changed -c to -v
scripts/local_testnet/beacon_node.sh
Outdated
| exec lighthouse \ | ||
| --debug-level $DEBUG_LEVEL \ | ||
| bn \ | ||
| --subscribe-all-subnets \ |
There was a problem hiding this comment.
@michaelsproul suggested I do that as it was needed when only using one vc. I've made it option -s.
| # Number of seconds to delay to start genesis block. | ||
| # If started by a script this can be 0, if starting by hand | ||
| # use something like 180. | ||
| GENESIS_DELAY=0 |
There was a problem hiding this comment.
GENESIS_DELAY=0 appears to work and long values just forces the user to wait longer before "regular" work/output from BN's and VC's. I could make it an option to start_local_testnet.sh and make have it default to 0 or a small number if 0 is wrong. The simplest option is to leave it at the some minimum value, 0, and when a developer needs to "check genesis" they can change vars.env.
What would you like to do?
|
@pawanjay176 @michaelsproul do either of you or anyone else have any other suggestions for changes? One outstanding issue is what to do about GENESIS_DELAY, see a small discussion starts here. |
michaelsproul
left a comment
There was a problem hiding this comment.
Looks good!
Tested it locally and I'm happy with it. Happy to merge once typos are corrected
| # Number of seconds to delay to start genesis block. | ||
| # If started by a script this can be 0, if starting by hand | ||
| # use something like 180. | ||
| GENESIS_DELAY=0 |
There was a problem hiding this comment.
I'm happy with genesis delay 0, tweaking vars.env is always an option.
|
bors r+ |
The testnet will be on the local computer and have 1 eth1 node, 4 beacon nodes, 1 validator with 20 vc's.
|
The doppelganger protection tests are failing due to the BN_COUNT rename. We can merge once that's fixed, but I'm going to drop this PR from the current batch (and the v2.0.0-rc.0) |
|
bors r- |
|
Canceled. |
|
Made `tests/vars.env` identical to `local_testnet/vars.env` except for adding `VC_ARGS= --enable-doppelganger-protection ". This was needed because of the renaming of NODE_COUNT to BN_COUNT.
Fixed! |
michaelsproul
left a comment
There was a problem hiding this comment.
Great. Will merge this after v2.0.0-rc.0 merges.
|
bors r+ |
The testnet will be on the local computer and have 1 eth1 node, 4 beacon nodes, 1 validator with 20 vc's.
|
Pull request successfully merged into unstable. Build succeeded: |
The testnet will be on the local computer and have 1 eth1 node,
4 beacon nodes, 1 validator with 20 vc's.