Skip to content

Conversation

@calbera
Copy link
Contributor

@calbera calbera commented Apr 23, 2025

A non-critical proposal to clean up tech debt. This PR can be merged now but chosen to be kept as a simple refactor instead of a hard fork by changing this line

); err != nil {
return err
// NOTE: marshalling this struct is NOT affected by it's own fork version.
if version.IsBefore(forkVersion, version.Electra()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can delay the hard fork by making this version.Electra1() or something else in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This refactored code is still backwards compatible

Copy link
Collaborator

Choose a reason for hiding this comment

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

super nit: consider inverting test to simplfiy code. Something like

if !version.IsBefore(forkVersion, version.Electra()) {
  // post Electra we simplified marshalling and we do not need to store version
  return nil
}
...

@calbera calbera changed the title [4.5/n] chore(types): remove ExecutionPayloadHeader version chore(types): remove ExecutionPayloadHeader version Apr 25, 2025
@calbera calbera marked this pull request as ready for review April 25, 2025 04:12
@calbera calbera requested a review from a team as a code owner April 25, 2025 04:12
@rezbera
Copy link
Contributor

rezbera commented May 7, 2025

Agree with this change for a later fork. Will review properly after all bectra related work is done

eth1DepositIndex sdkcollections.Item[uint64]
// latestExecutionPayloadVersion stores the latest execution payload
// version.
// version. Kept for backwards compatibility for versions before Electra.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am afraid we really need to do that. One of the downside of a blockchain

// the BeaconStore.
func (kv *KVStore) SetLatestExecutionPayloadHeader(
payloadHeader *ctypes.ExecutionPayloadHeader,
payloadHeader *ctypes.ExecutionPayloadHeader, forkVersion common.Version,
Copy link
Collaborator

Choose a reason for hiding this comment

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

spitballing here: an alternative could be to have a SetLatestExecutionPayloadHeaderPreElectra and a SetLatestExecutionPayloadHeader.
From Pectra on we would call only the latter, but clients of this method would have to decide which method to call.
Probably does not make much of a different, just pointing it out

Copy link
Collaborator

@abi87 abi87 left a comment

Choose a reason for hiding this comment

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

Content is fine by me. I agree it's probably slightly best to include this change in a sequent fork instead of Electra, but not by much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants