Skip to content

Commit 256b421

Browse files
committed
Update some comments
1 parent 0f43d89 commit 256b421

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

crates/subspace-fraud-proof/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ where
6161
execution_phase: &ExecutionPhase,
6262
delta_changes: Option<(DB, Block::Hash)>,
6363
) -> sp_blockchain::Result<StorageProof> {
64-
// TODO: fetch the runtime code properly.
64+
// TODO: fetch the runtime code from the primary chain instead of the local state.
6565
let state = self.backend.state_at(at)?;
6666

6767
let trie_backend = state.as_trie_backend().ok_or_else(|| {
@@ -74,6 +74,8 @@ where
7474
.runtime_code()
7575
.map_err(sp_blockchain::Error::RuntimeCode)?;
7676

77+
// TODO: avoid using the String API specified by `proving_method()`
78+
// https://github.com/paritytech/substrate/discussions/11095
7779
if let Some((delta, post_delta_root)) = delta_changes {
7880
let delta_backend = create_delta_backend(trie_backend, delta, post_delta_root);
7981
sp_state_machine::prove_execution_on_trie_backend(
@@ -114,7 +116,7 @@ where
114116
pre_execution_root: H256,
115117
proof: StorageProof,
116118
) -> sp_blockchain::Result<Vec<u8>> {
117-
// TODO: fetch the runtime code properly.
119+
// TODO: fetch the runtime code from the primary chain instead of the local state.
118120
let state = self.backend.state_at(at)?;
119121

120122
let trie_backend = state.as_trie_backend().ok_or_else(|| {

cumulus/client/cirrus-executor/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,6 @@ where
341341

342342
let delta = storage_changes.transaction;
343343
let post_delta_root = storage_changes.transaction_storage_root;
344-
// TODO: way to call some runtime api against any specific state instead of having
345-
// to work with String API directly.
346344
let execution_proof = prover.prove_execution(
347345
BlockId::Hash(parent_header.hash()),
348346
&execution_phase,
@@ -614,8 +612,6 @@ where
614612
let execution_phase =
615613
ExecutionPhase::InitializeBlock { call_data: new_header.encode() };
616614

617-
// TODO: way to call some runtime api against any specific state instead of having
618-
// to work with String API directly.
619615
let proof = prover.prove_execution::<TransactionFor<Backend, Block>>(
620616
BlockId::Hash(parent_header.hash()),
621617
&execution_phase,
@@ -650,8 +646,6 @@ where
650646
let delta = storage_changes.transaction;
651647
let post_delta_root = storage_changes.transaction_storage_root;
652648

653-
// TODO: way to call some runtime api against any specific state instead of having
654-
// to work with String API directly.
655649
let proof = prover.prove_execution(
656650
BlockId::Hash(parent_header.hash()),
657651
&execution_phase,

cumulus/client/cirrus-executor/src/tests.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ async fn execution_proof_creation_and_verification_should_work() {
183183
)
184184
.expect("Create `initialize_block` proof");
185185

186-
// Test `initialize_block` verification on executor.
186+
// Test `initialize_block` verification.
187187
let execution_result = prover
188188
.check_execution_proof(
189189
BlockId::Hash(parent_header.hash()),
@@ -196,7 +196,6 @@ async fn execution_proof_creation_and_verification_should_work() {
196196
execution_phase.decode_execution_result::<Header>(execution_result).unwrap();
197197
assert_eq!(post_execution_root, intermediate_roots[0].into());
198198

199-
// Test `initialize_block` verification on farmer.
200199
let proof_verifier = subspace_fraud_proof::ProofVerifier::new(
201200
alice.client.clone(),
202201
alice.backend.clone(),
@@ -240,7 +239,7 @@ async fn execution_proof_creation_and_verification_should_work() {
240239
let target_trace_root: Hash = intermediate_roots[target_extrinsic_index].into();
241240
assert_eq!(target_trace_root, post_delta_root);
242241

243-
// Test `apply_extrinsic` verification on executor.
242+
// Test `apply_extrinsic` verification.
244243
let execution_result = prover
245244
.check_execution_proof(
246245
BlockId::Hash(parent_header.hash()),
@@ -253,7 +252,6 @@ async fn execution_proof_creation_and_verification_should_work() {
253252
execution_phase.decode_execution_result::<Header>(execution_result).unwrap();
254253
assert_eq!(post_execution_root, intermediate_roots[target_extrinsic_index + 1].into());
255254

256-
// Test `apply_extrinsic` verification on farmer.
257255
let fraud_proof = FraudProof {
258256
parent_hash: parent_hash_alice,
259257
pre_state_root: intermediate_roots[target_extrinsic_index].into(),
@@ -284,7 +282,7 @@ async fn execution_proof_creation_and_verification_should_work() {
284282
)
285283
.expect("Create `finalize_block` proof");
286284

287-
// Test `finalize_block` verification on executor.
285+
// Test `finalize_block` verification.
288286
let execution_result = prover
289287
.check_execution_proof(
290288
BlockId::Hash(parent_header.hash()),
@@ -297,7 +295,6 @@ async fn execution_proof_creation_and_verification_should_work() {
297295
execution_phase.decode_execution_result::<Header>(execution_result).unwrap();
298296
assert_eq!(post_execution_root, *header.state_root());
299297

300-
// Test `finalize_block` verification on farmer.
301298
let fraud_proof = FraudProof {
302299
parent_hash: parent_hash_alice,
303300
pre_state_root: intermediate_roots.last().unwrap().into(),

0 commit comments

Comments
 (0)