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

fix: ExtraPayloads.SetOn{ChainConfig,Rules}() overrides shallow copy #42

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

ARR4N
Copy link
Collaborator

@ARR4N ARR4N commented Sep 30, 2024

Why this should be merged

params.ChainConfig (and Rules) are often copied by dereferencing a pointer, which results in a shallow copy of extra payloads. There was previously no way to update a payload on the copy without changing the original—this PR addresses that shortcoming.

How this works

The methods are updated to set the payload to a fresh pseudo.From[C/R](val).Type.

How this was tested

Existing unit tests are updated to demonstrate both shallow copying and the decoupling achieved by SetOn<T>() methods.

@ARR4N ARR4N enabled auto-merge (squash) September 30, 2024 17:19
@ARR4N ARR4N requested review from a team, darioush, ceyonur and michaelkaplan13 and removed request for a team September 30, 2024 17:19
@ARR4N ARR4N merged commit 1478c18 into libevm Sep 30, 2024
3 checks passed
@ARR4N ARR4N deleted the arr4n/extrapayloads-set-on-fix branch September 30, 2024 17:24
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.

2 participants