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

Validate Sprout anchors in non-finalized state #3043

Closed
2 tasks
mpguerra opened this issue Nov 9, 2021 · 1 comment · Fixed by #3123
Closed
2 tasks

Validate Sprout anchors in non-finalized state #3043

mpguerra opened this issue Nov 9, 2021 · 1 comment · Fixed by #3123
Assignees
Labels
NU Sprout Network Upgrade: Sprout specific tasks (before Overwinter)

Comments

@mpguerra
Copy link
Contributor

mpguerra commented Nov 9, 2021

Motivation

Once we are calculating the Sprout note commitment trees and tracking the roots of those trees as they exist for a validated block, we can use that to look them up when validating that the anchors in new transaction refer to treestates we have validated.

Specifications

image

Designs

#2425
https://github.com/ZcashFoundation/zebra/blob/main/book/src/dev/rfcs/drafts/0005-treestate.md
#1320

  • Validate anchors in the non-finalized state for:
    • Sprout

Not in the transaction verifier, for this ticket.

State Query Design

In the transaction verifier service, with access to an instance of the state service, when Orchard Action, Sapling Spend, and JoinSplit anchors are parsed out, make a Request::AwaitAnchor request, and make sure that returns with an Ok() , along with all the other async checks.

We need to make sure we are looking up anchors in the set of valid roots for this transaction's chain. This requires some design work.

Alternative Design

Check the anchors in the non-finalized state, when updating the chain (UpdateWith<Transaction>).

Interstitial Sprout Anchors

For Sprout, interstitial treestates between JoinSplits in the same transaction are legal. For this piece of work, we can skip doing that for now, and just try to look up anchors in the set of Sprout roots at the end of blocks, which are also valid possible anchors. As part of this work, we should log loudly if we see a Sprout anchor that we try to look up and do not find in our state, as it may not be an invalid anchor, it may be an interstitial one we aren't computing yet.

As an alternative, we could split the sprout work out of this ticket, and only check sprout anchors after we've implemented interstitial treestates.

Related Work

Blocked on #2458 merging

@mpguerra mpguerra added C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage labels Nov 9, 2021
@mpguerra mpguerra added this to the 2021 Sprint 23 milestone Nov 9, 2021
@dconnolly dconnolly added NU Sprout Network Upgrade: Sprout specific tasks (before Overwinter) P-Medium and removed C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage labels Nov 15, 2021
@dconnolly
Copy link
Contributor

I will help push this forward too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NU Sprout Network Upgrade: Sprout specific tasks (before Overwinter)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants