Skip to content

Commit 11afb6e

Browse files
committed
updated comments and todos
1 parent 2b036fd commit 11afb6e

5 files changed

Lines changed: 22 additions & 1 deletion

File tree

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ edition = "2021"
3030

3131
[workspace.dependencies]
3232
incrementalmerkletree = { version = "0.8.2", features = ["legacy-api"] }
33+
# TODO: Remove the `temporary-zebra` feature once upstream `orchard` exposes the APIs
34+
# Zebra needs without this transition feature.
3335
orchard = { version = "0.12", features = ["zsa-issuance", "temporary-zebra"] }
3436
sapling-crypto = "0.6"
3537
zcash_address = "0.10.1"

zebra-chain/src/orchard_zsa/burn.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ pub(crate) fn compute_burn_value_commitment(burn: &[BurnItem]) -> ValueCommitmen
160160
.map(|&BurnItem(asset, amount)| {
161161
ValueCommitment::new(
162162
pallas::Scalar::zero(),
163+
// TODO: `amount - NoteValue::from_raw(0)` is an obscure way to widen
164+
// `NoteValue` into `ValueSum`. Replace with a direct/explicit conversion
165+
// once the upstream Orchard API exposes one.
163166
amount - NoteValue::from_raw(0),
164167
asset,
165168
)

zebra-chain/src/transaction/serialize.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,11 @@ impl ZcashSerialize for orchard::ShieldedData<OrchardZSA> {
438438
zcash_serialize_external_count(&sigs, &mut writer)?;
439439

440440
// Denoted as `valueBalanceOrchard` in the spec.
441+
// FIXME: `valueBalanceOrchard` and `bindingSigOrchard` are per-transaction fields,
442+
// not per-action-group fields. They are serialized here because today the V6
443+
// transaction has exactly one action group. Once multi-action-group support is
444+
// added (ZIP-230), move this serialization up to the caller in the V6 branch of
445+
// `Transaction::zcash_serialize`.
441446
self.value_balance.zcash_serialize(&mut writer)?;
442447

443448
// Denoted as `bindingSigOrchard` in the spec.
@@ -868,6 +873,9 @@ impl ZcashSerialize for Transaction {
868873
writer.write_u32::<LittleEndian>(expiry_height.0)?;
869874

870875
// Denoted as `zip233_amount` in the spec.
876+
// FIXME: ZIP-230 places this *after* the 8-byte `fee` field which is currently
877+
// missing (see TODO on the Transaction::V6 variant). Once `fee` is added, the
878+
// byte offset of zip233_amount will shift to match the spec.
871879
zip233_amount.zcash_serialize(&mut writer)?;
872880

873881
// Denoted as `tx_in_count` and `tx_in` in the spec.

zebra-consensus/src/transaction.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,10 @@ where
10781078
/// - the prepared `cached_ffi_transaction` used by the script verifier
10791079
/// - the sapling shielded data of the transaction, if any
10801080
/// - the orchard shielded data of the transaction, if any
1081+
// FIXME: This function performs no V6-specific issuance or burn semantic checks
1082+
// (ZIP-226 / ZIP-227). Those rules are enforced only in `zebra-state` via
1083+
// `IssuedAssetChanges::validate_and_get_changes`. Either move that validation here
1084+
// or document the contract that the state layer cannot be bypassed.
10811085
#[cfg(all(zcash_unstable = "nu7", feature = "tx_v6"))]
10821086
fn verify_v6_transaction(
10831087
request: &Request,

zebra-state/src/service/non_finalized_state/chain.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,11 @@ impl Chain {
10051005
}
10061006

10071007
#[cfg(all(zcash_unstable = "nu7", feature = "tx_v6"))]
1008-
/// Remove the History tree index at `height`.
1008+
/// Revert the issued-asset state changes recorded for a block.
1009+
///
1010+
/// At `RevertPosition::Tip`, restores `issued_assets` to the per-asset `old_state`
1011+
/// captured when the block was applied. At `RevertPosition::Root` this is a no-op
1012+
/// because finalized issuance state lives in the on-disk column family.
10091013
fn revert_issued_assets(
10101014
&mut self,
10111015
position: RevertPosition,

0 commit comments

Comments
 (0)