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 #59

Open
vikramrajkumar opened this issue Jan 17, 2017 · 3 comments
Open

Audit charging of per-kilobyte fees #59

vikramrajkumar opened this issue Jan 17, 2017 · 3 comments

Comments

@vikramrajkumar
Copy link
Contributor

From @theoreticalbts on July 31, 2015 15:22

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.

Copied from original issue: cryptonomex/graphene#216

@vikramrajkumar
Copy link
Contributor Author

From @theoreticalbts on July 31, 2015 15:28

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.

@vikramrajkumar
Copy link
Contributor Author

From @theoreticalbts on July 31, 2015 15:32

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
Copy link
Contributor Author

From @theoreticalbts on August 26, 2015 21:41

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

@oxarbitrage oxarbitrage added this to the Hardfork - New features, audits and reviews milestone Aug 13, 2017
@abitmore abitmore modified the milestones: Hardfork - New features, audits and reviews, Future Consensus-Changing Release Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants