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

Perf: Skip CacheDB and load data directly #131

Merged
merged 8 commits into from
Dec 18, 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
33 changes: 17 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ opt-level = 3
# RISC Zero
[workspace.dependencies.bonsai-sdk]
git = "https://github.com/risc0/risc0"
rev = "e98cdad96cfecb3d959cb62abf566e5b17a0d649"
rev = "f74920596c745a8bb7e8a6f1dfdefb44d03ed06f"
features = ["non_blocking"]

[workspace.dependencies.risc0-build]
git = "https://github.com/risc0/risc0"
rev = "e98cdad96cfecb3d959cb62abf566e5b17a0d649"
rev = "f74920596c745a8bb7e8a6f1dfdefb44d03ed06f"
features = ["unstable"]

[workspace.dependencies.risc0-zkvm]
git = "https://github.com/risc0/risc0"
rev = "e98cdad96cfecb3d959cb62abf566e5b17a0d649"
rev = "f74920596c745a8bb7e8a6f1dfdefb44d03ed06f"
default-features = false
features = ["bonsai"]

# External
[workspace.dependencies]
Expand Down
20 changes: 15 additions & 5 deletions crates/core-ethereum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,31 @@ use reth_storage_errors::provider::ProviderError;
use std::fmt::Display;
use std::mem::take;
use std::sync::Arc;
use zeth_core::db::MemoryDB;
use zeth_core::db::memory::MemoryDB;
use zeth_core::db::trie::TrieDB;
use zeth_core::driver::CoreDriver;
use zeth_core::stateless::client::StatelessClient;
use zeth_core::stateless::execute::ExecutionStrategy;
use zeth_core::stateless::finalize::RethFinalizationStrategy;
use zeth_core::stateless::initialize::MemoryDbStrategy;
use zeth_core::stateless::finalize::{MemoryDbFinalizationStrategy, TrieDbFinalizationStrategy};
use zeth_core::stateless::initialize::{
MemoryDbInitializationStrategy, TrieDbInitializationStrategy,
};
use zeth_core::stateless::validate::ValidationStrategy;

pub struct RethStatelessClient;

impl StatelessClient<RethCoreDriver, MemoryDB> for RethStatelessClient {
type Initialization = MemoryDbStrategy;
type Initialization = MemoryDbInitializationStrategy;
type Validation = RethValidationStrategy;
type Execution = RethExecutionStrategy;
type Finalization = MemoryDbFinalizationStrategy;
}

impl StatelessClient<RethCoreDriver, TrieDB> for RethStatelessClient {
type Initialization = TrieDbInitializationStrategy;
type Validation = RethValidationStrategy;
type Execution = RethExecutionStrategy;
type Finalization = RethFinalizationStrategy;
type Finalization = TrieDbFinalizationStrategy;
}

pub struct RethValidationStrategy;
Expand Down
20 changes: 15 additions & 5 deletions crates/core-optimism/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,31 @@ use reth_storage_errors::provider::ProviderError;
use std::fmt::Display;
use std::mem::take;
use std::sync::Arc;
use zeth_core::db::MemoryDB;
use zeth_core::db::memory::MemoryDB;
use zeth_core::db::trie::TrieDB;
use zeth_core::driver::CoreDriver;
use zeth_core::stateless::client::StatelessClient;
use zeth_core::stateless::execute::ExecutionStrategy;
use zeth_core::stateless::finalize::RethFinalizationStrategy;
use zeth_core::stateless::initialize::MemoryDbStrategy;
use zeth_core::stateless::finalize::{MemoryDbFinalizationStrategy, TrieDbFinalizationStrategy};
use zeth_core::stateless::initialize::{
MemoryDbInitializationStrategy, TrieDbInitializationStrategy,
};
use zeth_core::stateless::validate::ValidationStrategy;

pub struct OpRethStatelessClient;

impl StatelessClient<OpRethCoreDriver, MemoryDB> for OpRethStatelessClient {
type Initialization = MemoryDbStrategy;
type Initialization = MemoryDbInitializationStrategy;
type Validation = OpRethValidationStrategy;
type Execution = OpRethExecutionStrategy;
type Finalization = MemoryDbFinalizationStrategy;
}

impl StatelessClient<OpRethCoreDriver, TrieDB> for OpRethStatelessClient {
type Initialization = TrieDbInitializationStrategy;
type Validation = OpRethValidationStrategy;
type Execution = OpRethExecutionStrategy;
type Finalization = RethFinalizationStrategy;
type Finalization = TrieDbFinalizationStrategy;
}

pub struct OpRethValidationStrategy;
Expand Down
Loading
Loading