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(EthBuiltPayload): Arc SealedBlock #12351

Merged
merged 1 commit into from
Nov 6, 2024
Merged

Conversation

hai-rise
Copy link
Contributor

@hai-rise hai-rise commented Nov 6, 2024

Most EthBuiltPayloads have duplicate SealedBlocks in block and executed_block.block. Since the latter is already an Arc we should make the former one to share, instead of cloning anew like currently.

P/s: This is also applicable to OpBuiltPayload.

debug!(target: "payload_builder", ?sealed_block, "sealed built block");

// create the executed block data
let executed = ExecutedBlock {
block: Arc::new(sealed_block.clone()),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The goal is to remove this potentially expensive clone.

Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

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

nice, this looks good to me

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.

makes sense

@mattsse mattsse added this pull request to the merge queue Nov 6, 2024
Merged via the queue into paradigmxyz:main with commit 302ed29 Nov 6, 2024
40 checks passed
@hai-rise hai-rise deleted the arc-block branch November 7, 2024 00:13
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.

3 participants