-
Notifications
You must be signed in to change notification settings - Fork 800
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
Adding lighthouse/peers methods in BeaconNodeHttpClient #3042
Conversation
beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs
Outdated
Show resolved
Hide resolved
I noticed that the score is not serialized as: "score": {
"score": 0
} like described in the book, but like that: "score": {
"RealScore": {
"lighthouse_score": 0,
"gossipsub_score": 0,
"ignore_negative_gossipsub_score": false,
"score": 0
}
} Do we want to keep all the score details? Maybe we could streamline to just: "score": 0 But obviously, that another breaking change... |
let instant = now | ||
.checked_sub(duration) | ||
.ok_or_else(|| Error::custom("checked_sub 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.
I think we need to avoid erroring in this case, or it'll create issues when translating Instant
s between machines. If the duration we get off the wire is greater than our current instant then it'll error. Ideally we could use saturating_sub
, but it doesn't exist for Instant
, so I think our best option is probably to do .checked_sub(duration).unwrap_or_else(Instant::now)
.
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.
Un-addressed comment by author @leruaa. Double checking there's still demand to call lighthouse only APIs programatically with the internal eth2 tooling?
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 think we can close this, as Jack has implemented it more recently in #4937
beacon_node/lighthouse_network/src/peer_manager/peerdb/peer_info.rs
Outdated
Show resolved
Hide resolved
Superseded by |
Issue Addressed
Issue #3041
Proposed Changes
BeaconNodeHttpClient
Deserialize
onPeer
struct and all fields structs recursively