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

Problem: require gas in relayer precompile is higher than consumed #1232

Merged
merged 10 commits into from
Nov 6, 2023
Prev Previous commit
Next Next commit
Update x/cronos/keeper/precompiles/relayer.go
Co-authored-by: yihuang <huang@crypto.com>
Signed-off-by: mmsqe <mavis@crypto.com>
  • Loading branch information
mmsqe and yihuang authored Nov 6, 2023
commit 5eefb77dc7bac64e365ac14637742c5e8c22ba92
2 changes: 1 addition & 1 deletion x/cronos/keeper/precompiles/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (bc *RelayerContract) Address() common.Address {
}

// RequiredGas calculates the contract gas use
// `len(input) * DefaultTxSizeCostPerByte + requiredGasTable[methodPrefix] - intrinsicGas`
// `max(0, len(input) * DefaultTxSizeCostPerByte + requiredGasTable[methodPrefix] - intrinsicGas)`
func (bc *RelayerContract) RequiredGas(input []byte) (gas uint64) {
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
if len(input) < prefixSize4Bytes {
return 0
Expand Down
Loading