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

Finishing "Additional priority boost for relayers that have explicitly registered at lane" #2605

Open
wants to merge 66 commits into
base: bridges-v2
Choose a base branch
from

Conversation

svyatonik
Copy link
Contributor

related to #2486
follow up for #2597 (hence on top of it)

Opening it to give additional context when reviewing #2597. While there's still a lot of remaining work + a ton of TODOs, it show additional pallet calls + other changes, required for #2597. A brief overview:

  • new LaneRelayersSet structure. It contains the current active set of lane relayers + next set + a block number, when the next_set may replace the active_set;
  • relayers in the LaneRelayersSet are ordered by the reward that they are willing to receive for delivering a single message. Relayers, which are ready to "work" for smaller reward will push our relayers, wanting larger reward. In theory it should eventually affect the message fee that is paid at the sending chain (AH) if we'll implement reporting (or sending chains will receive this information in some other way). For now it should make the bridge cheaper for mantainers;
  • relayer registration is considered active even if current stake is lower than the required (i.e. if RequiredStake was increased after relayer has registered itself);
  • relayer registration is considered IF relayer has registered itself at least at one lane. So even initially his registration should have finished at block 1_000, registration may be active (so he can't claim his funds back) even at block 2_000 if he's registered at some lane;
  • added draft prototypes for register_at_lane and deregister_at_lane calls that the relayer will be able to call;
  • added enact_next_relayers_set_at_lane call - it shall be called explicitly by one of relayers from the next_set for free (or for regular fee for other submitters) to activate the next_set. Why separate call? Because otherwise, we need to dance with hooks (on_initialize, on_idle, ...) and this is not well-scalable.

There's a chance that I'll split this PR into several smaller PRs in the future, if it'll grow to unreviewable state.

@svyatonik
Copy link
Contributor Author

It is ready for review, but I'd like to extract couple of other changes into separate PRs to make it easier for review => still draft

@svyatonik
Copy link
Contributor Author

Marking this PR ready for review - it is still large, but all remaining changes are about managing those new ActiveLaneRelayersSet and NextLaneRelayersSet sets, so imo it makes sense to review it altogether.

@svyatonik svyatonik marked this pull request as ready for review October 30, 2023 08:54
@svyatonik
Copy link
Contributor Author

I completely forgot about this gist I've made some time ago: https://gist.github.com/svyatonik/398bfd306541b693fe5afe37dc68f908

So #2597 + this PR + TODOs described in #2618 is the implementation of "Stage 1" from that gist, in particular this chapter: https://gist.github.com/svyatonik/398bfd306541b693fe5afe37dc68f908#relayers-queue-and-priority-boosts. I could provide more details if required, but feel free to review @paritytech/bridges-core . Thank you!

@serban300 serban300 self-requested a review February 15, 2024 17:05
@serban300 serban300 changed the base branch from master to master-backup April 11, 2024 06:31
@serban300 serban300 changed the base branch from master-backup to bridges-v2 April 11, 2024 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant