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(op-payload-builder): Refactor optimism_payload into smaller, reusable functions #10904

Merged
merged 37 commits into from
Sep 18, 2024

Conversation

0xKitsune
Copy link
Contributor

@0xKitsune 0xKitsune commented Sep 14, 2024

Addresses #10935

This PR refactors the OP block building logic from the optimism_payload function into smaller methods implemented on the OptimismPayloadBuilder struct.

This change enhances the re-usability of the default OptimismPayloadBuilder logic, which is useful when implementing a custom OP Stack Payload builder.

Copy link
Member

@emhane emhane left a comment

Choose a reason for hiding this comment

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

is this linked to an issue?

@0xKitsune
Copy link
Contributor Author

0xKitsune commented Sep 16, 2024

My mistake, I just realized that I had not opened an issue. I opened a new issue just now and linked it in the PR description.
Please let me know your thoughts on the direction for this PR, happy to adjust if there is a better approach!

@emhane
Copy link
Member

emhane commented Sep 16, 2024

My mistake, I just realized that I had not opened an issue. I opened a new issue just now and linked it in the PR description. Please let me know your thoughts on the direction for this PR, happy to adjust if there is a better approach!

valid issue! thanks for implementing!

@emhane emhane added C-debt Refactor of code section that is hard to understand or maintain A-block-building Related to block building A-op-reth Related to Optimism and op-reth labels Sep 16, 2024
Copy link
Member

@emhane emhane left a comment

Choose a reason for hiding this comment

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

lgtm

@emhane
Copy link
Member

emhane commented Sep 16, 2024

could you please run this against hive also

@0xKitsune 0xKitsune marked this pull request as ready for review September 16, 2024 22:45
@0xKitsune
Copy link
Contributor Author

0xKitsune commented Sep 17, 2024

I ran Hive against these these changes locally and received the following results. It looks like there are some expected failures defined in .github/assetshive/expected_failures.yaml, is there a preferred output that you would like me to produce?

Also please let me know if there is a workflow or set of commands that I should run to evaluate the results against the expected outcomes.

 # Pass
-  "smoke/genesis" ""
    - Pass
-  "smoke/network" ""
    - Pass
 - "ethereum/engine" "engine-auth"
    - Pass
 - "devp2p" "discv4"
    - Pass
 - "ethereum/engine" "engine-exchange-capabilities"
    - Pass

 # Fail
- "ethereum/rpc-compat" ""
    - 21 tests failed
 - "ethereum/engine" "engine-withdrawals"
    - 18 tests failed
 - "ethereum/engine" "engine-api"
    - 8 tests failed
- "ethereum/engine" "cancun"
    - 12 tests failed
 - "ethereum/sync" ""
    - 1 test failed
 - "devp2p" "eth"
    - 5 tests failed

@0xKitsune
Copy link
Contributor Author

@emhane Any thoughts on how best to proceed to get this merged in?

@emhane
Copy link
Member

emhane commented Sep 18, 2024

I ran Hive against these these changes locally and received the following results. It looks like there are some expected failures defined in .github/assetshive/expected_failures.yaml, is there a preferred output that you would like me to produce?

Also please let me know if there is a workflow or set of commands that I should run to evaluate the results against the expected outcomes.

 # Pass
-  "smoke/genesis" ""
    - Pass
-  "smoke/network" ""
    - Pass
 - "ethereum/engine" "engine-auth"
    - Pass
 - "devp2p" "discv4"
    - Pass
 - "ethereum/engine" "engine-exchange-capabilities"
    - Pass

 # Fail
- "ethereum/rpc-compat" ""
    - 21 tests failed
 - "ethereum/engine" "engine-withdrawals"
    - 18 tests failed
 - "ethereum/engine" "engine-api"
    - 8 tests failed
- "ethereum/engine" "cancun"
    - 12 tests failed
 - "ethereum/sync" ""
    - 1 test failed
 - "devp2p" "eth"
    - 5 tests failed

it shouldn't be performing worse than the latest run on main, which it seems to do now. on main only the engine tests fail 18 rpc compat tests fail for example. https://github.com/paradigmxyz/reth/actions/runs/10875392078

try merging latest main, run again and compare to latest run on main :)

@0xKitsune
Copy link
Contributor Author

After merging the latest changes on main and rerunning hive against this branch, it looks like the result is the same compared to running against reth:latest. Thanks for the help! Let me know if you want me to produce a specific output or this looks good to merge in.

@emhane emhane added this pull request to the merge queue Sep 18, 2024
Merged via the queue into paradigmxyz:main with commit 883975d Sep 18, 2024
35 checks passed
@mattsse
Copy link
Collaborator

mattsse commented Sep 19, 2024

I don't necessarily agree with some decisions in this PR

for example:

this is redundant:

evm_config: EvmConfig,

all these functions accept &self, when not required.

and I find this a bit harder to read now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-block-building Related to block building A-op-reth Related to Optimism and op-reth C-debt Refactor of code section that is hard to understand or maintain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants