Skip to content

Commit

Permalink
fix: embed zktrie in rust docs using github links for images
Browse files Browse the repository at this point in the history
  • Loading branch information
frisitano committed Dec 9, 2024
1 parent 883d508 commit 1727e26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions crates/scroll/trie/assets/zktrie.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## 1. Tree Structure

<figure>
<img src="arch.png" alt="zkTrie Structure" style="width:80%">
<img src="https://raw.githubusercontent.com/scroll-tech/reth/refs/heads/scroll/crates/scroll/trie/assets/arch.png" alt="zkTrie Structure" style="width:80%">
<figcaption align = "center"><b>Figure 1. zkTrie Structure</b></figcaption>
</figure>

Expand Down Expand Up @@ -161,7 +161,7 @@ valueHash = h(storageValue[0:16], storageValue[16:32])
### 4.1 Insertion

<figure>
<img src="insertion.png" alt="zkTrie Structure" style="width:80%">
<img src="https://raw.githubusercontent.com/scroll-tech/reth/refs/heads/scroll/crates/scroll/trie/assets/insertion.png" alt="zkTrie Structure" style="width:80%">
<figcaption align = "center"><b>Figure 2. Insert a new leaf node to zkTrie</b></figcaption>
</figure>

Expand All @@ -173,7 +173,7 @@ When we insert a new leaf node to the existing zkTrie, there could be two cases
### 4.2 Deletion

<figure>
<img src="deletion.png" alt="zkTrie Structure" style="width:80%">
<img src="https://raw.githubusercontent.com/scroll-tech/reth/refs/heads/scroll/crates/scroll/trie/assets/deletion.png" alt="zkTrie Structure" style="width:80%">
<figcaption align = "center"><b>Figure 3. Delete a leaf node from the zkTrie</b></figcaption>
</figure>

Expand Down
5 changes: 4 additions & 1 deletion crates/scroll/trie/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#![doc = include_str!("../README.md")]
//! Fast binary Merkle-Patricia Trie (zktrie) state root calculator and proof generator for
//! prefix-sorted bits.
#![doc = include_str!("../assets/zktrie.md")]

#[macro_use]
#[allow(unused_imports)]
Expand Down

0 comments on commit 1727e26

Please sign in to comment.