Skip to content

[Merged by Bors] - Create a local testnet#2614

Closed
winksaville wants to merge 5 commits intosigp:unstablefrom
winksaville:create-a-local-testnet
Closed

[Merged by Bors] - Create a local testnet#2614
winksaville wants to merge 5 commits intosigp:unstablefrom
winksaville:create-a-local-testnet

Conversation

@winksaville
Copy link
Contributor

The testnet will be on the local computer and have 1 eth1 node,
4 beacon nodes, 1 validator with 20 vc's.

The testnet will be on the local computer and have 1 eth1 node,
4 beacon nodes, 1 validator with 20 vc's.
@winksaville winksaville marked this pull request as draft September 22, 2021 23:29
Copy link
Member

@pawanjay176 pawanjay176 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@winksaville
Copy link
Contributor Author

winksaville commented Sep 23, 2021

This is awesome! thanks for doing this :)

Just a few small changes.

@pawanjay176, I made your suggested changes and tweaked a few other things plus added some initial documentation, txs for the review!

@winksaville winksaville marked this pull request as ready for review September 23, 2021 21:05
Copy link
Member

@pawanjay176 pawanjay176 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

```bash
./bootnode.sh
```
This script takes two options `-c VC_COUNT` and `-d DEBUG_LEVEL`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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`.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, but changed -c to -v

exec lighthouse \
--debug-level $DEBUG_LEVEL \
bn \
--subscribe-all-subnets \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this option was added. I don't think this should be present by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be >0 by default (60secs maybe?) as we usually also want to check genesis as well when running local testnets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

@winksaville winksaville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

```bash
./bootnode.sh
```
This script takes two options `-c VC_COUNT` and `-d DEBUG_LEVEL`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, but changed -c to -v

exec lighthouse \
--debug-level $DEBUG_LEVEL \
bn \
--subscribe-all-subnets \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@winksaville
Copy link
Contributor Author

@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.

Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with genesis delay 0, tweaking vars.env is always an option.

@michaelsproul michaelsproul added the waiting-on-author The reviewer has suggested changes and awaits thier implementation. label Sep 30, 2021
Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, let's merge!

@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. v2.0.0 Altair on mainnet release (v2.0.0) and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Sep 30, 2021
@michaelsproul
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Sep 30, 2021
The testnet will be on the local computer and have 1 eth1 node,
4 beacon nodes, 1 validator with 20 vc's.
@michaelsproul
Copy link
Member

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)

@michaelsproul
Copy link
Member

bors r-

@bors
Copy link

bors bot commented Sep 30, 2021

Canceled.

@michaelsproul michaelsproul added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-merge This PR is ready to merge. v2.0.0 Altair on mainnet release (v2.0.0) labels Sep 30, 2021
@winksaville
Copy link
Contributor Author

bors r-
Ok, I'll look at it tomorrow.

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.
@winksaville
Copy link
Contributor Author

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)

Fixed!

Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Will merge this after v2.0.0-rc.0 merges.

@michaelsproul michaelsproul added blocked ready-for-merge This PR is ready to merge. and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. blocked labels Oct 1, 2021
@michaelsproul
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Oct 1, 2021
The testnet will be on the local computer and have 1 eth1 node,
4 beacon nodes, 1 validator with 20 vc's.
@bors
Copy link

bors bot commented Oct 1, 2021

@bors bors bot changed the title Create a local testnet [Merged by Bors] - Create a local testnet Oct 1, 2021
@bors bors bot closed this Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge This PR is ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants