Skip to content

perf: Stop expensive cryptographic validation when deserializing shielded transactions #7939

Open

Description

Motivation

Zebra's transaction deserialization does a lot of CPU-heavy cryptography for shielded transactions.

Since we know that transactions in our database are valid, we can deserialize them without checking the validity of curve points.

API Reference

TODO: which methods are causing this CPU usage, and what can they be replaced with?

Detailed Analysis

See #4583 (comment)

Designs

In zebra-chain:

  • split out transaction deserialisation methods that optionally do validation
  • do validation by default in ZcashDeserialize (with transactions and blocks from the network and RPCs)

In zebra-state:

  • skip validation for transactions and blocks when reading from the state in FromBytes

Related Work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-blockchain-scannerArea: Blockchain scanner of shielded transactionsA-stateArea: State / database changesC-bugCategory: This is a bugI-slowProblems with performance or responsivenessS-needs-triageStatus: A bug report needs triage

    Type

    No type

    Projects

    • Status

      New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions