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

Relayer Scheduling Logic #900

Merged

Conversation

ToasterTheBrave
Copy link
Contributor

Related Github tickets

Background

This Feature lays the groundwork for Paloma picking pigeons based on a set of weighted rules. The foundation for selecting pigeons is set here, and the scaffolding for inputting the weighted features is created as well.

The relay weights are set through governance. They aren't used yet because we need to start tracking pigeon performance for some of them, and we need to track pigeon's fees for one. Once these are tracked, the weights will come into play. Until then, all pigeons are of equal weight and are selected semi-randomly, similar to how pigeons are selected today. Additionally, once weights come into play, some pigeons may have the same weight. When this happens, the top tier of weighted pigeons are selected randomly. This prevents consistently assigning all work to the same pigeon.

This is also a small bit of reorganizing interfaces in this PR, which assisted in making the testing cleaner.

Once this and it's corresponding Pigeon PR are in use, Pigeons will no longer pick messages to relay. They will instead be assigned messages to relay.

Testing completed

  • wrote tests
  • tested on a local private testnet

Breaking changes

  • I have checked my code for breaking changes

Tyler Ruppert added 5 commits July 5, 2023 14:03
* Build out the assignment piece that selects a relayer based on a set
  of weights
* For now, the relayers have equal dummy stats, so this will mostly
  randomly assign relayers until we start tracking stats
* Also renamed "speed" to "executionTime" to be more intuitive
* Instead of having Pigeon pick the correct messages, Paloma now assigns a message to a pigeon and only returns assigned messages to pigeons when they request messages
* I've exposed two new query endpoints for pigeons to specifically request messages they need to attest and messages they need to relay.  This replaces the catch-all query that returns all messages in the queue
* I moved some of the logic of relay messages into paloma.  For instance, if a message already has errorData or publicAccessData, it won't be sent to a pigeon for relaying.  There is still some in Pigeon we will want to bring over later.
@ToasterTheBrave ToasterTheBrave force-pushed the toaster/relayer-scheduling-logic branch from b2de475 to 766b5de Compare July 5, 2023 20:03
x/consensus/keeper/concensus_keeper.go Outdated Show resolved Hide resolved
x/consensus/keeper/concensus_keeper.go Outdated Show resolved Hide resolved
x/consensus/keeper/query_queued_messages_for_relaying.go Outdated Show resolved Hide resolved
* Remove useless comment
* Don't use pointers in slices for new code
* (not actually requested) specify size of slices when we know it
* Try not to panic
@ToasterTheBrave
Copy link
Contributor Author

Changes made. This is ready for another review

Copy link
Contributor

@byte-bandit byte-bandit left a comment

Choose a reason for hiding this comment

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

Let's get it out! :)

@ToasterTheBrave ToasterTheBrave merged commit a6f9f19 into palomachain:master Jul 6, 2023
1 check passed
@ToasterTheBrave ToasterTheBrave deleted the toaster/relayer-scheduling-logic branch July 6, 2023 15:26
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.

2 participants