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

Introduce HashedPostStateProvider #23

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
c4d7b59
perf(rpc): add optional block argument to `trace_block_until_with_ins…
joshieDo Oct 15, 2024
a235f72
feat(trie): sparse trie (#11741)
rkrasiuk Oct 15, 2024
6fb2710
feat: move RPC launch to add-ons (#11532)
klkvr Oct 15, 2024
5aceb3e
primitives: rm redundant `chain_id` function for Transaction (#11751)
tcoratger Oct 15, 2024
04f5b53
chore: touchups PayloadOrAttributes (#11749)
mattsse Oct 15, 2024
77a382f
chore: allow missing const (#11750)
mattsse Oct 15, 2024
7b1b1fc
chore(stage test): use with_capacity (#11759)
nkysg Oct 15, 2024
7f92760
fix: `estimateGas` edge case (#11764)
klkvr Oct 15, 2024
4144d6e
chore: add get_database_args (#11766)
mattsse Oct 15, 2024
78415ff
chore: include hash in trace (#11762)
mattsse Oct 15, 2024
d4be773
chore: move tests in reth_execution_types::chain to reth-evm-optimism…
0xriazaka Oct 15, 2024
3f3a7ef
unify &Option<T> to Option<&T> (#11755)
nkysg Oct 16, 2024
b814770
feat(txpool): function to return the next free nonce (#11744)
kien6034 Oct 16, 2024
183cea4
chore(provider): move `state_provider_from_state` to `BlockState` imp…
joshieDo Oct 16, 2024
a6358d2
feat(provider): add `*StateProviderRef` creation methods to `Database…
joshieDo Oct 16, 2024
a14a9fd
chore: add chain_id shortcut (#11782)
mattsse Oct 16, 2024
323d8ed
feat: implement batch executor (#11753)
fgimenez Oct 16, 2024
0f903b1
feat: add EthExecutionStrategy (#11584)
fgimenez Oct 16, 2024
e454b24
chore: use highest known nonce (#11784)
mattsse Oct 16, 2024
f49a4ae
feat: add OpExecutionStrategy (#11761)
fgimenez Oct 16, 2024
d421931
trie: simplify usage of `HashedStorage` with default (#11662)
tcoratger Oct 16, 2024
248b6b5
fix: task executor metrics (#11738)
greged93 Oct 16, 2024
87399ae
chore: rename executor and provider Generic -> Basic (#11788)
fgimenez Oct 16, 2024
eec861f
chore: rm unused optimism feature (#11794)
mattsse Oct 16, 2024
6f04110
chore: rename SenderId::into_id to SenderId::into_transaction_id (#11…
evchip Oct 16, 2024
c76d319
chore: rm optimism feature from reth-revm (#11797)
mattsse Oct 16, 2024
6ad1275
chore(sdk): move block traits into `reth-primitives-traits` (#11780)
emhane Oct 16, 2024
cb7fd08
chore: remove &self from update_estimated_gas_range (#11799)
greged93 Oct 16, 2024
281307f
chore(ci): update list of crates excluded from wasm checks (#11787)
fgimenez Oct 16, 2024
6b2ec42
docs: clarify max rpc tracing requests (#11796)
mattsse Oct 16, 2024
12cab20
fix(witness): branch node children decoding (#11599)
rkrasiuk Oct 16, 2024
099987f
chore(cli): add `default_client_version` to rethCli (#11773)
aroralanuk Oct 16, 2024
e5cd026
deps: `[email protected]` (#11807)
rkrasiuk Oct 16, 2024
dcaa432
chore(trie): use `RlpNode::as_hash` (#11808)
rkrasiuk Oct 16, 2024
756a47e
chore: add `shekhirin` to trie code owners (#11809)
rkrasiuk Oct 16, 2024
a2249b0
fix(exex): filter only WAL files when walking the directory (#11802)
shekhirin Oct 16, 2024
b1cc168
feat(cli): make pruning block interval an option (#11810)
kien6034 Oct 16, 2024
82862fa
primitives: rm redundant functions for `Transaction` (#11747)
tcoratger Oct 16, 2024
d2ca8f3
fix: update block interval properly (#11546)
mattsse Oct 16, 2024
5a82f20
chore: rm 1 usage of optimism feature (#11813)
mattsse Oct 16, 2024
025cb3b
primitive-traits: rm redundant `EMPTY_ROOT_HASH` definition (#11811)
tcoratger Oct 16, 2024
24287e8
primitives: use `EMPTY_ROOT_HASH` when possible (#11822)
tcoratger Oct 16, 2024
1b97b1d
fix(staged-sync): prevent `StaticFileProducer` from running with an u…
joshieDo Oct 17, 2024
b57a560
test: make provider compile with cargo t (#11817)
mattsse Oct 17, 2024
e828b34
chore: rm features from test utils (#11816)
mattsse Oct 17, 2024
e3e83b7
docs(trie): revealed sparse trie invariants (#11825)
rkrasiuk Oct 17, 2024
63a75fd
fix(trie): intermediate trie node hashes (#11826)
rkrasiuk Oct 17, 2024
491f154
primitives-traits: rm redundant definitions of `EMPTY_OMMER_ROOT_HASH…
tcoratger Oct 17, 2024
e4c6294
feat: introduce StateCommitment type
frisitano Oct 17, 2024
cb77bce
feat: introduce StateCommitment in StateProviders
frisitano Oct 17, 2024
d3db641
feat: introduce HashedPostStateProvider
frisitano Oct 18, 2024
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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ crates/tasks/ @mattsse
crates/tokio-util/ @fgimenez @emhane
crates/tracing/ @onbjerg
crates/transaction-pool/ @mattsse
crates/trie/ @rkrasiuk @Rjected
crates/trie/ @rkrasiuk @Rjected @shekhirin
etc/ @Rjected @onbjerg @shekhirin
.github/ @onbjerg @gakonst @DaniPopes
5 changes: 0 additions & 5 deletions .github/assets/check_wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ exclude_crates=(
reth-engine-util
reth-eth-wire
reth-ethereum-cli
reth-ethereum-engine
reth-ethereum-engine-primitives
reth-ethereum-payload-builder
reth-etl
reth-evm-ethereum
reth-execution-errors
reth-exex
reth-exex-test-utils
reth-ipc
Expand All @@ -49,7 +47,6 @@ exclude_crates=(
reth-node-events
reth-node-metrics
reth-optimism-cli
reth-optimism-evm
reth-optimism-node
reth-optimism-payload-builder
reth-optimism-rpc
Expand All @@ -63,9 +60,7 @@ exclude_crates=(
reth-rpc-eth-api
reth-rpc-eth-types
reth-rpc-layer
reth-rpc-types
reth-stages
reth-storage-errors
reth-engine-local
# The following are not supposed to be working
reth # all of the crates below
Expand Down
61 changes: 49 additions & 12 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions bin/reth/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use reth_db::DatabaseEnv;
use reth_ethereum_cli::chainspec::EthereumChainSpecParser;
use reth_node_builder::{NodeBuilder, WithLaunchContext};
use reth_node_ethereum::{EthExecutorProvider, EthereumNode};
use reth_node_metrics::recorder::install_prometheus_recorder;
use reth_tracing::FileWorkerGuard;
use std::{ffi::OsString, fmt, future::Future, sync::Arc};
use tracing::info;
Expand Down Expand Up @@ -145,6 +146,10 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>, Ext: clap::Args + fmt::Debug> Cl
let _guard = self.init_tracing()?;
info!(target: "reth::cli", "Initialized tracing, debug log directory: {}", self.logs.log_file_directory);

// Install the prometheus recorder to be sure to record task
// executor's metrics
let _ = install_prometheus_recorder();

let runner = CliRunner::default();
match self.command {
Commands::Node(command) => {
Expand Down
5 changes: 3 additions & 2 deletions bin/reth/src/commands/debug_cmd/build_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use reth_primitives::{
};
use reth_provider::{
providers::BlockchainProvider, BlockHashReader, BlockReader, BlockWriter, ChainSpecProvider,
ProviderFactory, StageCheckpointReader, StateProviderFactory,
HashedPostStateProvider, ProviderFactory, StageCheckpointReader, StateProviderFactory,
};
use reth_revm::{database::StateProviderDatabase, primitives::EnvKzgSettings};
use reth_stages::StageId;
Expand Down Expand Up @@ -266,7 +266,8 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
ExecutionOutcome::from((block_execution_output, block.number));
debug!(target: "reth::cli", ?execution_outcome, "Executed block");

let hashed_post_state = execution_outcome.hash_state_slow();
let hashed_post_state =
provider_factory.hashed_post_state_from_bundle_state(execution_outcome.state());
let (state_root, trie_updates) = StateRoot::overlay_root_with_updates(
provider_factory.provider()?.tx_ref(),
hashed_post_state.clone(),
Expand Down
13 changes: 5 additions & 8 deletions bin/reth/src/commands/debug_cmd/in_memory_merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ use reth_node_api::{NodeTypesWithDB, NodeTypesWithEngine};
use reth_node_ethereum::EthExecutorProvider;
use reth_primitives::BlockHashOrNumber;
use reth_provider::{
writer::UnifiedStorageWriter, AccountExtReader, ChainSpecProvider, HashingWriter,
HeaderProvider, LatestStateProviderRef, OriginalValuesKnown, ProviderFactory,
StageCheckpointReader, StateWriter, StaticFileProviderFactory, StorageReader,
writer::UnifiedStorageWriter, AccountExtReader, ChainSpecProvider, HashedPostStateProvider,
HashingWriter, HeaderProvider, OriginalValuesKnown, ProviderFactory, StageCheckpointReader,
StateWriter, StorageReader, ToLatestStateProviderRef,
};
use reth_revm::database::StateProviderDatabase;
use reth_stages::StageId;
Expand Down Expand Up @@ -131,10 +131,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
)
.await?;

let db = StateProviderDatabase::new(LatestStateProviderRef::new(
provider.tx_ref(),
provider_factory.static_file_provider(),
));
let db = StateProviderDatabase::new(provider.latest());

let executor = EthExecutorProvider::ethereum(provider_factory.chain_spec()).executor(db);

Expand All @@ -156,7 +153,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
// Unpacked `BundleState::state_root_slow` function
let (in_memory_state_root, in_memory_updates) = StateRoot::overlay_root_with_updates(
provider.tx_ref(),
execution_outcome.hash_state_slow(),
provider.hashed_post_state_from_bundle_state(execution_outcome.state()),
)?;

if in_memory_state_root == block.state_root {
Expand Down
Loading
Loading