Skip to content

Generate checkpoints in CI #6367

Closed
@teor2345

Description

Motivation

We want to generate checkpoints from the cached states in Zebra's CI, so that developers can do releases easily.

Complex Code or Requirements

  • We currently call zcash-cli in the checkpoint binary, we'll need to switch to making RPC requests directly.
  • Set up a test harness that launches zebrad with RPCs, and connects zebra-checkpoints to it. This should be simple, we have existing test code that launches zebrad with RPCs.
    • The mainnet version needs to use the cached state for efficiency, this slightly reduces our security, because we also test the checkpoints against the same cached state.
    • The testnet version can also use a new testnet cached state, failures should be ignored because testnet can be unstable.

Originally I said that testnet can do a full sync from an empty state, but it turns out that's complicated to configure in our test harness.

Testing

  • Compare manually generated checkpoints from zcashd and the checkpoints in CI.
  • Add a unit test that verifies that the generated checkpoints obey maximum checkpoint height gap, and that the minimum gap is at least 17 (the maximum checkpoint bytes divided by the maximum block size). This helps detect copy-paste mistakes.

DevOps

Testnet failures are expected occasionally, so we don't want to require that job.

Metadata

Assignees

Labels

A-devopsArea: Pipelines, CI/CD and DockerfilesA-rpcArea: Remote Procedure Call interfacesA-rustArea: Updates to Rust codeC-enhancementCategory: This is an improvementC-testingCategory: These are testsS-needs-triageStatus: A bug report needs triage

Type

No type

Projects

  • Status

    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions