Skip to content
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

Tidy Eth2Config generation at runtime #912

Merged
merged 18 commits into from Apr 2, 2020

Conversation

ackintosh
Copy link
Member

Issue Addressed

This PR closes #602 🚀

@ackintosh
Copy link
Member Author

I got the error when run cargo test --all locally (Mac):

thread 'tokio-runtime-worker-0' panicked at 'failed to open /dev/urandom: Os { code: 24, kind: Other, message: "Too many open files" }', src/libcore/result.rs:1188:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
test deposit_tree::updating ... FAILED

The error above is being addressed in #878. :octocat:

@ackintosh
Copy link
Member Author

I'm writing tests for EnvironmentBuilder::setup_eth2_config(). 📝

@paulhauner paulhauner added this to To-Do (Nice-to-Have) in Security Review Mar 15, 2020
@paulhauner paulhauner added the work-in-progress PR is a work-in-progress label Mar 17, 2020
@ackintosh ackintosh marked this pull request as ready for review March 21, 2020 03:20
@ackintosh
Copy link
Member Author

This PR is ready for review. 😃

@paulhauner paulhauner added ready-for-review The code is ready for review and removed work-in-progress PR is a work-in-progress labels Mar 22, 2020
Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

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

This looks great, thank you! This is a really gross part of the code base (my least favorite), so special thanks for dealing with that.

I only have a super minor comment and an additional "while you're there" request, if you don't mind? :)

}

match sub_cli_args.subcommand() {
("prysm", Some(_)) => {
Copy link
Member

Choose a reason for hiding this comment

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

Whilst you're here, would you mind deleting this prysm command? :)

It refers to an old testnet and we have the eth2-testnets spec to handle this now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, thank you! I'll delete the the codes that related to prysm. 💪


Btw, please let me know why lighthouse using bootstrap_enr.yaml, not bootstrap_nodes.txt that described in the guideline. 🙏💦

Copy link
Member

Choose a reason for hiding this comment

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

Btw, please let me know why lighthouse using bootstrap_enr.yaml, not bootstrap_nodes.txt that described in the guideline.

Good question! As described in this recent comment, multiaddrs (which is what's in bootstrap_nodes.txt) are not sufficient to connect the nodes, we must use ENR.

Those guidelines were produced at a time before all the clients had implemented discv5 (the service that introduces ENR).

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for the pointer and details! I understand why we must use ENR. 💡

pub fn get_eth2_testnet_config<E: EthSpec>(
testnet_dir: &Option<PathBuf>,
) -> Result<Eth2TestnetConfig<E>> {
let tesnet_config = if let Some(testnet_dir) = testnet_dir {
Copy link
Member

Choose a reason for hiding this comment

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

This might have just been copy-pasta legacy code, but I think we can do away with the let testnet_config == and Ok(testnet_config) here.

@paulhauner paulhauner added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Mar 23, 2020
@ackintosh
Copy link
Member Author

I have updated this PR! Please have another look when you have time. 😌

Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

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

Looks great, thank you! Apologies for the delay on the review, we're in the middle of a big spec update!

@paulhauner
Copy link
Member

I've just triggered CI, this is good to merge once it passes!

@paulhauner paulhauner added under-review A reviewer has only partially completed a review. and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Mar 29, 2020
@ackintosh
Copy link
Member Author

Thank you for your review!

@paulhauner paulhauner added ready-to-squerge and removed under-review A reviewer has only partially completed a review. labels Apr 2, 2020
@paulhauner paulhauner merged commit 93bcee1 into sigp:master Apr 2, 2020
@ackintosh ackintosh deleted the tidy-eth2config-generation branch May 5, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Security Review
To-Do (Nice-to-Have)
Development

Successfully merging this pull request may close these issues.

Tidy Eth2Config generation at runtime
2 participants