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

Allow farmer to set extra fee on its nodes #725

Closed
renauter opened this issue Jun 6, 2023 · 2 comments
Closed

Allow farmer to set extra fee on its nodes #725

renauter opened this issue Jun 6, 2023 · 2 comments
Assignees
Labels
priority_major type_feature New feature or request
Milestone

Comments

@renauter
Copy link
Collaborator

renauter commented Jun 6, 2023

Specifications

  • This feature is about allowing a farmer to get extra income from the node by setting an extra fee.
    There is no specific objective reason or metric (good hardware quality, extra GPU capacity, ...) for adding this extra fee.
    It is just the farmer's freedom to evaluate how much he should get extra from its node.
  • By setting this extra fee the node will ONLY be eligible for dedicated node use (meaning the full node is rent ie. under a rent contract).
  • Also while billing, unlike the regular billed amount that is distributed following the traditional schema, the full extra fee directly goes to farmer's account.
  • The extra fee will be expressed in mUSD/month and will require a convertion in TFT for billing purpose.

Implementation details

To implement this feature we will need to add some new items in TFGrid pallet:

  • a storage map called DedicatedNodesExtraFee that links a node id to an extra fee (type u64).
    The map type will be OptionQuery since default value will be None, which means there will be no extra fee billed in a rent contract context.
    No migration will be required by adding this storage.

  • a set_dedicated_node_extra_fee(node_id, extra_fee_factor) extrinsic that can be called by the node's owner (farmer).
    It will not be possible to modify the value by calling this extrinsic while a rent contract is running on the node.

Further considerations

  • The need of setting limits to extra fee (a max value)?
  • Can a sudo authority call set_dedicated_node_extra_fee()?
  • Do we apply the user discounts to the extra fee? dedicated discount = 50% + staking discount = up to 60%
@DylanVerstraete
Copy link
Contributor

For your extra questions:

  1. No need to set limits
  2. No sudo
  3. No discount

@mohamedamer453
Copy link

Verified on devnet.

Setting an extra fee for a node is now allowed from the dashboard

image

image

and as seen from graphql it is reflected there and also the node is set as dedicated once the extra fee is added.

image

@github-project-automation github-project-automation bot moved this from Verification to Done in 3.11.x Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority_major type_feature New feature or request
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants