-
Notifications
You must be signed in to change notification settings - Fork 109
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
PoS Validator Handshake #792
PoS Validator Handshake #792
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite. Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
@@ -830,6 +832,21 @@ func (msg *MsgDeSoDonePeer) FromBytes(data []byte) error { | |||
return fmt.Errorf("MsgDeSoDonePeer.FromBytes not implemented") | |||
} | |||
|
|||
type MsgDeSoHandshakePeer struct { |
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.
What will this be used for?
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.
Consensus connection manager needs to know we have peer's public key, and the peer is connected.
} | ||
} | ||
|
||
func (msg *MsgDeSoVerack) EncodeVerackV0() ([]byte, error) { |
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.
Based on the receiver type, it's contextualized that the message type is a Verack
func (msg *MsgDeSoVerack) EncodeVerackV0() ([]byte, error) { | |
func (msg *MsgDeSoVerack) EncodeV0() ([]byte, error) { |
return retBytes, nil | ||
} | ||
|
||
func (msg *MsgDeSoVerack) EncodeVerackV1() ([]byte, error) { |
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.
func (msg *MsgDeSoVerack) EncodeVerackV1() ([]byte, error) { | |
func (msg *MsgDeSoVerack) EncodeV1() ([]byte, error) { |
Nonce uint64 | ||
NonceReceived uint64 | ||
NonceSent uint64 | ||
TstampMicro uint64 |
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.
Why not nanoseconds? There's a time.UnixNano() function that we use to populate block timestamps, so the pattern of using nanosecond time resolution will already be there for PoS
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.
Nanoseconds are bad, they overflow and are inaccurate. I don't like our choice of nanoseconds in other parts of the code, there's never a need for such granularity. In fact the timestamp in nanos is a multiple of 1000, because it's rounded to nearest microsecond.
5416b01
to
6020d65
Compare
8253a2b
to
222d970
Compare
6020d65
to
e7e414c
Compare
222d970
to
19a5515
Compare
e7e414c
to
974b4fd
Compare
19a5515
to
08faef7
Compare
This reverts commit 5416b01.
08faef7
to
8fc6254
Compare
No description provided.