-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reward_item: &mut RewardItem<T::AccountId, BalanceOf<T, I>>, | ||
) { | ||
// MessageRelayersRewardRatio total reward => message relayer | ||
let message_reward = T::MessageRelayersRewardRatio::get() * total_reward; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe in another PR, need to handle the dispatch fee (message.weight)
https://github.com/darwinia-network/darwinia-messages-substrate/issues/142
|
I find a issue while doing tests: Assuming the fee market with 3 assigned relayers A, B, C with quota QA, QB, QC. If there is a order confirmed at the third slot, the message fee paied by user is QC in this case, the slot price is also QC when calculate rewards. Thus the message_surplus is 0, the slot duty reward for C is zero as well. That's seems make no sense. Confirmed in the third slot is still considered in-time delivery, the slot duty reward for C should not be zero. @hackfisher @hujw77 |
This looks good to me, C still will get incentives from the message reward. |
It may not be the case, C may not be a message deliver or confirm relayer. Check out this test case: https://github.com/darwinia-network/darwinia-messages-substrate/blob/bear-slash-empty-relayers/modules/fee-market/src/tests.rs#L1027-L1060 |
* Add basic solution * Refactor Slash Report * Refactor Slash Report 2 * Add other changes * Add tests * Self review * Rename to `message_and_confirm_reward` * Rename to `previous_relayers` * Rename to AssignedRelayer * Add more comments * Add more comments * Add new reward implementation * Rename and clean the code, needs more test * Add more docs here * Prepare for tests * Fix broken tests * Refactor * Rename * Remove RewardBook * Self review * Save one storage * Try fix ci
* Add basic solution * Refactor Slash Report * Refactor Slash Report 2 * Add other changes * Add tests * Self review * Rename to `message_and_confirm_reward` * Rename to `previous_relayers` * Rename to AssignedRelayer * Add more comments * Add more comments * Add new reward implementation * Rename and clean the code, needs more test * Add more docs here * Prepare for tests * Fix broken tests * Refactor * Rename * Remove RewardBook * Self review * Save one storage * Try fix ci
* Add basic solution * Refactor Slash Report * Refactor Slash Report 2 * Add other changes * Add tests * Self review * Rename to `message_and_confirm_reward` * Rename to `previous_relayers` * Rename to AssignedRelayer * Add more comments * Add more comments * Add new reward implementation * Rename and clean the code, needs more test * Add more docs here * Prepare for tests * Fix broken tests * Refactor * Rename * Remove RewardBook * Self review * Save one storage * Try fix ci
* Add basic solution * Refactor Slash Report * Refactor Slash Report 2 * Add other changes * Add tests * Self review * Rename to `message_and_confirm_reward` * Rename to `previous_relayers` * Rename to AssignedRelayer * Add more comments * Add more comments * Add new reward implementation * Rename and clean the code, needs more test * Add more docs here * Prepare for tests * Fix broken tests * Refactor * Rename * Remove RewardBook * Self review * Save one storage * Try fix ci
* Update market after order is created or comfirmed (#94) * Update order capacity * FIX CI * Update comment * Redesign fee market payment (#169) * Add basic solution * Refactor Slash Report * Refactor Slash Report 2 * Add other changes * Add tests * Self review * Rename to `message_and_confirm_reward` * Rename to `previous_relayers` * Rename to AssignedRelayer * Add more comments * Add more comments * Add new reward implementation * Rename and clean the code, needs more test * Add more docs here * Prepare for tests * Fix broken tests * Refactor * Rename * Remove RewardBook * Self review * Save one storage * Try fix ci * Handle Zero `CollateralPerOrder` (#176) * Companion 189 for darwinia-parachain (#194) * Update fee-market terminology (#192) (#199) * Support pangolin <> pangolin parachain alpha bridge (#190) * Cherry-pick #201 to `darwinia-parachain` (#203) * Del useless related to fee calculation (#201) * Delete estimate_delivery_transaction * Delete transaction_payment * Delete MessageTransaction * Code clean * Fix compile * Anchor polkadot-v0.9.27 * remove unused import * Fix test problem (#172) * fix ci * Add necessary reward event (#89) * Refactor the total reward cal * Code Clean * Fix test * Add OrderCreated event * Self review * Update comment * Update OrderCreate event to include relayers * Fix review * Enhance dispatch module (#121) * rm shift session manager pallet and clean useless imports (#128) * `Pre-dispatch` validate for main branch (#130) * Adjust the traits * Try fix compile * Fix tests * Code clean * Avoid duplicate evm transact fees (#136) * cherry pick #137 (#140) * cherry pick #137 * pick #141 Co-authored-by: bear <boundless.forest@outlook.com> * Drop error in `pre_dispatch` (#152) (#153) * Migrate to new s2s bridge (#149) * Add client-darwinia/client-crab/client-crab-parachain * Update CI * rever substrate commit * fix compile * remove transactional * Fix * Bump finality-grandpa to v0.16.0 * fix wrong import * make change follow paritytech/substrate#11415 * Add runtime-common to workspace and try fix test * Make changes follow paritytech/substrate#10242 * Code clean * More ci check * Remove integrity Co-authored-by: bear <boundless.forest@outlook.com> * Companion for #155 (#157) * Update market after order is created or comfirmed (#94) * Update order capacity * FIX CI * Update comment * Redesign fee market payment (#169) * Add basic solution * Refactor Slash Report * Refactor Slash Report 2 * Add other changes * Add tests * Self review * Rename to `message_and_confirm_reward` * Rename to `previous_relayers` * Rename to AssignedRelayer * Add more comments * Add more comments * Add new reward implementation * Rename and clean the code, needs more test * Add more docs here * Prepare for tests * Fix broken tests * Refactor * Rename * Remove RewardBook * Self review * Save one storage * Try fix ci * Handle Zero `CollateralPerOrder` (#176) * Update Fee market docs (#178) * Update doc * Update example * Move to `dev-dependencies` (#182) * Sync part.1 (#184) * Remove fee relates (#186) * Sync missing changes from different branches (#191) * Support pangolin <> pangolin parachain alpha bridge (#190) * Integrate `fee-market` to `FromThisChainMessageVerifier` (#189) * Run ignored crate * Fix tests * Add features * Fix compile * Update fee-market terminology (#192) * Del useless related to fee calculation (#201) * Delete estimate_delivery_transaction * Delete transaction_payment * Delete MessageTransaction * Code clean * master > polkadot-v0.9.27 * roll back bp-parachain Co-authored-by: bear <boundless.forest@outlook.com> Co-authored-by: Xavier Lau <xavier@inv.cafe> Co-authored-by: Aki Wu <aki.wu@itering.com> Co-authored-by: HackFisher <denny.wang@itering.io> Co-authored-by: HackFisher <hackfisher@gmail.com> Co-authored-by: fewensa <37804932+fewensa@users.noreply.github.com>
* Anchor polkadot-v0.9.27 * Companion for paritytech/cumulus#1436 * Companion for paritytech/cumulus#1421 * Companion for paritytech/cumulus#1350 * Companion for paritytech/cumulus#1456 * Use messages-substrate prepare-polkadot-v0.9.27 for debug * Companion for darwinia-network/darwinia-messages-substrate#169 * Companion for darwinia-network/darwinia-messages-substrate#192 * Companion for darwinia-network/darwinia-messages-substrate#186 * Companion for darwinia-network/darwinia-messages-substrate#201 * Missing part companion for darwinia-network/darwinia-messages-substrate#169 * format * replace prepare-polkadot-v0.9.27 -> polkadot-v0.9.27 * use `PANGOLIN_PANGOLIN_PARACHAIN_LANE` from `bridge_runtime_common` (#151) * format * Bump dependencies Co-authored-by: Xavier Lau <xavier@inv.cafe>
TODO