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

Enable performance based relayer selection #1226

Merged
merged 14 commits into from
Jul 22, 2024

Conversation

byte-bandit
Copy link
Contributor

@byte-bandit byte-bandit commented Jul 19, 2024

Related Github tickets

Background

This change introduces fundamental changes to the relayer selection process. Live values are now gathered from the metrics module, and individual relayer fees are taken into account.

Going forward, it's paramount for relayers to make sure they have their fees set and configured for each chain, otherwise they will not be eligible for relaying anymore.

The majority of the changes are in msg_assigner.go, that's where most of your attention will be needed. It works by collecting metric and fee data once per block for all validators and ranking them. Then each message during that block will be filtered depending on its requirements, and the top ranking eligible validator will be picked (and removed from the cache).

They become eligible again next block. There are still some issues with this algorithm though. At the moment, the logic will prioritize the few top ranking validators only, with little way for the mid tier to rank up. This will need to be revisited in the future for sure.

Testing completed

  • test coverage exists or has been added/updated
  • tested in a private testnet

Breaking changes

  • I have checked my code for breaking changes
  • If there are breaking changes, there is a supporting migration.

x/treasury/keeper/grpc_query.go Outdated Show resolved Hide resolved
Comment on lines 41 to 43
for k := range i {
keys = append(keys, k)
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
Copy link
Contributor

@maharifu maharifu left a comment

Choose a reason for hiding this comment

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

Looks really good! Left a few comments but they're all just minor issues and nitpicking.

proto/palomachain/paloma/treasury/query.proto Outdated Show resolved Hide resolved
x/evm/keeper/msg_assigner.go Outdated Show resolved Hide resolved
x/evm/keeper/msg_assigner.go Show resolved Hide resolved
x/evm/keeper/msg_assigner.go Show resolved Hide resolved
x/evm/keeper/msg_assigner.go Show resolved Hide resolved
x/evm/types/relay_weights.go Outdated Show resolved Hide resolved
x/treasury/client/cli/query_get_relayer_fee.go Outdated Show resolved Hide resolved
x/treasury/keeper/grpc_query.go Outdated Show resolved Hide resolved
x/evm/keeper/msg_assigner.go Outdated Show resolved Hide resolved
byte-bandit and others added 7 commits July 19, 2024 22:59
Co-authored-by: Luis Carvalho <mail.lmcarvalho@gmail.com>
Co-authored-by: Luis Carvalho <mail.lmcarvalho@gmail.com>
Co-authored-by: Luis Carvalho <mail.lmcarvalho@gmail.com>
Co-authored-by: Luis Carvalho <mail.lmcarvalho@gmail.com>
Comment on lines +40 to +42
for key := range fees {
keys = append(keys, key)
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
x/evm/keeper/msg_assigner.go Dismissed Show dismissed Hide dismissed
x/treasury/keeper/grpc_query.go Dismissed Show dismissed Hide dismissed
Copy link
Contributor

@maharifu maharifu left a comment

Choose a reason for hiding this comment

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

👍

@byte-bandit byte-bandit merged commit e4a98d9 into palomachain:master Jul 22, 2024
4 checks passed
@byte-bandit byte-bandit deleted the feature/enable-pf-selection branch July 22, 2024 12:31
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

Successfully merging this pull request may close these issues.

3 participants