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

Put ListenConfig inside Discv5Config #3

Conversation

ackintosh
Copy link

@ackintosh ackintosh commented Apr 15, 2023

ref: sigp#160 (comment)

Before

// builder
let config = Discv5ConfigBuilder::default().build();
// default configuration
// let config = Dicv5Config::default();

let listen_config = ListenConfig { ... (omitted)... }

let mut discv5: Discv5 = Discv5::new(enr, enr_key, config, listen_config).unwrap();

After

  • Discv5ConfigBuilder::new() requires listen_config since ListenConfig is not optional.
  • Discv5 and Discv5ConfigBuilder no longer implement Default since we can not determine the default value for ListenConfig.
let listen_config = ListenConfig { ... (omitted)... }
let config = Discv5ConfigBuilder::new(listen_config).build();

let mut discv5: Discv5 = Discv5::new(enr, enr_key, config).unwrap();

@ackintosh
Copy link
Author

@AgeManning @divagant-martian This PR is ready for review. 🙏

@divagant-martian divagant-martian merged commit c431035 into divagant-martian:two-sockets Apr 15, 2023
@ackintosh ackintosh deleted the two-sockets-listen-config branch April 15, 2023 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants