-
Notifications
You must be signed in to change notification settings - Fork 80
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
core/validatorapi: add SubmitBeaconBlock to validatorapi #409
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,18 @@ func NewRandaoDuty(slot int64) Duty { | |
} | ||
} | ||
|
||
// NewProposerDuty returns a new proposer duty. It is a convenience function that is | ||
// slightly more readable and concise than the struct literal equivalent: | ||
// core.Duty{Slot: slot, Type: core.DutyProposer} | ||
// vs | ||
// core.NewProposerDuty(slot) | ||
func NewProposerDuty(slot int64) Duty { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dB2510 slot is an uint64 or eth2p0.Slot There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added this to align with the other similar types: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we can address this later as part of this issue: #383 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, it can also be done as big refactor when we do that issue |
||
return Duty{ | ||
Slot: slot, | ||
Type: DutyProposer, | ||
} | ||
} | ||
|
||
const ( | ||
pkLen = 98 // "0x" + hex.Encode([48]byte) = 2+2*48 | ||
sigLen = 96 | ||
|
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.
@dB2510 wouldn't it make sense if EncodeBlockParSignedData would be an accesor of spec.VersionedSignedBeaconBlock and DecodeBlockParSignedData a constructor of ParSignedData ?
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.
We prefer to keep data and logic separate. Pure functions and pure data.
As per golang guidelines: Functions over methods.
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.
Also,
spec.VersionedSignedBeaconBlock
isn't our type. So we cannot add methods to it.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 right,
spec.VersionedSignedBeaconBlock
is go-eth2-client's type that we are using.