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

Make connection count limits modifiable in tests #1294

Merged

Conversation

ImplOfAnImpl
Copy link
Contributor

The constants related to the number of connections were placed into a struct ConnectionCountLimits which is a part of P2pConfig.
This is a follow-up for the PR #1292. It's not strictly necessary, but it allows to make the tests in that PR less "heavy" by reducing the number of connections that those tests have to make.

Comment on lines +88 to +91
pub preserved_inbound_count_address_group: PreservedInboundCountAddressGroup,
pub preserved_inbound_count_ping: PreservedInboundCountPing,
pub preserved_inbound_count_new_blocks: PreservedInboundCountNewBlocks,
pub preserved_inbound_count_new_transactions: PreservedInboundCountNewTransactions,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI: I ended up not needing to modify the inbound connection limits in the tests. But I decided to keep them here anyway, near their outbound counterparts, for completeness and because they may become useful in the future.

Copy link
Collaborator

@TheQuantumPhysicist TheQuantumPhysicist 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 great. I like having less global constants and putting them where they belong, especially when their effects can be tested.

Base automatically changed from peer_discovery_on_stale_tip to master October 24, 2023 17:23
@ImplOfAnImpl ImplOfAnImpl force-pushed the make_connection_count_modifiable_in_tests branch from 1e1a3ca to f6e3ade Compare October 24, 2023 17:34
@TheQuantumPhysicist TheQuantumPhysicist merged commit 8d546d4 into master Oct 24, 2023
31 checks passed
@TheQuantumPhysicist TheQuantumPhysicist deleted the make_connection_count_modifiable_in_tests branch October 24, 2023 20:10
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.

None yet

2 participants