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

set max gas to double of the charged gas for the 'intrinsic' smart contract calls #472

Merged
merged 3 commits into from
Sep 18, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions params/protocol_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,16 @@ const (
// TODO(asa): Make these operations less expensive by charging only what is used.
// The problem is we don't know how much to refund until the refund is complete.
// If these values are changed, "setDefaults" will need updating.
MaxGasForDebitFromTransactions uint64 = 38 * 1000
ExpectedGasForDebitFromTransactions uint64 = 23 * 1000
MaxGasForCreditToTransactions uint64 = 32 * 1000
MaxGasToReadErc20Balance uint64 = 15 * 1000
MaxGasToReadTobinTax uint64 = 50 * 1000
MaxGasForDebitFromTransactions uint64 = 46 * 1000
kevjue marked this conversation as resolved.
Show resolved Hide resolved

ExpectedGasForCreditToTransactions uint64 = 32 * 1000
MaxGasForCreditToTransactions uint64 = 64 * 1000

ExpectedGasToReadErc20Balance uint64 = 15 * 1000
MaxGasToReadErc20Balance uint64 = 30 * 1000

MaxGasToReadTobinTax uint64 = 50 * 1000
// We charge for reading the balance, 1 debit, and 3 credits (refunding gas, paying the gas fee recipient, sending to the infrastructure fund)
AdditionalGasForNonGoldCurrencies uint64 = 3*MaxGasForCreditToTransactions + ExpectedGasForDebitFromTransactions + MaxGasToReadErc20Balance
AdditionalGasForNonGoldCurrencies uint64 = 3*ExpectedGasForCreditToTransactions + ExpectedGasForDebitFromTransactions + ExpectedGasToReadErc20Balance
)