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

Make pallet-bridge-rewards generic over RewardKind #7492

Merged
merged 61 commits into from
Feb 19, 2025
Merged

Conversation

bkontur
Copy link
Contributor

@bkontur bkontur commented Feb 5, 2025

Closes: #7272
Relates to: #6578
Relates to: #7274

Description

The PR enhances the pallet-bridge-rewards by making it generic over the RewardKind type (previously hardcoded as RewardsAccountParams). This modification allows the pallet to support multiple reward types (e.g., P/K bridge, Snowbridge), increasing its flexibility and applicability across various bridge scenarios.

Other pallets can register rewards using bp_relayers::RewardLedger, which is implemented by the rewards pallet. The runtime can then be configured with different mechanisms for paying/claiming rewards via bp_relayers::PaymentProcedure (e.g., see the pub struct BridgeRewardPayer; implementation for BridgeHubWestend).

Follow-up

The removed balances/rewards statistics from the complex relay (no longer used) will eventually be reintroduced or fixed in the standalone relayers via paritytech/parity-bridges-common#3004 (comment).

@bkontur bkontur added the T15-bridges This PR/Issue is related to bridges. label Feb 5, 2025
@bkontur bkontur self-assigned this Feb 5, 2025
@bkontur
Copy link
Contributor Author

bkontur commented Feb 10, 2025

/cmd fmt

@bkontur
Copy link
Contributor Author

bkontur commented Feb 11, 2025

/cmd fmt

@paritytech-review-bot paritytech-review-bot bot requested a review from a team February 17, 2025 12:41
@bkontur bkontur requested a review from serban300 February 17, 2025 13:51
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/13373735000
Failed job name: fmt

@bkontur
Copy link
Contributor Author

bkontur commented Feb 18, 2025

/cmd fmt

@serban300 serban300 mentioned this pull request Feb 18, 2025
Copy link
Contributor

@serban300 serban300 left a comment

Choose a reason for hiding this comment

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

LGTM combined with #7609

bkontur and others added 2 commits February 19, 2025 14:10
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Serban Iorga <serban@parity.io>
@bkontur bkontur enabled auto-merge February 19, 2025 13:23
@bkontur bkontur added this pull request to the merge queue Feb 19, 2025
Merged via the queue into master with commit ba7cb48 Feb 19, 2025
249 of 254 checks passed
@bkontur bkontur deleted the bko-rewards branch February 19, 2025 15:24
@bkontur bkontur added the A4-needs-backport Pull request must be backported to all maintained releases. label Mar 3, 2025
@paritytech-cmd-bot-polkadot-sdk
Copy link
Contributor

Git push to origin failed for stable2407 with exitcode 1

@paritytech-cmd-bot-polkadot-sdk
Copy link
Contributor

Git push to origin failed for stable2409 with exitcode 1

@paritytech-cmd-bot-polkadot-sdk
Copy link
Contributor

Git push to origin failed for stable2412 with exitcode 1

@paritytech-cmd-bot-polkadot-sdk
Copy link
Contributor

Git push to origin failed for stable2503 with exitcode 1

bkontur added a commit that referenced this pull request Mar 3, 2025
Closes: #7272
Relates to: #6578
Relates to: #7274

The PR enhances the `pallet-bridge-rewards` by making it generic over
the `RewardKind` type (previously hardcoded as `RewardsAccountParams`).
This modification allows the pallet to support multiple reward types
(e.g., P/K bridge, Snowbridge), increasing its flexibility and
applicability across various bridge scenarios.

Other pallets can register rewards using `bp_relayers::RewardLedger`,
which is implemented by the rewards pallet. The runtime can then be
configured with different mechanisms for paying/claiming rewards via
`bp_relayers::PaymentProcedure` (e.g., see the `pub struct
BridgeRewardPayer;` implementation for BridgeHubWestend).

The removed balances/rewards statistics from the complex relay (no
longer used) will eventually be reintroduced or fixed in the standalone
relayers via
paritytech/parity-bridges-common#3004 (comment).

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Serban Iorga <serban@parity.io>
EgorPopelyaev pushed a commit that referenced this pull request Mar 3, 2025
Backport #7492 into `stable2503` from bkontur.

Manual backport, because `A4-needs-backport` bot failed for some
permission reasons of touched CI files in the original PR:
#7492 (comment)

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Serban Iorga <serban@parity.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A4-needs-backport Pull request must be backported to all maintained releases. T15-bridges This PR/Issue is related to bridges.
Projects
Status: Done
Status: Backlog
Development

Successfully merging this pull request may close these issues.

Improve pallet-bridge-relayers to support multiple bridges
9 participants