Add reward field to unrewarded relayers #2613
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
related to #2486
First reviewable part of the #2605. This PR:
RewardAtSource
type, which is used to order relayer bids at the target chain (this part will be added later - for now reference to Finishing "Additional priority boost for relayers that have explicitly registered at lane" #2605). Since we are using single instance of relayers pallet to bridge with all Substrate-based chains (and it actually makes sense to do that), it is difficult to make the code generic over the actual type. So itu64
. At the same time, the "core" code does not impose any additional meaning onto this type. So e.g. it may mean milliDOTs and the payment will be made in DOTs orMultiAsset
s, containing DOTs;reward_per_message: RewardAtSource
field to the unrewarded relayers vector. It is eventually reported to the source chain, where this reward is actually mapped onto real reward type (seecalc_relayers_rewards_at_source
function);DeliveryPayments::delivery_reward_per_message
, which shall return thisreward_per_message
field value, that is later proved to the source chain.The most controversial stuff here is the
RewardAtSource
type, which is fixed tou64
. Do not think we can easily get rid of that hardcoded type. We can change it tou128
(Polkadot-like chains are using it as a native token balance type), but I do not think we expect such large rewards.