-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fetching storage proofs by light client #252
Conversation
161b953 to
c6ebffb
Compare
|
[clabot:check] |
|
It looks like @svyatonik signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
pepyakin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
| let remote_block_id = BlockId::Number(0); | ||
| let remote_block_hash = remote_client.block_hash(0).unwrap().unwrap(); | ||
| let mut remote_block_header = remote_client.header(&remote_block_id).unwrap().unwrap(); | ||
| remote_block_header.state_root = remote_client.state_at(&remote_block_id).unwrap().storage_root(::std::iter::empty()).0.into(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we wrap this line?
substrate/state-machine/src/lib.rs
Outdated
| let result = proving_backend.storage(key).map_err(|e| Box::new(e) as Box<Error>)?; | ||
| Ok((result, proving_backend.extract_proof())) | ||
| } | ||
| /// Check storage read proof, generated by `prove` call. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean "generated by prove_read call"? : )
| request: &RemoteReadRequest<Block::Hash>, | ||
| remote_proof: Vec<Vec<u8>> | ||
| ) -> ClientResult<Option<Vec<u8>>> { | ||
| let local_header = self.blockchain.header(BlockId::Hash(request.block))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this happens well beyond the point where the storage request is actually issued, could the header be pruned if it takes a long time to serve the request or if the header was on the verge of being pruned when the request was issued?
substrate/state-machine/src/lib.rs
Outdated
| let result = proving_backend.storage(key).map_err(|e| Box::new(e) as Box<Error>)?; | ||
| Ok((result, proving_backend.extract_proof())) | ||
| } | ||
| /// Check storage read proof, generated by `prove_read` call. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
illegal leading space
* master: Less verbosity (#546) Fetching storage proofs by light client (#252) Gitlab CI build file for linux. (#552) Vote out offline authorities (#524) fix block body fetch for availability pruning (#539) Continue sync after ancestry search (#538) Docs Typo Fixes (#534) don't wait for all futures to resolve before shutdown (#536) Update libp2p and some log (#532) Mh public key for telemetry (#526) Td bps (#527) Reserved peers CLI flag (#528)
* storage proofs * fixed grumbles * Update lib.rs
…ossipsub Subspace networking (gossipsub)
* Move tests to module in own file * Add test-node-proc crate * Move test node to main lib, fix compilation errors * Fmt * Attempted port scanning * Use global static port to allocate open ports * Register missing type sizes * Fix port scanning and balances test * Don't wait for blocks on insert_jey test * Fmt * Remove unused dependencies * Download v3.0.0 rust binary * Move substrate bin to home dir * Add test instructions to README * Figure out the $PATH * Remove path echo * Add check for missing substrate binary on the PATH * @niklasad1 review: don't include client feature for tests
No description provided.