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

refactor(rpc): unify system caller invocations #12360

Merged
merged 1 commit into from
Nov 7, 2024
Merged

Conversation

klkvr
Copy link
Collaborator

@klkvr klkvr commented Nov 7, 2024

ref #12023

Extracts all system caller into a separate method on Trace trait. Those are now same for OP and eth but eventually we can customize OP behavior by just overriding this method in OP trait impl.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm

Comment on lines +453 to +458
/// Applies chain-specific state transitions required before executing a block.
///
/// Note: This should only be called when tracing an entire block vs individual transactions.
/// When tracing transaction on top of an already committed block state, those transitions are
/// already applied.
fn apply_pre_execution_changes<DB: Send + Database<Error: Display> + DatabaseCommit>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

this makes sense, although this only works as long as the the system calls are the same for eth and op.
but this is a good step

@@ -93,54 +92,30 @@ where
/// Trace the entire block asynchronously
async fn trace_block(
&self,
at: BlockId,
transactions: Vec<TransactionSignedEcRecovered>,
block: Arc<SealedBlockWithSenders>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

these changes are so that we don't need the parent_beacon_block_root argument?

Comment on lines -223 to +192
transactions,
Arc::new(block.with_senders_unchecked(senders).seal_slow()),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see we need to seal here because we decoded the block from rlp

@mattsse mattsse added this pull request to the merge queue Nov 7, 2024
@mattsse mattsse added the A-rpc Related to the RPC implementation label Nov 7, 2024
Merged via the queue into main with commit 581a2f1 Nov 7, 2024
41 checks passed
@mattsse mattsse deleted the klkvr/pre-execution-rpc branch November 7, 2024 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants