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

feat(revm): Integrate State #3512

Merged
merged 70 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
a32615e
feat(revm): Replace CacheDB with State
rakita Aug 16, 2023
f44292f
fmt
rakita Aug 16, 2023
bb9d12f
some fixes and tests readded
rakita Aug 17, 2023
10f507a
some cleanup, introduce max cumulative gas, use revm without alloy
rakita Aug 18, 2023
762245e
changed to tree, starting removal of PostStateProvider
rakita Aug 21, 2023
2ab7b8d
use preloaded bundle state
rakita Aug 21, 2023
2c62da3
use RevertToSlot from revm
rakita Aug 23, 2023
d86356e
Revert "changed to tree, starting removal of PostStateProvider"
rakita Aug 27, 2023
c0d064f
test(state): account & storage writes (#4339)
rkrasiuk Aug 28, 2023
c42eec2
test(state): change after selfdestruct (#4378)
rkrasiuk Aug 28, 2023
b25a937
cleanup
rakita Aug 28, 2023
45a7703
Merge remote-tracking branch 'origin/rakita/revm_state' into rakita/r…
rakita Aug 28, 2023
7d6f958
Merge remote-tracking branch 'origin/main' into rakita/revm_state
rakita Aug 28, 2023
0b59c84
feat(state): pruning (#4397)
rkrasiuk Aug 30, 2023
717f907
Some of nits. BundleStateWithReceipts, RevmDatabase
rakita Aug 31, 2023
0f059d0
Rename RevmStateBuilder to StateBuilder
rakita Aug 31, 2023
0ec5011
Remove PostState mentions
rakita Aug 31, 2023
278580b
bump revm
rakita Sep 1, 2023
cb2af90
chore(executor): split bundle state on write (#4474)
rkrasiuk Sep 4, 2023
13c7b12
chore(executor): optional first block (#4473)
rkrasiuk Sep 4, 2023
8f2a3fc
update revm. Add Tree traces in make_canonical
rakita Sep 4, 2023
8c4497f
Merge remote-tracking branch 'origin/rakita/revm_state' into update_r…
rakita Sep 4, 2023
07e611a
fix(State): revert_to had wrong index
rakita Sep 5, 2023
6726b60
Merge remote-tracking branch 'origin/main' into revm_state
rakita Sep 5, 2023
1c9fb63
rename with_sp to with_state
rakita Sep 6, 2023
889bb5a
update to newest revm
rakita Sep 6, 2023
17740e5
Remove WrapDabaseRef from reth, use builder
rakita Sep 6, 2023
96c7e9c
update to builder and omit_change flag
rakita Sep 7, 2023
0526f03
fmt and nits
rakita Sep 7, 2023
8e632f6
pass tests, commet prune test
rakita Sep 7, 2023
d811705
fix docs
rakita Sep 7, 2023
c68ef93
Bump revm and use chain_id as u64
rakita Sep 7, 2023
35e374a
doc fix
rakita Sep 7, 2023
9ca9afb
feat(state): receipts pruning (#4486)
rkrasiuk Sep 11, 2023
d017931
feat: Shuffle insertion on wipes storage. Use state wipe flag (#4548)
rakita Sep 11, 2023
9312ad2
fix: use with_bundle_update to prevent take_bundle panic (#4561)
Rjected Sep 12, 2023
720d196
fix(state): store receipts in vec (#4558)
rkrasiuk Sep 12, 2023
ef2c472
chore(execution): rely on bundle size hint for commits (#4566)
rkrasiuk Sep 12, 2023
8618c85
chore: sort storages
rakita Sep 13, 2023
32e51c5
Rename RevmDatabase to StateProviderDatabase
rakita Sep 13, 2023
a524b6f
Rename RevmDatabase and fix build
rakita Sep 13, 2023
cf0f1ab
Merge remote-tracking branch 'origin/main' into sort_storage_reverts
rakita Sep 13, 2023
8e1e1d2
fix clippy
rkrasiuk Sep 14, 2023
0f7e980
feat(state): storage revert iterator (#4595)
rkrasiuk Sep 14, 2023
2b5b287
Merge remote-tracking branch 'origin/main' into revm_state
rakita Sep 14, 2023
564ff03
chore(state): improve state change logs (#4594)
rkrasiuk Sep 15, 2023
caa1d35
Merge remote-tracking branch 'origin/main' into revm_state_final
rakita Sep 15, 2023
0d3f640
revert to CacheDb for rpc
rakita Sep 15, 2023
929ffa9
Update crates/interfaces/src/executor.rs
rakita Sep 15, 2023
26c284c
nit
rakita Sep 15, 2023
1495372
Merge remote-tracking branch 'origin/rakita/revm_state' into revm_sta…
rakita Sep 15, 2023
e2cc3dd
Update crates/revm/src/database.rs
rakita Sep 15, 2023
8655c48
Update crates/revm/src/lib.rs
rakita Sep 15, 2023
724442d
Update crates/config/src/config.rs
rakita Sep 15, 2023
34e6b83
Update crates/primitives/src/storage.rs
rakita Sep 15, 2023
ebb4b47
Update crates/revm/src/processor.rs
rakita Sep 15, 2023
c412b43
Update crates/storage/provider/src/traits/executor.rs
rakita Sep 15, 2023
72d7e22
Update crates/storage/provider/src/traits/executor.rs
rakita Sep 15, 2023
dc4e1ef
Update crates/storage/provider/src/traits/executor.rs
rakita Sep 15, 2023
471ef8c
Update crates/revm/src/processor.rs
rakita Sep 15, 2023
30f3aac
Update crates/revm/src/processor.rs
rakita Sep 15, 2023
e2e3345
Update crates/revm/src/processor.rs
rakita Sep 15, 2023
b7f65b5
nits, docs, small refactors
rakita Sep 15, 2023
df65a26
Merge remote-tracking branch 'origin/rakita/revm_state' into revm_sta…
rakita Sep 15, 2023
f2fe3c3
fmt
rakita Sep 15, 2023
d3cec9f
remove ref on Database as it has trait impl
rakita Sep 15, 2023
9bb44a5
nits,docs,style
rakita Sep 15, 2023
633b57f
nits,docs
rakita Sep 15, 2023
0210f56
Merge remote-tracking branch 'origin/main' into revm_state_final
rakita Sep 16, 2023
79345c5
Split change.rs to module
rakita Sep 16, 2023
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
56 changes: 42 additions & 14 deletions Cargo.lock

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

10 changes: 3 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,9 @@ lto = "fat"
codegen-units = 1
incremental = false

[patch.crates-io]
revm = { git = "https://github.com/bluealloy/revm/", branch = "release/v25" }
revm-primitives = { git = "https://github.com/bluealloy/revm/", branch = "release/v25" }

[workspace.dependencies]
## reth
revm = { version = "3" }
revm-primitives = "1.1"
revm = { git = "https://github.com/bluealloy/revm.git" }
revm-primitives = { git = "https://github.com/bluealloy/revm.git" }
reth = { path = "./bin/reth" }
reth-primitives = { path = "./crates/primitives" }
reth-interfaces = { path = "./crates/interfaces" }
Expand All @@ -105,6 +100,7 @@ reth-network-api = { path = "./crates/net/network-api" }
reth-rpc-types-compat = { path = "./crates/rpc/rpc-types-compat"}



## eth
ethers-core = { version = "2.0", default-features = false }
ethers-providers = { version = "2.0", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions bin/reth/src/chain/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ impl ImportCommand {
ExecutionStageThresholds {
max_blocks: config.stages.execution.max_blocks,
max_changes: config.stages.execution.max_changes,
max_cumulative_gas: config.stages.execution.max_cumulative_gas,
},
config
.stages
Expand Down
6 changes: 5 additions & 1 deletion bin/reth/src/debug_cmd/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ impl Command {
})
.set(ExecutionStage::new(
factory,
ExecutionStageThresholds { max_blocks: None, max_changes: None },
ExecutionStageThresholds {
max_blocks: None,
max_changes: None,
max_cumulative_gas: None,
},
stage_conf
.merkle
.clean_threshold
Expand Down
9 changes: 5 additions & 4 deletions bin/reth/src/debug_cmd/in_memory_merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use reth_network::NetworkHandle;
use reth_network_api::NetworkInfo;
use reth_primitives::{fs, stage::StageId, BlockHashOrNumber, ChainSpec};
use reth_provider::{
AccountExtReader, BlockExecutor, BlockWriter, ExecutorFactory, HashingWriter, HeaderProvider,
AccountExtReader, BlockWriter, ExecutorFactory, HashingWriter, HeaderProvider,
LatestStateProviderRef, ProviderFactory, StageCheckpointReader, StorageReader,
};
use reth_tasks::TaskExecutor;
Expand Down Expand Up @@ -168,13 +168,14 @@ impl Command {

let merkle_block_td =
provider.header_td_by_number(merkle_block_number)?.unwrap_or_default();
let block_state = executor.execute_and_verify_receipt(
executor.execute_and_verify_receipt(
&block.clone().unseal(),
merkle_block_td + block.difficulty,
None,
)?;
let block_state = executor.take_output_state();
rakita marked this conversation as resolved.
Show resolved Hide resolved

// Unpacked `PostState::state_root_slow` function
// Unpacked `BundleState::state_root_slow` function
let hashed_post_state = block_state.hash_state_slow().sorted();
let (account_prefix_set, storage_prefix_set) = hashed_post_state.construct_prefix_sets();
let tx = provider.tx_ref();
Expand All @@ -194,7 +195,7 @@ impl Command {

// Insert block, state and hashes
provider_rw.insert_block(block.clone(), None)?;
block_state.write_to_db(provider_rw.tx_ref(), block.number)?;
block_state.write_to_db(provider_rw.tx_ref(), false)?;
let storage_lists = provider_rw.changed_storages_with_range(block.number..=block.number)?;
let storages = provider_rw.plainstate_storages(storage_lists)?;
provider_rw.insert_storage_for_hashing(storages)?;
Expand Down
6 changes: 5 additions & 1 deletion bin/reth/src/debug_cmd/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ impl Command {
let factory = reth_revm::Factory::new(self.chain.clone());
let mut execution_stage = ExecutionStage::new(
factory,
ExecutionStageThresholds { max_blocks: Some(1), max_changes: None },
ExecutionStageThresholds {
max_blocks: Some(1),
max_changes: None,
max_cumulative_gas: None,
},
MERKLE_STAGE_DEFAULT_CLEAN_THRESHOLD,
PruneModes::all(),
);
Expand Down
Loading