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

Snowbridge V2 - Rewards Pallet #6117

Closed

Conversation

claravanstaden
Copy link
Contributor

Description

Adds a rewards pallet, where rewards for relayers will be accumulated. More details in the Snowbridge v2 design: https://github.com/paritytech/polkadot-sdk/blob/master/bridges/snowbridge/docs/v2.md#relayer-rewards

Integration

Since this is a new feature, so it does not affect integration.

Review Notes

TODOs:
[ ] Add deposit from Inbound and Outbound queue.
[ ] Test XCM
[ ] More tests, including integration.

@bkontur
Copy link
Contributor

bkontur commented Oct 18, 2024

We have a similar pallet here: https://github.com/paritytech/polkadot-sdk/tree/master/bridges/modules/relayers for registering relayers (deposits, slashing) and collecting rewards for relayer accounts.

I'm just curious if we could have a single generic pallet for relayers/rewards that could cover both the P/K bridge, the Eth bridge, or any other possible bridge. That would be cool. Essentially, we need to store the same things:

  • Relayer account
  • Reward identifier (for the P/K bridge, we use the kind of lane_id identifier for accumulating rewards; for ETH, I see it uses message_id)
  • Reward (the P/K bridge uses the native token (DOT/KSM), while the ETH bridge uses WETH)

Some good abstraction over the reward identifier to support both, and using xcm::Asset for the reward could potentially cover everything.

@burdges
Copy link

burdges commented Oct 20, 2024

As an aside, we do not have grandpa or beefy rewards planned for validators, but if we ever need them then they'd need a median computation, like polkadot-fellows/RFCs#119 does.

Comment on lines 140 to 144
let xcm: Xcm<()> = vec![
DepositAsset { assets: Definite(deposit.into()), beneficiary },
SetTopic(message_id.into()),
]
.into();
Copy link
Contributor

@yrong yrong Oct 21, 2024

Choose a reason for hiding this comment

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

Withdraw/Teleport + BuyExecution is required to pass the Barrier check for executing any XCM.

@claravanstaden
Copy link
Contributor Author

@bkontur that would definitely be cool, to reuse what is already there. I could see in the future how we also would register relayers and use other functionality in the pallet. Right now we're kind of focused on meeting a tight deadline for v2 and although reusing is a great idea, it usually takes a bit longer to get right since it needs to cater to multiple party's needs. So I think we are going to do the Snowbridge specific pallet (luckily it is very simple) and revisit using your team's pallet in the future.

@claravanstaden
Copy link
Contributor Author

Closing for now, still too WIP and depends on other PRs. Moving the PR to my personal clone: claravanstaden#1

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.

4 participants