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

Check connected peer weight #213

Merged
merged 6 commits into from
Mar 5, 2024
Merged

Check connected peer weight #213

merged 6 commits into from
Mar 5, 2024

Conversation

cam-schultz
Copy link
Collaborator

Why this should be merged

Currently, we abandon message relaying if we fail to connect to any of the subnet validators. However, the aggregate signature only needs a quorum of stake weight to be valid, so this constraint is overly restrictive.

This change relaxes that constraint by attempting to connect to all peers, then comparing the total connected stake against the quorum value of the destination blockchain.

How this works

AppRequestNetwork.ConnectPeers returns the set of connected peers, and no error. It is up to the caller to determine if the returned value constitutes an error. The message relayer uses the connected stake to determine whether or not to proceed with relaying.

How this was tested

CI

How is this documented

N/A

geoff-vball
geoff-vball previously approved these changes Mar 5, 2024
geoff-vball
geoff-vball previously approved these changes Mar 5, 2024
michaelkaplan13
michaelkaplan13 previously approved these changes Mar 5, 2024
"Failed to connect to a threshold of stake",
zap.Uint64("connectedWeight", connectedWeight),
zap.Uint64("totalValidatorWeight", totalValidatorWeight),
zap.Any("warpQuorum", r.warpQuorum),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err referenced on lines 268 and 270 is no longer referencing a relevant error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@cam-schultz cam-schultz merged commit 3568f44 into main Mar 5, 2024
6 of 7 checks passed
@cam-schultz cam-schultz deleted the check-peers branch March 5, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants