You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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
Designs
#2425
https://github.com/ZcashFoundation/zebra/blob/main/book/src/dev/rfcs/drafts/0005-treestate.md
#1320
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 anOk()
, 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
The text was updated successfully, but these errors were encountered: