palomachain / paloma

The fast blockchain messenger protocol
Apache License 2.0
290 stars 136 forks source link

Enable performance based relayer selection #1226

Closed byte-bandit closed 1 month ago

byte-bandit commented 1 month ago

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

Breaking changes