From d7779166399ab0cd87ab16cd1b9b2d70617cf1db Mon Sep 17 00:00:00 2001 From: Alexander Hentschel Date: Mon, 12 Feb 2024 18:26:44 -0800 Subject: [PATCH 1/3] minior doc update --- model/flow/chunk.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/model/flow/chunk.go b/model/flow/chunk.go index 6baf6e193c3..b27b69f1c43 100644 --- a/model/flow/chunk.go +++ b/model/flow/chunk.go @@ -60,14 +60,18 @@ func (ch *Chunk) Checksum() Identifier { // ChunkDataPack holds all register touches (any read, or write). // -// Note that we have to capture a read proof for each write before updating the registers. -// `Proof` includes proofs for all registers read to execute the chunk. +// Note that we have to include a merkle path for all registers touched (read or written) for +// the _starting_ state of the chunk (i.e. before the chunk computation updates the registers). +// This is necessary for Verification Nodes to (i) check that the read register values are +// consistent with the starting state's root hash and (ii) verify the correctness of the resulting +// state after the chunk computation. `Proof` includes merkle proofs for all touched registers +// during the execution of the chunk. // Register proofs order must not be correlated to the order of register reads during // the chunk execution in order to enforce the SPoCK secret high entropy. type ChunkDataPack struct { ChunkID Identifier // ID of the chunk this data pack is for StartState StateCommitment // commitment for starting state - Proof StorageProof // proof for all registers read during the chunk execution + Proof StorageProof // proof for all registers touched (read or written) during the chunk execution Collection *Collection // collection executed in this chunk // ExecutionDataRoot is the root data structure of an execution_data.BlockExecutionData. From 45c73fbaa114399d5098fbbfef98de3148cdae1c Mon Sep 17 00:00:00 2001 From: Alexander Hentschel Date: Wed, 14 Feb 2024 12:02:39 -0800 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Leo Zhang --- model/flow/chunk.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/model/flow/chunk.go b/model/flow/chunk.go index b27b69f1c43..7303ff9602d 100644 --- a/model/flow/chunk.go +++ b/model/flow/chunk.go @@ -60,8 +60,15 @@ func (ch *Chunk) Checksum() Identifier { // ChunkDataPack holds all register touches (any read, or write). // -// Note that we have to include a merkle path for all registers touched (read or written) for +// Note that we have to include merkle paths as storage proof for all registers touched (read or written) for // the _starting_ state of the chunk (i.e. before the chunk computation updates the registers). +// For instance, if an execution state contains three registers: { A: 1, B: 2, C: 3}, and a certain +// chunk has a tx to execute A = A + B, then its chunk data pack should include the merkle +// paths for { A: 1, B: 2 } as storage proof. +// C is not included because it's neither read or written by the chunk. +// B is included because it's read by the chunk. +// A is included because it's updated by the chunk, and its value 1 is included because it's +// the value before the chunk computation. // This is necessary for Verification Nodes to (i) check that the read register values are // consistent with the starting state's root hash and (ii) verify the correctness of the resulting // state after the chunk computation. `Proof` includes merkle proofs for all touched registers From a0fff1abba46623f38f87b5f46c62d2768a93130 Mon Sep 17 00:00:00 2001 From: Alexander Hentschel Date: Mon, 4 Mar 2024 11:05:22 -0800 Subject: [PATCH 3/3] updated comment --- model/flow/chunk.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/model/flow/chunk.go b/model/flow/chunk.go index 7303ff9602d..aab8179eb05 100644 --- a/model/flow/chunk.go +++ b/model/flow/chunk.go @@ -62,9 +62,9 @@ func (ch *Chunk) Checksum() Identifier { // // Note that we have to include merkle paths as storage proof for all registers touched (read or written) for // the _starting_ state of the chunk (i.e. before the chunk computation updates the registers). -// For instance, if an execution state contains three registers: { A: 1, B: 2, C: 3}, and a certain -// chunk has a tx to execute A = A + B, then its chunk data pack should include the merkle -// paths for { A: 1, B: 2 } as storage proof. +// For instance, if an execution state contains three registers: { A: 1, B: 2, C: 3}, and a certain +// chunk has a tx that assigns A = A + B, then its chunk data pack should include the merkle +// paths for { A: 1, B: 2 } as storage proof. // C is not included because it's neither read or written by the chunk. // B is included because it's read by the chunk. // A is included because it's updated by the chunk, and its value 1 is included because it's