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

payload electra cloning #14239

Merged
merged 12 commits into from
Jul 19, 2024
Merged

Conversation

james-prysm
Copy link
Contributor

@james-prysm james-prysm commented Jul 18, 2024

What type of PR is this?

Other

What does this PR do? Why is it needed?

Attempting to make cloners more robust and more generic.
This PR only addresses for payload electra but other types can be taken cared of in subsequent PRs

Which issues(s) does this PR fix?

Fixes #

Other notes for review

@james-prysm james-prysm requested a review from a team as a code owner July 18, 2024 16:07
@james-prysm james-prysm marked this pull request as draft July 18, 2024 16:21
@james-prysm james-prysm marked this pull request as ready for review July 18, 2024 16:51
}

// CopySlice copies the contents of a slice of pointers to a new slice.
func CopySlice[T any, C Cloneable[T]](original []C) []T {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe I should move this to some util package?

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO should probably be unexported, as it's a trivial func and copying it around seems cleaner to me than making a util that all the proto packages need to import.

@james-prysm james-prysm changed the title poc for payload electra cloning payload electra cloning Jul 18, 2024
@james-prysm james-prysm added Cleanup Code health! Electra electra hardfork Ready For Review A pull request ready for code review labels Jul 18, 2024
kasey
kasey previously approved these changes Jul 19, 2024

type Cloneable[T any] interface {
Copy() T
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm going to approve so you can move on, but my nitpick is that we should name the interface after the method (Cloneable does not follow intuitively from Copy - the reflexive naming here should be something more like Copyer). If you want to address that now I'd appreciate it and give a fast follow-up approval, or you can do it in the follow-up PRs. Also, should the interface be exported?

kasey
kasey previously approved these changes Jul 19, 2024
kasey
kasey previously approved these changes Jul 19, 2024
@james-prysm james-prysm added this pull request to the merge queue Jul 19, 2024
Merged via the queue into develop with commit 8364226 Jul 19, 2024
17 checks passed
@james-prysm james-prysm deleted the execution-payload-electra-cloner-fuzzing branch July 19, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup Code health! Electra electra hardfork Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants