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

Collect fixed fees for certain transactions #232

Closed
2 of 3 tasks
ethanfrey opened this issue Dec 10, 2018 · 3 comments
Closed
2 of 3 tasks

Collect fixed fees for certain transactions #232

ethanfrey opened this issue Dec 10, 2018 · 3 comments
Assignees

Comments

@ethanfrey
Copy link
Contributor

ethanfrey commented Dec 10, 2018

Please read update at end....

The current fee module is designed to request a user-specified fee that can be used to control priority among multiple competing transactions. There is the idea of a global minimum fee, but this just works as a spam filter for transactions, rather than anything fine-grained to charge for specific transactions.

One essential part of the economics at launch is to charge for name registration, and especially for name-space registration. Eventually there should be a more dynamic fee definition, but for start, we can have a fixed fee for certain transactions that is defined in the genesis file. (This means it is stored in the kv store, and we can theoretically add a transaction to modify it later).

Please not answers were updated on 22.1.2019

Please use gconf style for configuring fees in genesis file. The message path can be used to lookup the fees. If a message is not configured, then this implies no product fees (no panic)

Answers:

  • All fees in IOV token, (no different currencies)
  • Are these fees auto-deducted from the signer's account, or do they come out of the fee section (failing if fees is smaller than required tx cost)
    • Fee section on tx includes anti-spam fee and the product fee, all fees that go to the validators. If we have other fees that go to other accounts (not validator pool), they will need a separate section.
    • It must be easy for a client to reliably query the cost before submitting a transaction. This is a UX requirement for both cases.
      Where do we store these fees? Is this defined on a per-package basis, or is there a global lookup table, separate module, that store all fee definitions.?
    • This is a development decision, but since we need an easy way to query expected fee for any transaction before submitting it, a unified format to query them is highly desirable and probably easier if this was all in one module.
    • Each registered transaction type should be able to register the fee.
    • All product fees go to same location as the anti-spam fees (maybe unify these in one module for easier config)
  • Currently, we only consider cases of per message type fees, in the future, we will likely need per message fees, as registering a username under one namespace may have a different cost than under another. But that complexity is left for another story, as business requirements are still solidifying there, and will be well after launch in all cases.

This should provide a basic product fee implementation we can start using in the client, but this will be interated upon in the future, so please code for extensibility.

update

After discussion in #323 I have decided to break this into three tasks:

Note that this architecture makes the generic decorator just one way of adding fees, and we could instead use custom code in a handler to do deeper introspection of a type and use custom logic to determine required fee.

@ethanfrey
Copy link
Contributor Author

SHould work with batch. eg. if I send a batch with 3 setName tx, it will deduct 3 times the cost of registering a setName (same as if I submitted those messages as three independent transactions).

This just means that the fee deduction should happen "downstream" from the batch decorator/middleware

@ruseinov
Copy link
Contributor

@alpe @ethanfrey As I'm looking into this - it does not make much sense to use gconf directly for these values, as since we need to look them up from the client - it would make more sense to use initializer pattern and load all that into a bucket on startup.
I agree though that the format of this should be:
{"msg_path": {"whole": 12, "fractional":33}

Let me know if this makes sense

@ruseinov
Copy link
Contributor

Also, whenever we need to extend this with lookups by message contents for dynamic fees - that'd be definitely stored in a bucket and communicated via transactions and not genesis.

@husio husio self-assigned this Mar 5, 2019
husio added a commit that referenced this issue Mar 5, 2019
husio added a commit that referenced this issue Mar 5, 2019
husio added a commit that referenced this issue Mar 5, 2019
@husio husio closed this as completed in c74db3d Mar 7, 2019
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

No branches or pull requests

3 participants