diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0409b39d..3dea1fd7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,8 +69,8 @@ jobs: cd zebra/; docker build --build-arg SHORT_SHA=$SHORT_SHA -f docker/Dockerfile.test -t zebrad-test .; docker run -i zebrad-test cargo test --workspace --no-fail-fast -- -Zunstable-options --include-ignored; - docker run -i --mount type=bind,source=/mnt/disks/gce-containers-mounts/gce-persistent-disks/zebrad-cache-$SHORT_SHA-mainnet-419200,target=/zebrad-cache zebrad-test:latest cargo test --verbose --features test_sync_past_sapling_mainnet --manifest-path zebrad/Cargo.toml sync_past_sapling_mainnet; - docker run -i --mount type=bind,source=/mnt/disks/gce-containers-mounts/gce-persistent-disks/zebrad-cache-$SHORT_SHA-testnet-280000,target=/zebrad-cache zebrad-test:latest cargo test --verbose --features test_sync_past_sapling_testnet --manifest-path zebrad/Cargo.toml sync_past_sapling_testnet; + docker run -i --mount type=bind,source=/mnt/disks/gce-containers-mounts/gce-persistent-disks/zebrad-cache-$SHORT_SHA-mainnet-419200,target=/zebrad-cache zebrad-test:latest cargo test --verbose --features test_sync_past_canopy_mainnet --manifest-path zebrad/Cargo.toml sync_past_canopy_mainnet; + docker run -i --mount type=bind,source=/mnt/disks/gce-containers-mounts/gce-persistent-disks/zebrad-cache-$SHORT_SHA-testnet-280000,target=/zebrad-cache zebrad-test:latest cargo test --verbose --features test_sync_past_canopy_testnet --manifest-path zebrad/Cargo.toml sync_past_canopy_testnet; " # Clean up - name: Delete test instance diff --git a/zebrad/Cargo.toml b/zebrad/Cargo.toml index d66b4289..619dd89d 100644 --- a/zebrad/Cargo.toml +++ b/zebrad/Cargo.toml @@ -57,7 +57,7 @@ zebra-test = { path = "../zebra-test" } [features] enable-sentry = [] -test_sync_to_sapling_mainnet = [] -test_sync_to_sapling_testnet = [] -test_sync_past_sapling_mainnet = [] -test_sync_past_sapling_testnet = [] +test_sync_to_canopy_mainnet = [] +test_sync_to_canopy_testnet = [] +test_sync_past_canopy_mainnet = [] +test_sync_past_canopy_testnet = [] diff --git a/zebrad/tests/acceptance.rs b/zebrad/tests/acceptance.rs index fd4694dc..de9e402e 100644 --- a/zebrad/tests/acceptance.rs +++ b/zebrad/tests/acceptance.rs @@ -800,7 +800,7 @@ fn sync_until( Ok(child.dir) } -fn cached_sapling_test_config() -> Result { +fn cached_canopy_test_config() -> Result { let mut config = persistent_test_config()?; config.consensus.checkpoint_sync = true; config.state.cache_dir = "/zebrad-cache".into(); @@ -813,7 +813,7 @@ fn create_cached_database_height(network: Network, height: Height) -> Result<()> let timeout = Duration::from_secs(60 * 60 * 8); // Use a persistent state, so we can handle large syncs - let mut config = cached_sapling_test_config()?; + let mut config = cached_canopy_test_config()?; // TODO: add convenience methods? config.network.network = network; config.state.debug_stop_at_height = Some(height.0); @@ -834,12 +834,12 @@ fn create_cached_database_height(network: Network, height: Height) -> Result<()> } fn create_cached_database(network: Network) -> Result<()> { - let height = NetworkUpgrade::Sapling.activation_height(network).unwrap(); + let height = NetworkUpgrade::Canopy.activation_height(network).unwrap(); create_cached_database_height(network, height) } -fn sync_past_sapling(network: Network) -> Result<()> { - let height = NetworkUpgrade::Sapling.activation_height(network).unwrap() + 1200; +fn sync_past_canopy(network: Network) -> Result<()> { + let height = NetworkUpgrade::Canopy.activation_height(network).unwrap() + 1200; create_cached_database_height(network, height.unwrap()) } @@ -850,17 +850,17 @@ fn sync_past_sapling(network: Network) -> Result<()> { // drives populated by the first two tests, snapshot those drives, and then use // those to more quickly run the second two tests. -// Sync up to the sapling activation height on mainnet and stop. -#[cfg_attr(feature = "test_sync_to_sapling_mainnet", test)] -fn sync_to_sapling_mainnet() { +// Sync up to the canopy activation height on mainnet and stop. +#[cfg_attr(feature = "test_sync_to_canopy_mainnet", test)] +fn sync_to_canopy_mainnet() { zebra_test::init(); let network = Mainnet; create_cached_database(network).unwrap(); } -// Sync to the sapling activation height testnet and stop. -#[cfg_attr(feature = "test_sync_to_sapling_testnet", test)] -fn sync_to_sapling_testnet() { +// Sync to the canopy activation height testnet and stop. +#[cfg_attr(feature = "test_sync_to_canopy_testnet", test)] +fn sync_to_canopy_testnet() { zebra_test::init(); let network = Testnet; create_cached_database(network).unwrap(); @@ -868,26 +868,26 @@ fn sync_to_sapling_testnet() { /// Test syncing 1200 blocks (3 checkpoints) past the last checkpoint on mainnet. /// -/// This assumes that the config'd state is already synced at or near Sapling -/// activation on mainnet. If the state has already synced past Sapling +/// This assumes that the config'd state is already synced at or near Canopy +/// activation on mainnet. If the state has already synced past Canopy /// activation by 1200 blocks, it will fail. -#[cfg_attr(feature = "test_sync_past_sapling_mainnet", test)] -fn sync_past_sapling_mainnet() { +#[cfg_attr(feature = "test_sync_past_canopy_mainnet", test)] +fn sync_past_canopy_mainnet() { zebra_test::init(); let network = Mainnet; - sync_past_sapling(network).unwrap(); + sync_past_canopy(network).unwrap(); } /// Test syncing 1200 blocks (3 checkpoints) past the last checkpoint on testnet. /// -/// This assumes that the config'd state is already synced at or near Sapling -/// activation on testnet. If the state has already synced past Sapling +/// This assumes that the config'd state is already synced at or near Canopy +/// activation on testnet. If the state has already synced past Canopy /// activation by 1200 blocks, it will fail. -#[cfg_attr(feature = "test_sync_past_sapling_testnet", test)] -fn sync_past_sapling_testnet() { +#[cfg_attr(feature = "test_sync_past_canopy_testnet", test)] +fn sync_past_canopy_testnet() { zebra_test::init(); let network = Testnet; - sync_past_sapling(network).unwrap(); + sync_past_canopy(network).unwrap(); } /// Returns a random port number from the ephemeral port range.