Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: embed zktrie spec in rust docs using github links for images #71

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/net/network/src/transactions/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! announcements. Validation and filtering of announcements is network dependent.

use crate::metrics::{AnnouncedTxTypesMetrics, TxTypesCounter};
use alloy_primitives::{Signature, TxHash};
use alloy_primitives::{PrimitiveSignature, TxHash};
use derive_more::{Deref, DerefMut};
use reth_eth_wire::{
DedupPayload, Eth68TxMetadata, HandleMempoolData, PartiallyValidData, ValidAnnouncementData,
Expand All @@ -14,7 +14,7 @@ use std::{fmt, fmt::Display, mem};
use tracing::trace;

/// The size of a decoded signature in bytes.
pub const SIGNATURE_DECODED_SIZE_BYTES: usize = mem::size_of::<Signature>();
pub const SIGNATURE_DECODED_SIZE_BYTES: usize = mem::size_of::<PrimitiveSignature>();

/// Interface for validating a `(ty, size, hash)` tuple from a
/// [`NewPooledTransactionHashes68`](reth_eth_wire::NewPooledTransactionHashes68)..
Expand Down
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.

#![cfg_attr(not(doctest), doc = include_str!("../assets/zktrie.md"))]

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