mirror of
https://github.com/logos-blockchain/logos-blockchain-pocs.git
synced 2026-05-27 19:59:32 +00:00
Provide state roots instead of whole state (#33)
This commit is contained in:
parent
5fd3c299c1
commit
ff0afeebd7
@ -165,7 +165,7 @@ pub fn prove_zone_fund_constraint(
|
|||||||
let private_inputs = SpendFundsPrivate {
|
let private_inputs = SpendFundsPrivate {
|
||||||
in_zone_funds,
|
in_zone_funds,
|
||||||
zone_note,
|
zone_note,
|
||||||
state_witness: out_zone_state.clone(),
|
state_roots: out_zone_state.state_roots(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let env = risc0_zkvm::ExecutorEnv::builder()
|
let env = risc0_zkvm::ExecutorEnv::builder()
|
||||||
|
|||||||
@ -6,6 +6,6 @@ pub struct SpendFundsPrivate {
|
|||||||
pub in_zone_funds: cl::PartialTxInputWitness,
|
pub in_zone_funds: cl::PartialTxInputWitness,
|
||||||
/// The zone note that is authorizing the spend
|
/// The zone note that is authorizing the spend
|
||||||
pub zone_note: cl::PartialTxOutputWitness,
|
pub zone_note: cl::PartialTxOutputWitness,
|
||||||
/// The state of the zone
|
/// Proof of identity of the above note
|
||||||
pub state_witness: common::StateWitness,
|
pub state_roots: common::StateRoots,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@ fn main() {
|
|||||||
let SpendFundsPrivate {
|
let SpendFundsPrivate {
|
||||||
in_zone_funds,
|
in_zone_funds,
|
||||||
zone_note,
|
zone_note,
|
||||||
state_witness,
|
state_roots,
|
||||||
} = env::read();
|
} = env::read();
|
||||||
|
|
||||||
let input_root = in_zone_funds.input_root();
|
let input_root = in_zone_funds.input_root();
|
||||||
@ -20,11 +20,8 @@ fn main() {
|
|||||||
let ptx_root = PtxRoot(merkle::node(input_root, output_root));
|
let ptx_root = PtxRoot(merkle::node(input_root, output_root));
|
||||||
|
|
||||||
// 1) Check the zone note is the correct one
|
// 1) Check the zone note is the correct one
|
||||||
assert_eq!(
|
assert_eq!(in_zone_funds.input.note.state, state_roots.zone_id);
|
||||||
in_zone_funds.input.note.state,
|
assert_eq!(zone_note.output.note.state, state_roots.commit().0);
|
||||||
state_witness.zone_metadata.id()
|
|
||||||
);
|
|
||||||
assert_eq!(zone_note.output.note.state, state_witness.commit().0);
|
|
||||||
|
|
||||||
let nf = in_zone_funds.input.nullifier();
|
let nf = in_zone_funds.input.nullifier();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user