-
Notifications
You must be signed in to change notification settings - Fork 1.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
feat: implement eip4788 #12570
feat: implement eip4788 #12570
Conversation
4275a62
to
6bcb81f
Compare
return nil, consensus_types.ErrNotSupported("PayloadAttributePbV3", a.version) | ||
} | ||
if a.timeStamp == 0 && len(a.prevRandao) == 0 { | ||
return nil, nil |
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.
Given we are validating fields here, should we check that parent beacon block root and other fields are non-nil here?
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.
and non-empty
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.
I dont think this check is necessary so ill remove it
aaeda1b
to
dd3e166
Compare
96d50be
to
e9c0e11
Compare
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.
You seem to have a couple messed up imports, probably from another branch that was merged in
return nil, errNilPayloadAttribute | ||
} | ||
if a.version != version.Deneb { | ||
return nil, consensus_types.ErrNotSupported("PayloadAttributePbV3", a.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.
return nil, consensus_types.ErrNotSupported("PayloadAttributePbV3", a.version) | |
return nil, consensus_types.ErrNotSupported("PbV3", a.version) |
Previous versions are also mismatched.
a, err := New(&enginev1.PayloadAttributesV2{}) | ||
require.NoError(t, err) | ||
_, err = a.PbV3() | ||
require.ErrorContains(t, "PayloadAttributePbV3 is not supported for capella: unsupported getter", err) |
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.
This is not a suggestion to change the code, but my personal opinion is that tests are less fragile when we check for a small meaningful part of the error message that is unlikely to change. In this example I would only check for not supported
. Having the whole error message in the assertion means that you will need to update the test if the name of the function changes, or the unsupported getter
part.
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.
I agree, but it's also good to check against PbV3
vs V2
or V1
. In this case, I am inclined to leave it as it is
739ca9e
to
245b2dc
Compare
ready for another look @rkapka @rauljordan ! |
e2e failed, we'll need ethereum/go-ethereum#27289 to merge |
102ff8f
to
f8bc11f
Compare
vh0 := [32]byte{1, 207, 35, 21, 201, 118, 88, 167, 237, 84, 173, 161, 129, 118, 94, 35, 179, 250, 219, 81, 80, 250, 179, 149, 9, 246, 49, 192, 185, 175, 69, 102} | ||
vh1 := [32]byte{1, 226, 124, 226, 142, 82, 126, 176, 113, 150, 179, 26, 240, 245, 250, 24, 130, 172, 231, 1, 166, 130, 2, 42, 183, 121, 248, 22, 172, 57, 212, 126} | ||
vh0 := "0x01cf2315c97658a7ed54ada181765e23b3fadb5150fab39509f631c0b9af4566" | ||
vh1 := "0x01e27ce28e527eb07196b31af0f5fa1882ace701a682022ab779f816ac39d47e" |
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.
yeah this is a nice improvement
This PR implements EIP4788 on Prysm. Majority of the changes are on the execution API