Skip to content

Commit

Permalink
adjust cost
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed May 31, 2024
1 parent 730cf08 commit 100ba4c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions integration_tests/test_ibc_rly_gas.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from pystarport import cluster

from .ibc_utils import log_gas_records, prepare_network, rly_transfer
from .ibc_utils import hermes_transfer, log_gas_records, prepare_network
from .utils import wait_for_new_blocks

pytestmark = pytest.mark.ibc_rly_gas
Expand All @@ -12,7 +12,7 @@ def ibc(request, tmp_path_factory):
"prepare-network"
name = request.param
path = tmp_path_factory.mktemp(name)
yield from prepare_network(path, name, relayer=cluster.Relayer.RLY.value)
yield from prepare_network(path, name, relayer=cluster.Relayer.HERMES.value)


records = []
Expand All @@ -22,8 +22,8 @@ def test_ibc(ibc):
# chainmain-1 relayer -> cronos_777-1 signer2
cli = ibc.cronos.cosmos_cli()
wait_for_new_blocks(cli, 1)
rly_transfer(ibc)
diff = 0.15
hermes_transfer(ibc)
diff = 0.6
record = log_gas_records(cli)
if record:
records.append(record)
Expand Down
28 changes: 14 additions & 14 deletions x/cronos/keeper/precompiles/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const (
UpdateClientAndTimeout = "updateClientAndTimeout"
UpdateClientAndTimeoutOnClose = "updateClientAndTimeoutOnClose"

GasForUpdateClient = 111894
GasForUpdateClient = 109689
GasWhenReceiverChainIsSource = 51705
GasWhenReceiverChainIsNotSource = 144025
)
Expand All @@ -75,35 +75,35 @@ func init() {
copy(methodID[:], irelayerABI.Methods[methodName].ID[:4])
switch methodName {
case CreateClient:
relayerGasRequiredByMethod[methodID] = 117462
relayerGasRequiredByMethod[methodID] = 114990
case UpdateClient:
relayerGasRequiredByMethod[methodID] = 111894
relayerGasRequiredByMethod[methodID] = GasForUpdateClient
case UpgradeClient:
relayerGasRequiredByMethod[methodID] = 400000
case ConnectionOpenInit:
relayerGasRequiredByMethod[methodID] = 19755
relayerGasRequiredByMethod[methodID] = 89589
case ConnectionOpenTry:
relayerGasRequiredByMethod[methodID] = 38468
relayerGasRequiredByMethod[methodID] = 108323
case ConnectionOpenAck:
relayerGasRequiredByMethod[methodID] = 29603
relayerGasRequiredByMethod[methodID] = 99446
case ConnectionOpenConfirm:
relayerGasRequiredByMethod[methodID] = 12865
relayerGasRequiredByMethod[methodID] = 82735
case ChannelOpenInit:
relayerGasRequiredByMethod[methodID] = 68701
relayerGasRequiredByMethod[methodID] = 138568
case ChannelOpenTry:
relayerGasRequiredByMethod[methodID] = 70562
relayerGasRequiredByMethod[methodID] = 140432
case ChannelOpenAck:
relayerGasRequiredByMethod[methodID] = 22127
relayerGasRequiredByMethod[methodID] = 92000
case ChannelOpenConfirm:
relayerGasRequiredByMethod[methodID] = 21190
relayerGasRequiredByMethod[methodID] = 91060
case ChannelCloseConfirm:
relayerGasRequiredByMethod[methodID] = 31199
relayerGasRequiredByMethod[methodID] = 101072
case RecvPacket:
relayerGasRequiredByMethod[methodID] = GasWhenReceiverChainIsNotSource
case Acknowledgement:
relayerGasRequiredByMethod[methodID] = 61781
relayerGasRequiredByMethod[methodID] = 131657
case Timeout:
relayerGasRequiredByMethod[methodID] = 104283
relayerGasRequiredByMethod[methodID] = 174147
case UpdateClientAndConnectionOpenTry:
relayerGasRequiredByMethod[methodID] = 150362
case UpdateClientAndConnectionOpenConfirm:
Expand Down

0 comments on commit 100ba4c

Please sign in to comment.