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

Audit charging of per-kilobyte fees #216

Closed
theoreticalbts opened this issue Jul 31, 2015 · 4 comments
Closed

Audit charging of per-kilobyte fees #216

theoreticalbts opened this issue Jul 31, 2015 · 4 comments

Comments

@theoreticalbts
Copy link
Contributor

Any operation with potentially unbounded size needs to charge a size fee. Determining whether an operation is variable-size is non-trivial. An operation is variable size if it contains a vector, flat_set or other potentially variable-size element.

Note that this containment may be through any number of intermediate structs. For example, any operation which contains an authority has potentially unbounded size.

We should be able to audit this in a semi-automatic way with logic similar to js_operation_serializer which traverses all operations, and noting any variable-size types found (in any number of sub-structures), allowing us to flag each operation as variable-sized (or not). We will still have to manually specify whether any base type is variable-size or not.

@theoreticalbts theoreticalbts self-assigned this Jul 31, 2015
@theoreticalbts
Copy link
Contributor Author

It makes more sense to charge size-based fees on an operation-wide basis, i.e. you serialize the operation, see how big it is, and then charge based on that. Which would give a single size-based fee for all operations, instead of placing size-based fees on each operation. This makes more sense, as size fees are not meant to raise revenue, merely to protect network resources. Therefore size-based fees should be the same for all operation types -- there is no reason to allow them to be settable for each operation individually.

Moreover, as pointed out in the OP, setting size-based fees for each operation individually requires careful auditing to be sure that every operation of potentially unbounded size includes a size-based fee. Having unified size-fee logic would ensure that if an operation with a large serialization occurred, an appropriate fee would always be charged.

@theoreticalbts
Copy link
Contributor Author

The transaction signatures can potentially grow very large, e.g. if you create a large number of multisig accounts with maximum fan-out and use a custom_operation to require them all to sign. A size fee needs to be charged for signatures as well. What this suggests is that the size fee should be charged based on transaction size, including signatures!

@vikramrajkumar vikramrajkumar added this to the alpha milestone Jul 31, 2015
@vikramrajkumar vikramrajkumar modified the milestones: alpha, devshares Aug 10, 2015
@theoreticalbts
Copy link
Contributor Author

Some fee members are share_type, others are uint64_t or even uint32_t. We should be consistent and always use the same type; I recommend share_type

@vikramrajkumar
Copy link
Contributor

This issue was moved to bitshares/bitshares-core#59

pmconrad added a commit to pmconrad/graphene that referenced this issue Jul 29, 2017
pmconrad added a commit to pmconrad/graphene that referenced this issue Jul 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants