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

CheckTx gas estimation #962

Closed
cwgoes opened this issue May 7, 2018 · 3 comments
Closed

CheckTx gas estimation #962

cwgoes opened this issue May 7, 2018 · 3 comments
Assignees

Comments

@cwgoes
Copy link
Contributor

cwgoes commented May 7, 2018

Add a version of CheckTx which runs a transaction, estimates gas, and returns the required gas amount (which can then be used by clients).

Track gas through transaction execution in the Context and abort once a transaction runs out of gas.

@cwgoes cwgoes self-assigned this May 7, 2018
@cwgoes cwgoes added this to the 1.0 Code Freeze milestone May 7, 2018
@cwgoes
Copy link
Contributor Author

cwgoes commented May 7, 2018

Questions:

  • Any better (less onerous) way to implement than threading errors through everything?
  • We want to charge for both storage and compute, is there some known proportionality?
  • Should we add a KVStoreWithGas abstraction for storage cost calculation? Would probably be the most accurate way to calculate costs, but would make the KVStore API more complex.

@cwgoes
Copy link
Contributor Author

cwgoes commented May 7, 2018

To-do:

  • Switch to panic/recover
  • Length-prefixed store values, KVStoreWithGas
  • Refund unused gas

OK to calculate gas-after-read in KVstore, need to be careful about spam attacks with unbounded inputs, either size-cap or check max gas in ValidateMsg.

@cwgoes
Copy link
Contributor Author

cwgoes commented May 16, 2018

Closed by #963, further work outlined in #1008.

@cwgoes cwgoes closed this as completed May 16, 2018
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

1 participant