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

SnapshotEngine: New metadata format and schema validation #530

Conversation

orcutt989
Copy link
Contributor

@orcutt989 orcutt989 commented Jan 9, 2023

This PR is a drastic change to the metadata created by the Snapshot Engine. It also provides a mechanism to validate this data via a JSON schema URL.

Changes

tezos-snapshots.json

list of all snapshots currently available at xtz-shots.io across all network names

old

[
    {
        "block_hash": "BMXiuyjbgbKuDxSJmyWcbE1WmCQ13U4jkjndNzReq8MGYFSeFaa",
        "block_height": 3132408,
        "block_timestamp": "2023-02-10T01:28:29Z",
        "filename": "tezos-mainnet-rolling-tarball-3132408.lz4",
        "url": "https://mainnet-v15.xtz-shots.io/tezos-mainnet-rolling-tarball-3132408.lz4",
        "sha256": "fc425fa78c349775ee8645c037eaf52509d5008404dba589596967a38757b9bb",
        "filesize_bytes": 4615157177,
        "filesize": "4G",
        "chain_name": "mainnet",
        "history_mode": "rolling",
        "artifact_type": "tarball",
        ...

new

{
    "date_generated": "2023-02-17T12:46:40Z",
    "org": "Oxhead Alpha",
    "$schema": "https://raw.githubusercontent.com/oxheadalpha/tezos-snapshot-metadata-schema/main/tezos-snapshot-metadata.schema.json",
    "data": [
        {
            "block_hash": "BMXiuyjbgbKuDxSJmyWcbE1WmCQ13U4jkjndNzReq8MGYFSeFaa",
            "block_height": 3132408,
            "block_timestamp": "2023-02-10T01:28:29Z",
            "filename": "tezos-mainnet-rolling-tarball-3132408.lz4",
            "url": "https://mainnet-v15.xtz-shots.io/tezos-mainnet-rolling-tarball-3132408.lz4",
            "sha256": "fc425fa78c349775ee8645c037eaf52509d5008404dba589596967a38757b9bb",
            "filesize_bytes": 4615157177,
            "filesize": "4G",
            "chain_name": "mainnet",
            "history_mode": "rolling",
            "artifact_type": "tarball",
        ...

Artifact metadata files

Each Tezos file system artifact has had its own invididual metadata file. This file is named <FILENAME>.json. We have added new informatin and fixed typing of certain fields.

old

{
  "block_hash": "BMHknnrtX9i4k7gSD7MF769vfbggimHhDEax5pkCuo5coNtPLvo",
  "block_height": 697318,
  "block_timestamp": "2023-02-17T09:55:40Z",
  "filename": "limanet-697318.rolling",
  "url": "https://limanet-v15.xtz-shots.io/limanet-697318.rolling",
  "sha256": "e59db7bb352fd005be661e17a8d9b291c0096ef4260dc4427520e30b194cbecc",
  "filesize_bytes": 116346880,
  "filesize": "110M",
  "chain_name": "limanet",
  "history_mode": "rolling",
  "artifact_type": "tezos-snapshot",
  "tezos_version": "763259c5 (2022-12-01 10:20:58 +0000) (15.1)"
}

new

{
  "block_hash": "BMHknnrtX9i4k7gSD7MF769vfbggimHhDEax5pkCuo5coNtPLvo",
  "block_height": 697318,
  "block_timestamp": "2023-02-17T09:55:40Z",
  "filename": "limanet-697318.rolling",
  "url": "https://limanet-v15.xtz-shots.io/limanet-697318.rolling",
  "sha256": "e59db7bb352fd005be661e17a8d9b291c0096ef4260dc4427520e30b194cbecc",
  "filesize_bytes": 116346880,
  "filesize": "110M",
  "chain_name": "limanet",
  "history_mode": "rolling",
  "artifact_type": "tezos-snapshot",
  "tezos_version": {
    "implementation": "octez",
    "version": {
      "major": 15,
      "minor": 1,
      "additional_info": "release"
    },
    "commit_info": {
      "commit_hash": "763259c5",
      "commit_date": "2022-12-01 10:20:58 +0000"
    }
  },
  "snapshot_version": 4
}

@itkach
Copy link

itkach commented Jan 25, 2023

lets have the json schema here as well, have the generated artifacts validated against it and have the schema published (or have schema published and fetch it here to perform validation)

@orcutt989 orcutt989 force-pushed the 527-use-new-machine-readable-octez-node-snapshot-info-for-snapshot-engine-metadata branch from 36b2565 to c640023 Compare February 13, 2023 20:39
@orcutt989 orcutt989 changed the title Add better tezos_version information to snapshot metadata SnapshotEngine: New metadata format and schema validation Feb 16, 2023
Copy link
Collaborator

@nicolasochem nicolasochem left a comment

Choose a reason for hiding this comment

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

Thanks. looks good and it's already deployed and works.

@orcutt989 orcutt989 marked this pull request as ready for review February 17, 2023 18:02
@orcutt989 orcutt989 merged commit c837cac into master Feb 17, 2023
@nicolasochem nicolasochem deleted the 527-use-new-machine-readable-octez-node-snapshot-info-for-snapshot-engine-metadata branch December 16, 2023 05:47
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.

use new machine-readable octez-node snapshot info for snapshot engine metadata
4 participants