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

fix: remove filops snapshot provider and fix ci #3878

Merged
merged 3 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@

### Removed

- [#3878](https://github.com/ChainSafe/forest/issues/3878): FILOps is no longer
serving lite snapshots. Removed `filops` option from
`forest-tool snapshot fetch --vendor [vendor]`.

### Fixed

## Forest 0.16.4 "Speedy Gonzales"
Expand Down
42 changes: 0 additions & 42 deletions scripts/tests/forest_cli_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,48 +25,6 @@ function num-files-here() {
"$FOREST_TOOL_PATH" db destroy --chain calibnet --force
"$FOREST_TOOL_PATH" db destroy --chain calibnet --force


: fetch snapshot
pushd "$(mktemp --directory)"
"$FOREST_TOOL_PATH" snapshot fetch --chain calibnet --vendor forest
"$FOREST_TOOL_PATH" snapshot fetch --chain calibnet --vendor filops
# this will fail if they happen to have the same height - we should change the format of our filenames
test "$(num-files-here)" -eq 2

: verify that we are byte-for-byte identical with filops
zstd -d filops_*.car.zst
"$FOREST_TOOL_PATH" archive export filops_*.car -o exported_snapshot.car.zst
zstd -d exported_snapshot.car.zst
cmp --silent filops_*.car exported_snapshot.car

: verify that the exported snapshot is in ForestCAR.zst format
assert_eq "$(forest_query_format exported_snapshot.car.zst)" "ForestCARv1.zst"

# There are a bunch of tests that need fixing, disabling for now.
# See https://github.com/ChainSafe/forest/issues/3518.
#: verify that diff exports contain the expected number of state roots
#EPOCH=$(forest_query_epoch exported_snapshot.car.zst)
#"$FOREST_TOOL_PATH" archive export --epoch $((EPOCH-1100)) --depth 900 --output-path base_snapshot.forest.car.zst exported_snapshot.car.zst

#BASE_EPOCH=$(forest_query_epoch base_snapshot.forest.car.zst)
#assert_eq "$BASE_EPOCH" $((EPOCH-1100))

# This assertion is not true in the presence of null tipsets
#BASE_STATE_ROOTS=$(forest_query_state_roots base_snapshot.forest.car.zst)
#assert_eq "$BASE_STATE_ROOTS" 900

#"$FOREST_TOOL_PATH" archive export --diff "$BASE_EPOCH" -o diff_snapshot.forest.car.zst exported_snapshot.car.zst
# This assertion is not true in the presence of null tipsets
#DIFF_STATE_ROOTS=$(forest_query_state_roots diff_snapshot.forest.car.zst)
#assert_eq "$DIFF_STATE_ROOTS" 1100

#: Validate the union of a snapshot and a diff
#"$FOREST_TOOL_PATH" snapshot validate --check-network calibnet base_snapshot.forest.car.zst diff_snapshot.forest.car.zst
rm -- *
popd



: validate latest calibnet snapshot
pushd "$(mktemp --directory)"
: : fetch a compressed calibnet snapshot
Expand Down
12 changes: 1 addition & 11 deletions src/cli_shared/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ use crate::cli_shared::snapshot::parse::ParsedFilename;
pub enum TrustedVendor {
#[default]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Keeps TrustedVendor to allow new snapshot providers in the future

Forest,
Filops,
}

/// Create a filename in the "full" format. See [`parse`].
Expand Down Expand Up @@ -161,22 +160,13 @@ define_urls!(
const FOREST_MAINNET_COMPRESSED: &str = "https://forest-archive.chainsafe.dev/latest/mainnet/";
const FOREST_CALIBNET_COMPRESSED: &str =
"https://forest-archive.chainsafe.dev/latest/calibnet/";
const FILOPS_MAINNET_COMPRESSED: &str =
"https://snapshots.mainnet.filops.net/minimal/latest.zst";
const FILOPS_CALIBNET_COMPRESSED: &str =
"https://snapshots.calibrationnet.filops.net/minimal/latest.zst";
);

pub fn stable_url(vendor: TrustedVendor, chain: &NetworkChain) -> anyhow::Result<Url> {
let s = match (vendor, chain) {
(TrustedVendor::Forest, NetworkChain::Mainnet) => FOREST_MAINNET_COMPRESSED,
(TrustedVendor::Forest, NetworkChain::Calibnet) => FOREST_CALIBNET_COMPRESSED,
(TrustedVendor::Filops, NetworkChain::Mainnet) => FILOPS_MAINNET_COMPRESSED,
(TrustedVendor::Filops, NetworkChain::Calibnet) => FILOPS_CALIBNET_COMPRESSED,
(
TrustedVendor::Forest | TrustedVendor::Filops,
NetworkChain::Butterflynet | NetworkChain::Devnet(_),
) => {
(TrustedVendor::Forest, NetworkChain::Butterflynet | NetworkChain::Devnet(_)) => {
bail!("unsupported chain {chain}")
}
};
Expand Down
Loading