What gets written
- Update history, one segment per UTC day, starting from the genesis of the network.
- ACS snapshots, the daily snapshot that Scan takes at 00:00 UTC.
- Every file exists in two encodings,
ledger_api_jsonandprotobuf_json, as zstd-compressed newline-delimited JSON. Files are split at about 128 MiB.
Staging and committed buckets
Each SV needs two buckets:- Staging. Scan writes every file here first, then compares its checksums with other SVs’ Scans.
- Committed. Once enough SVs report the same checksums, Scan copies the files from staging to committed and deletes them from staging. Files in committed are never overwritten or deleted by Scan.
Buckets and credentials
Create the two buckets in an S3-compatible object store reachable from the Scan pod. On Google Cloud Storage, use the endpointhttps://storage.googleapis.com with HMAC keys.
On AWS S3, use the Region-specific endpoint https://s3.<region>.amazonaws.com with the bucket’s region.
Scan accesses each bucket with the credentials configured for it. You can use one service account for both buckets,
or one per bucket. Grant:
With a single service account for both buckets, grant it both rows.
Giving the committed credentials no delete or overwrite permission protects the published files against mistakes.
On AWS S3, permissions cannot separate creating from overwriting an object. Enable versioning on the committed bucket
to keep every version, or S3 Object Lock with a default retention period to prevent overwrites and deletions. Do not
enforce conditional writes with a bucket policy: Scan copies files into the committed bucket with CopyObject without
conditional headers, which such a policy rejects.
Store the HMAC keys in Kubernetes secrets, with the keys
accessKey and secretAccessKey:
Configuration
Uncomment thebulkStorage section in the values of the splice-scan Helm chart (scan-values.yaml), fill in the
buckets, and upgrade the release:
staging and committed are set.
Checking that it works
Within minutes of the upgrade, objects appear in the staging bucket, under one folder per day from genesis on. Scan logs these lines at INFO level:UpdateHistoryBulkStorageStaging startsandAcsSnapshotBulkStorageStaging startswhen the export starts.Successfully completed processing updates segment ...for every day written.Successfully completed processing snapshots up to timestamp ...for every snapshot written.
splice_history_bulk_storage_latest_updates_segment_staging,
..._latest_updates_segment_committed, ..._latest_acs_snapshot_staging and ..._latest_acs_snapshot_committed.
Errors that need attention: Checksums do not match for objects ... and Could not reach consensus on checksums ....