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

Test disconnection from outdated peers on network upgrade #2

Conversation

jvff
Copy link
Owner

@jvff jvff commented Dec 9, 2021

Motivation

Zebra should disconnect from outdated peers during a network upgrade. This was implemented in ZcashFoundation#3108, and this PR contains some property tests for the implementation.

Specifications

Designs

Solution

Review

Reviewer Checklist

  • Code implements Specs and Designs
  • Tests for Expected Behaviour
  • Tests for Errors

Follow Up Work

Given an arbitrary best chain tip height, check that the calculated
minimum peer protocol version is the expected value.
Apply an arbitrary list of chain tip height updates and check that for
each update the minimum peer version is calculated correctly.
Simulate a series of best chain tip height updates, and check for
minimum peer version updates at least once between them. Changes should
only be reported once.
Used to create and then track a mock `Client` instance.
An extension method useful for tests, that contains some shared
boilerplate code.
Give a 50% chance for an arbitrary `Version` to be in the range of
previously used values the Zcash network.
Helps with the creation of mocked client services with arbitrary
protocol versions.
An auxiliary type to a `PeerSet` instance created for testing. It keeps
track of any dummy endpoints of channels created and passed to the
`PeerSet` instance.
Helps to reduce the code when preparing a `PeerSet` test instance.
Simulate a set of discovered peers being sent to the `PeerSet`. Ensure
that only up-to-date peers are kept by the `PeerSet` and that outdated
peers are dropped.
A helper type that allows the creation of arbitrary block height pairs,
where one value is before and the other is at or after the activation
height of an arbitrary network upgrade.
Simulate a network upgrade, and check that peers that become outdated
are dropped by the `PeerSet`.
@jvff jvff merged commit b07a158 into disconnect-from-outdated-peers-on-network-upgrade Dec 9, 2021
@jvff jvff deleted the test-disconnect-from-outdated-peers-on-network-upgrade branch December 9, 2021 01:17
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.

1 participant