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

change(network): Allow custom testnets to make peer connections and configure more parameters #8528

Merged
merged 3 commits into from
May 20, 2024

Conversation

arya2
Copy link
Contributor

@arya2 arya2 commented May 14, 2024

Motivation

We want to support configuring more custom testnet parameters and to allow Zebra to make peer connections on custom testnets.

Depends-On: #8524

PR Author Checklist

Check before marking the PR as ready for review:

  • Will the PR name make sense to users?
  • Does the PR have a priority label?
  • Have you added or updated tests?
  • Is the documentation up to date?
For significant changes:
  • Is there a summary in the CHANGELOG?
  • Can these changes be split into multiple PRs?

If a checkbox isn't relevant to the PR, mark it as done.

Solution

  • Replace check for is_default_testnet() in initial_peer_hostnames() with !is_regtest()
  • Add the remaining configurable parameters in testnet::Parameters to config deserialization

Related changes:

  • Return early with an empty set from initial_peers() when network.is_regtest() (Zebra shouldn't ever add any peers to the peer cache on Regtest, because it has no initial peers, but it the file could be edited outside Zebra)

Testing

Updated the latest stored test config

Review

Anyone can review.

Reviewer Checklist

Check before approving the PR:

  • Does the PR scope match the ticket?
  • Are there enough tests to make sure it works? Do the tests cover the PR motivation?
  • Are all the PR blockers dealt with?
    PR blockers can be dealt with in new tickets or PRs.

And check the PR Author checklist is complete.

@arya2 arya2 added A-consensus Area: Consensus rule updates I-usability Zebra is hard to understand or use C-testing Category: These are tests P-Medium ⚡ labels May 14, 2024
@arya2 arya2 self-assigned this May 14, 2024
@arya2 arya2 requested review from a team as code owners May 14, 2024 21:01
@arya2 arya2 requested review from oxarbitrage and removed request for a team May 14, 2024 21:01
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label May 14, 2024
zebra-network/src/config.rs Outdated Show resolved Hide resolved
@upbqdn upbqdn self-requested a review May 16, 2024 19:25
upbqdn
upbqdn previously approved these changes May 16, 2024
Base automatically changed from params-network-magic to main May 18, 2024 20:31
@mergify mergify bot dismissed upbqdn’s stale review May 18, 2024 20:31

The base branch was changed.

arya2 and others added 3 commits May 19, 2024 09:24
@oxarbitrage
Copy link
Contributor

Using the main branch i cherry picked the relevant commits and force pushed to fix the conflicts this PR had.

@mergify mergify bot merged commit c494aa7 into main May 20, 2024
191 checks passed
@mergify mergify bot deleted the params-config-fields branch May 20, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Area: Consensus rule updates C-testing Category: These are tests C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG I-usability Zebra is hard to understand or use P-Medium ⚡
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants