Skip to content
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

sentry.proto: add PeerStatus to deprecate SendMessageByMinBlock #166

Open
battlmonstr opened this issue May 4, 2023 · 0 comments
Open

Comments

@battlmonstr
Copy link
Contributor

The PeerMinBlock/SendMessageByMinBlock API acts as a peer filter for sending messages to a subset of peers.
A mapping between peer_id and min_block is maintained on the sentry side.
Note: min_block should be called "known best/max/highest" block number.

Sentry in fact knows nothing about the nature of min_block or where it is coming from.
This API acts as a cached filter, while the node is the source of truth.

If this mapping is maintained on the node side, the SendMessageByMinBlock is not needed.
SendMessageById could be used instead.

An initial known best/max/highest block number of a peer is received in an incoming eth Status message.
The sentry should remember peer status messages, and expose them via a new API call.
Then if the node crashes, the mapping could be recovered.

Proposal

Add a new method:

rpc PeerStatus(PeerByIdRequest) returns (StatusData);

Manage a mapping between peer_id and its StatusData on the sentry side.

Use this to build and maintain the peer_id/best_block_num mapping on the node side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant