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

chore: bump revm dec 2024 #246

Merged
merged 40 commits into from
Mar 12, 2025
Merged

chore: bump revm dec 2024 #246

merged 40 commits into from
Mar 12, 2025

Conversation

rakita
Copy link
Contributor

@rakita rakita commented Dec 20, 2024

Revm Framework integration

@rakita rakita marked this pull request as draft December 20, 2024 13:34
@gakonst
Copy link
Member

gakonst commented Dec 23, 2024

As discussed would like to hold on merging until we've iterated on the revm api a bit as this is used in a bunch of places and want to be thoughtful about breakages

@rakita
Copy link
Contributor Author

rakita commented Dec 23, 2024

As discussed would like to hold on merging until we've iterated on the revm api a bit as this is used in a bunch of places and want to be thoughtful about breakages

Doing exactly that, and I have already accounted interfaces and usage patterns when refactoring Revm. Changes that simplify integration even more, are here: bluealloy/revm#1934

Present context allows us a lot simpler usage and it is easier to navigate.

Would assume this will not be merged until we have PR in Reth.

@rakita rakita marked this pull request as ready for review December 26, 2024 12:32
@rakita
Copy link
Contributor Author

rakita commented Dec 26, 2024

@mattsse this is now integrated.

We should wait for Reth integration before merging.

@rakita rakita mentioned this pull request Jan 27, 2025
10 tasks
mattsse and others added 3 commits February 12, 2025 18:54
Co-authored-by: Arsenii Kulikov <[email protected]>
Co-authored-by: Arsenii Kulikov <[email protected]>
to
} else {
// We need to exclude the created address if this is a CREATE frame.
//
// This assumes that caller has already been loaded but nonce was not increased yet.
let nonce = context.journaled_state.account(from).info.nonce;
let nonce = context.journal_ref().evm_state().get(&from).unwrap().info.nonce;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, can we drop the _ref() suffix here? should just be journal and journal_mut

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In most cases a mutable journal is needed, there was few cases were ref is needed so this fn was added

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, then I think it should remain like that for legacy reasons

where
DB: Database,
CTX: ContextTrait<Journal: JournalExt>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naming a trait Trait always feels a bit weird to me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will rename all of them to ContextT.

@@ -216,7 +219,7 @@ impl<'a> GethTraceBuilder<'a> {
/// * `db` - The database to fetch state pre-transaction execution.
pub fn geth_prestate_traces<DB: DatabaseRef>(
&self,
ResultAndState { state, .. }: &ResultAndState,
ResultAndState { state, .. }: &ResultAndState<impl HaltReasonTrait>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this a named generic, don't like mixing this

@@ -170,7 +173,7 @@ impl ParityTraceBuilder {
/// with the [TracingInspector](crate::tracing::TracingInspector).
pub fn into_trace_results_with_state<DB: DatabaseRef>(
self,
res: &ResultAndState,
res: &ResultAndState<impl HaltReasonTrait>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, can we name this just HaltReason or HaltReasonT

pub(crate) struct StringError(pub String);

impl core::error::Error for StringError {}
impl DBErrorMarker for StringError {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this necessary?

Comment on lines +954 to +955
#[derive(Clone, Debug)]
pub(crate) struct StringError(pub String);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs docs, why this is necessary

Comment on lines +954 to +955
#[derive(Clone, Debug)]
pub(crate) struct StringError(pub String);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we name this JsDbError

Comment on lines 235 to 239
pub fn result<TX, DB>(
&mut self,
res: ResultAndState,
env: &Env,
res: ResultAndState<impl HaltReasonTrait>,
tx: &TX,
block: &impl Block,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make these consistent across all functions, don't like to mix this

@klkvr klkvr force-pushed the rakita/bump_revm_dec_2024 branch from a7ed3df to 3c6cca4 Compare March 10, 2025 21:47
@klkvr klkvr mentioned this pull request Mar 10, 2025
3 tasks
@klkvr klkvr merged commit cf55696 into main Mar 12, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants