Skip to content

Commit 52cb83c

Browse files
committed
chore: some db readme
1 parent 892061f commit 52cb83c

File tree

4 files changed

+21
-30
lines changed

4 files changed

+21
-30
lines changed

crates/db/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Signet Database
2+
3+
Extensions and modifications to reth's Database system for use in the Signet
4+
Node.
5+
6+
This library contains the following:
7+
8+
- Traits for reading and writing Signet events
9+
- Table definitions for Signet Events, Headers, and JournalHashes
10+
- Helpers for reading, writing, reverting, Signet EVM blocks and headers
11+
12+
## Significant Traits
13+
14+
- `RuWriter` - Encapsulates logic for reading and writing Signet events, state,
15+
headers, etc.
16+
- `DbProviderExt` - Extends the reth `DatabaseProviderRW` with a scope-guarded
17+
`update` method.

crates/db/src/chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct DbExtractionResults {
1616
pub enter_tokens: Vec<Passage::EnterToken>,
1717
}
1818

19-
/// Equivalent of [`Chain`] but also containing zenith headers.
19+
/// Equivalent of [`Chain`] but also containing zenith events and information.
2020
#[derive(Debug, Clone, Default, PartialEq, Eq)]
2121
pub struct RuChain {
2222
/// Inner chain of RU blocks.

crates/db/src/lib.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
//! Database access for Signet Node.
2-
//!
3-
//! This library contains the following:
4-
//!
5-
//! - Traits for reading and writing Signet events
6-
//! - Table definitions for Signet Events and Headers
7-
//! - Helpers for reading and writing Signet EVM blocks and headers
8-
1+
#![doc = include_str!("../README.md")]
92
#![warn(
103
missing_copy_implementations,
114
missing_debug_implementations,
@@ -33,4 +26,4 @@ pub use tables::{
3326
};
3427

3528
mod traits;
36-
pub use traits::{DbProviderExt, RuEnterReader, RuWriter};
29+
pub use traits::{DbProviderExt, RuWriter};

crates/db/src/traits.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,9 @@ use signet_evm::BlockResult;
1010
use signet_node_types::{NodeTypesDbTrait, SignetNodeTypes};
1111
use signet_types::primitives::RecoveredBlock;
1212
use signet_zenith::{Passage, Transactor, Zenith};
13-
use std::{
14-
collections::BTreeMap,
15-
ops::{RangeBounds, RangeInclusive},
16-
};
13+
use std::{collections::BTreeMap, ops::RangeInclusive};
1714
use tracing::trace;
1815

19-
/// Reader for [`Passage::Enter`] events stored in the DB.
20-
pub trait RuEnterReader {
21-
/// Get an enter by height and index.
22-
fn enter_by_height_and_index(
23-
&self,
24-
height: u64,
25-
index: u64,
26-
) -> ProviderResult<Option<Passage::Enter>>;
27-
28-
/// Get enters by height.
29-
fn get_enters_by_height(
30-
&self,
31-
height: impl RangeBounds<u64> + Clone,
32-
) -> ProviderResult<Vec<Passage::Enter>>;
33-
}
34-
3516
/// Writer for [`Passage::Enter`] events.
3617
pub trait RuWriter {
3718
/// Get the last block number

0 commit comments

Comments
 (0)