-
Notifications
You must be signed in to change notification settings - Fork 10
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
Namada gas estimation #32
Conversation
// Estimate the fee with dry-run | ||
let (fee_token, gas_limit, fee_amount) = | ||
self.estimate_fee(tx.clone(), &tx_args, signing_data)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all nodes should be required to enable dry running txs via their exposed RPC servers, since these may pose a DoS vector. estimate_fee
should be expected to fail with a nonexistent RPC error, at which point we could fallback to another gas estimation mechanism (e.g. median values that have been benchmarked during a release).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. I'll fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good, for now. In the future, it might be good to provide some other source to estimate gas limits from, namely tables of tx code hashes to gas estimates or something.
* gas estimation * add error * adjust gas * fix script * use the default gas setting when gas estimation failure
closes #30