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

merge queue: embarking main (4f0746a) and [#9055 + #9058 + #8992] together #9060

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
# workflow or repository variable is configured differently. Testnet jobs change that config to
# testnet when running the image.
build:
name: Build images
name: Build CI Docker
# Skip PRs from external repositories, let them pass, and then GitHub's Merge Queue will check them
if: ${{ !startsWith(github.event_name, 'pull') || !github.event.pull_request.head.repo.fork }}
uses: ./.github/workflows/sub-build-docker-image.yml
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/sub-ci-unit-tests-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,12 @@ jobs:
# If there is already an open issue with this label, any failures become comments on that issue.
always-create-new-issue: false
github-token: ${{ secrets.GITHUB_TOKEN }}

run-check-no-git-refs:
if: contains(github.event.pull_request.labels.*.name, 'A-release')
runs-on: ubuntu-latest
steps:
- name: Run check_no_git_refs_in_cargo_lock
run: |
docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }}
docker run --tty -e NETWORK -e RUN_CHECK_NO_GIT_REFS=1 ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }}
8 changes: 6 additions & 2 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,16 @@ case "$1" in
if [[ "${RUN_ALL_TESTS}" -eq "1" ]]; then
# Run unit, basic acceptance tests, and ignored tests, only showing command output if the test fails.
# If the lightwalletd environmental variables are set, we will also run those tests.
exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES}" --workspace -- --nocapture --include-ignored
exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES}" --workspace -- --nocapture --include-ignored --skip check_no_git_refs_in_cargo_lock

elif [[ "${RUN_ALL_EXPERIMENTAL_TESTS}" -eq "1" ]]; then
# Run unit, basic acceptance tests, and ignored tests with experimental features.
# If the lightwalletd environmental variables are set, we will also run those tests.
exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES_EXPERIMENTAL}" --workspace -- --nocapture --include-ignored
exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES_EXPERIMENTAL}" --workspace -- --nocapture --include-ignored --skip check_no_git_refs_in_cargo_lock

elif [[ "${RUN_CHECK_NO_GIT_REFS}" -eq "1" ]]; then
# Run the check_no_git_refs_in_cargo_lock test.
exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES}" --workspace -- --nocapture --include-ignored check_no_git_refs_in_cargo_lock

elif [[ "${TEST_FAKE_ACTIVATION_HEIGHTS}" -eq "1" ]]; then
# Run state tests with fake activation heights.
Expand Down
8 changes: 4 additions & 4 deletions zebra-network/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,14 @@ lazy_static! {
///
/// The minimum network protocol version typically changes after Mainnet and
/// Testnet network upgrades.
// TODO: Change `Nu5` to `Nu6` after NU6 activation.
// TODO: Change `Nu6` to `Nu7` after NU7 activation.
// TODO: Move the value here to a field on `testnet::Parameters` (#8367)
pub static ref INITIAL_MIN_NETWORK_PROTOCOL_VERSION: HashMap<NetworkKind, Version> = {
let mut hash_map = HashMap::new();

hash_map.insert(NetworkKind::Mainnet, Version::min_specified_for_upgrade(&Mainnet, Nu5));
hash_map.insert(NetworkKind::Testnet, Version::min_specified_for_upgrade(&Network::new_default_testnet(), Nu5));
hash_map.insert(NetworkKind::Regtest, Version::min_specified_for_upgrade(&Network::new_regtest(None, None), Nu5));
hash_map.insert(NetworkKind::Mainnet, Version::min_specified_for_upgrade(&Mainnet, Nu6));
hash_map.insert(NetworkKind::Testnet, Version::min_specified_for_upgrade(&Network::new_default_testnet(), Nu6));
hash_map.insert(NetworkKind::Regtest, Version::min_specified_for_upgrade(&Network::new_regtest(None, None), Nu6));

hash_map
};
Expand Down
14 changes: 7 additions & 7 deletions zebra-network/src/peer_set/set/tests/vectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn peer_set_ready_single_connection() {
let peer_versions = PeerVersions {
peer_versions: vec![Version::min_specified_for_upgrade(
&Network::Mainnet,
NetworkUpgrade::Nu5,
NetworkUpgrade::Nu6,
)],
};

Expand Down Expand Up @@ -118,7 +118,7 @@ fn peer_set_ready_single_connection() {
#[test]
fn peer_set_ready_multiple_connections() {
// Use three peers with the same version
let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5);
let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6);
let peer_versions = PeerVersions {
peer_versions: vec![peer_version, peer_version, peer_version],
};
Expand Down Expand Up @@ -182,7 +182,7 @@ fn peer_set_rejects_connections_past_per_ip_limit() {
const NUM_PEER_VERSIONS: usize = crate::constants::DEFAULT_MAX_CONNS_PER_IP + 1;

// Use three peers with the same version
let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5);
let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6);
let peer_versions = PeerVersions {
peer_versions: [peer_version; NUM_PEER_VERSIONS].into_iter().collect(),
};
Expand Down Expand Up @@ -232,7 +232,7 @@ fn peer_set_route_inv_empty_registry() {
let test_hash = block::Hash([0; 32]);

// Use two peers with the same version
let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5);
let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6);
let peer_versions = PeerVersions {
peer_versions: vec![peer_version, peer_version],
};
Expand Down Expand Up @@ -315,7 +315,7 @@ fn peer_set_route_inv_advertised_registry_order(advertised_first: bool) {
let test_change = InventoryStatus::new_available(test_inv, test_peer);

// Use two peers with the same version
let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5);
let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6);
let peer_versions = PeerVersions {
peer_versions: vec![peer_version, peer_version],
};
Expand Down Expand Up @@ -423,7 +423,7 @@ fn peer_set_route_inv_missing_registry_order(missing_first: bool) {
let test_change = InventoryStatus::new_missing(test_inv, test_peer);

// Use two peers with the same version
let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5);
let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6);
let peer_versions = PeerVersions {
peer_versions: vec![peer_version, peer_version],
};
Expand Down Expand Up @@ -525,7 +525,7 @@ fn peer_set_route_inv_all_missing_fail() {
let test_change = InventoryStatus::new_missing(test_inv, test_peer);

// Use one peer
let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5);
let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6);
let peer_versions = PeerVersions {
peer_versions: vec![peer_version],
};
Expand Down
12 changes: 12 additions & 0 deletions zebrad/tests/acceptance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3538,3 +3538,15 @@ async fn nu6_funding_streams_and_coinbase_balance() -> Result<()> {

Ok(())
}

/// Check that Zebra does not depend on any crates from git sources.
#[test]
#[ignore]
fn check_no_git_refs_in_cargo_lock() {
let cargo_lock_contents =
fs::read_to_string("../Cargo.lock").expect("should have Cargo.lock file in root dir");

if cargo_lock_contents.contains(r#"source = "git+"#) {
panic!("Cargo.lock includes git sources")
}
}
Loading