Skip to content

Commit

Permalink
ci: private rustdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
0xaatif committed Oct 11, 2024
1 parent 13f03ad commit adeaa4e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ concurrency:

env:
CARGO_TERM_COLOR: always
BINSTALL_NO_CONFIRM: true
RUSTDOCFLAGS: "-D warnings"

jobs:
clippy:
Expand Down Expand Up @@ -42,7 +40,15 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/rust
- run: cargo doc --all --no-deps
- run: RUSTDOCFLAGS='-D warnings -A rustdoc::private_intra_doc_links' cargo doc --all --no-deps
# TODO(zero): https://github.com/0xPolygonZero/zk_evm/issues/718
- run: >
RUSTDOCFLAGS='-D warnings -A rustdoc::private_intra_doc_links' cargo doc --no-deps --document-private-items
--package trace_decoder
--package compat
--package smt_trie
--package zk_evm_proc_macro
--package zk_evm_common
cargo-fmt:
runs-on: ubuntu-latest
timeout-minutes: 5
Expand Down
9 changes: 5 additions & 4 deletions trace_decoder/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ use crate::{
TxnInfo, TxnMeta, TxnTrace,
};

/// When parsing tries from binary format, which type to deserialize as.
/// Expected trie type when parsing from binary in a [`BlockTrace`].
///
/// See [`crate::wire`] and [`CombinedPreImages`] for more.
#[derive(Debug)]
pub enum WireDisposition {
/// MPT
Expand Down Expand Up @@ -171,8 +173,7 @@ pub fn entrypoint(
/// [`HashedPartialTrie`](mpt_trie::partial_trie::HashedPartialTrie),
/// or a [`wire`](crate::wire)-encoded representation of one.
///
/// Turn either of those into our [`typed_mpt`](crate::typed_mpt)
/// representations.
/// Turn either of those into our [internal representations](crate::tries).
#[allow(clippy::type_complexity)]
fn start(
pre_images: BlockTraceTriePreImages,
Expand Down Expand Up @@ -900,7 +901,7 @@ fn map_receipt_bytes(bytes: Vec<u8>) -> anyhow::Result<Vec<u8>> {
/// If there are any txns that create contracts, then they will also
/// get added here as we process the deltas.
struct Hash2Code {
/// Key must always be [`hash`] of value.
/// Key must always be [`hash`](keccak_hash) of value.
inner: HashMap<H256, Vec<u8>>,
}

Expand Down
8 changes: 4 additions & 4 deletions trace_decoder/src/tries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ impl<T> TypedMpt<T> {
self.inner.insert(key.into_nibbles(), hash)?;
Ok(())
}
/// Returns an [`Error`] if the `key` crosses into a part of the trie that
/// isn't hydrated.
/// Returns [`Err`] if the `key` crosses into a part of the trie that
/// is hashed out.
fn insert(&mut self, key: MptKey, value: T) -> anyhow::Result<()>
where
T: rlp::Encodable + rlp::Decodable,
Expand All @@ -47,7 +47,7 @@ impl<T> TypedMpt<T> {
Ok(())
}
/// Note that this returns [`None`] if `key` crosses into a part of the
/// trie that isn't hydrated.
/// trie that is hashed out.
///
/// # Panics
/// - If [`rlp::decode`]-ing for `T` doesn't round-trip.
Expand Down Expand Up @@ -366,7 +366,7 @@ impl From<ReceiptTrie> for HashedPartialTrie {
}
}

/// TODO(0xaatif): document this after refactoring is done https://github.com/0xPolygonZero/zk_evm/issues/275
/// TODO(0xaatif): document this after refactoring is done <https://github.com/0xPolygonZero/zk_evm/issues/275>
pub trait StateTrie {
type Key;
fn insert_by_address(&mut self, address: Address, account: AccountRlp) -> anyhow::Result<()>;
Expand Down
2 changes: 1 addition & 1 deletion trace_decoder/src/type2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub fn frontend(instructions: impl IntoIterator<Item = Instruction>) -> anyhow::

/// Node in a binary (SMT) tree.
///
/// This is an intermediary type on the way to [`SmtTrie`].
/// This is an intermediary type on the way to [`StateSmt`].
enum Node {
Branch(EitherOrBoth<Box<Self>>),
Hash([u8; 32]),
Expand Down
4 changes: 2 additions & 2 deletions trace_decoder/src/wire.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! We support two wire formats:
//! - Type 1, based on [this specification](https://gist.github.com/mandrigin/ff7eccf30d0ef9c572bafcb0ab665cff#the-bytes-layout).
//! - Type 2, loosely based on [this specification](https://github.com/0xPolygonHermez/cdk-erigon/blob/d1d6b3c7a4c81c46fd995c1baa5c1f8069ff0348/turbo/trie/WITNESS.md)
//! - Type 1 (AKA MPT), based on [this specification](https://gist.github.com/mandrigin/ff7eccf30d0ef9c572bafcb0ab665cff#the-bytes-layout).
//! - Type 2 (AKA SMT), loosely based on [this specification](https://github.com/0xPolygonHermez/cdk-erigon/blob/d1d6b3c7a4c81c46fd995c1baa5c1f8069ff0348/turbo/trie/WITNESS.md)
//!
//! Fortunately, their opcodes don't conflict, so we can have a single
//! [`Instruction`] type, with shared parsing logic in this module, and bail on
Expand Down

0 comments on commit adeaa4e

Please sign in to comment.