-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Simplify next Fork boilerplate creation. #14761
Conversation
dd3bfcb
to
84b3b43
Compare
} | ||
|
||
return attr | ||
log.WithField("version", st.Version()).Error("Could not get payload attribute due to unknown state version") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is much more readable to use version.String()
in logs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in cb41166.
} | ||
|
||
err = errors.New("unknown state version") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the version field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in cb41166.
}) | ||
} | ||
|
||
return nil, fmt.Errorf("unknown execution block version for payload %d", bVersion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add version.String()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in Done in cb41166..
84b3b43
to
6a0f2aa
Compare
Co-authored-by: Radosław Kapka <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>
Co-authored-by: Radosław Kapka <[email protected]>
b140ec5
to
cb41166
Compare
cb41166
to
d2abad7
Compare
What type of PR is this?
Other
What does this PR do? Why is it needed?
This PR aims to simplify the creation of the boilerplate for a new fork.
It uses
instead of
when possible.
The rationale is we assume, from fork
<n>
to fork<n+1>
, that changing items are less numerous than remaining ones.Using the
>
approach instead of theswitch/case
one lets the developer not to add the new fork version as a specific case when not needed.This PR re-organises when possible functions by fork.
When adding the boilerplate for a new fork is needed, only the tail of the file needs to be modified.
Some types (example:
enginev1.ExecutionPayloadHeaderElectra
) where aliased to the same type from previous forks (example:enginev1.ExecutionPayloadHeaderDeneb
). This usage is quite exceptional in the codebase. In the vast majority of the code base, when a fork use a struct defined in a previous fork, then this struct is directly used.Aliased types are removed to keep the codebase consistent.
Other notes for review
This PR does not bring any functional change.
Acknowledgements