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: not payee set for relayer caller #1654

Merged
merged 11 commits into from
Oct 25, 2024
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* (testground)[1649](https://github.com/crypto-org-chain/cronos/pull/1649) Fix running single validator benchmark locally.
* (cli)[#1647](https://github.com/crypto-org-chain/cronos/pull/1647) Fix node can't shutdown by signal.
* (testground)[#1652](https://github.com/crypto-org-chain/cronos/pull/1652) Remove unexpected conflicts in benchmark transactions.
* [#1654](https://github.com/crypto-org-chain/cronos/pull/1654) Set relayer as payee for relayer caller when enabled incentivized packet.
* [#1655](https://github.com/crypto-org-chain/cronos/pull/1655) Fix state overwrite in debug trace APIs.
* [#1663](https://github.com/crypto-org-chain/cronos/pull/1663) Align attributes for ibc timeout event.

Expand Down
22 changes: 12 additions & 10 deletions integration_tests/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,12 @@ def combine_batch_multisig_tx(
def broadcast_tx(self, tx_file, **kwargs):
kwargs.setdefault("broadcast_mode", "sync")
kwargs.setdefault("output", "json")
return json.loads(
rsp = json.loads(
self.raw("tx", "broadcast", tx_file, node=self.node_rpc, **kwargs)
)
if rsp["code"] == 0:
rsp = self.event_query_tx_for(rsp["txhash"])
return rsp

def broadcast_tx_json(self, tx, **kwargs):
with tempfile.NamedTemporaryFile("w") as fp:
Expand Down Expand Up @@ -1612,10 +1615,7 @@ def register_counterparty_payee(
return rsp

def register_payee(self, port_id, channel_id, relayer, payee, **kwargs):
default_kwargs = {
"home": self.data_dir,
}
return json.loads(
rsp = json.loads(
self.raw(
"tx",
"ibc-fee",
Expand All @@ -1625,14 +1625,15 @@ def register_payee(self, port_id, channel_id, relayer, payee, **kwargs):
relayer,
payee,
"-y",
**(default_kwargs | kwargs),
home=self.data_dir,
**kwargs,
)
)
if rsp["code"] == 0:
rsp = self.event_query_tx_for(rsp["txhash"])
return rsp

def pay_packet_fee(self, port_id, channel_id, packet_seq, **kwargs):
default_kwargs = {
"home": self.data_dir,
}
rsp = json.loads(
self.raw(
"tx",
Expand All @@ -1642,7 +1643,8 @@ def pay_packet_fee(self, port_id, channel_id, packet_seq, **kwargs):
channel_id,
str(packet_seq),
"-y",
**(default_kwargs | kwargs),
home=self.data_dir,
**kwargs,
)
)
if rsp["code"] == 0:
Expand Down
13 changes: 10 additions & 3 deletions integration_tests/ibc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,22 @@ def prepare_network(


def register_fee_payee(src_chain, dst_chain):
port_id = "transfer"
channel_id = "channel-0"
rsp = dst_chain.register_counterparty_payee(
"transfer",
"channel-0",
port_id,
channel_id,
dst_chain.address("relayer"),
src_chain.address("signer1"),
from_="relayer",
fees="100000000basecro",
)
assert rsp["code"] == 0, rsp["raw_log"]
# relayer = src_chain.address("signer1")
# relayer_caller = eth_to_bech32(RELAYER_CALLER)
# rsp = src_chain.register_payee(
# port_id, channel_id, relayer_caller, relayer, _from=relayer_caller
# )


def assert_ready(ibc):
Expand Down Expand Up @@ -337,7 +344,7 @@ def get_balances(chain, addr):

def ibc_multi_transfer(ibc):
chains = [ibc.cronos.cosmos_cli(), ibc.chainmain.cosmos_cli()]
users = [f"user{i}" for i in range(1, 51)]
users = [f"user{i}" for i in range(1, 1)]
addrs0 = [chains[0].address(user) for user in users]
addrs1 = [chains[1].address(user) for user in users]
denom0 = "basetcro"
Expand Down
10 changes: 5 additions & 5 deletions integration_tests/test_ibc_rly.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from .ibc_utils import (
RATIO,
RELAYER_CALLER,
assert_duplicate,
cronos_transfer_source_tokens,
cronos_transfer_source_tokens_with_proxy,
Expand All @@ -16,6 +15,7 @@
ibc_multi_transfer,
ibc_transfer,
prepare_network,
rly_transfer,
)
from .utils import (
ADDRS,
Expand Down Expand Up @@ -52,7 +52,7 @@ def ibc(request, tmp_path_factory):
yield from prepare_network(
path,
name,
relayer=cluster.Relayer.HERMES.value,
relayer=cluster.Relayer.RLY.value,
)


Expand Down Expand Up @@ -236,7 +236,7 @@ def test_ibc(ibc):
w3 = ibc.cronos.w3
wait_for_new_blocks(ibc.cronos.cosmos_cli(), 1)
start = w3.eth.get_block_number()
ibc_transfer(ibc)
ibc_transfer(ibc, rly_transfer)
denom = ibc_denom(channel, src_denom)
logs = get_logs_since(w3, CONTRACT, start)
chainmain_cli = ibc.chainmain.cosmos_cli()
Expand Down Expand Up @@ -293,8 +293,8 @@ def test_ibc_incentivized_transfer(ibc):
acknowledge_packet(seq0),
distribute_fee(src_relayer, fee),
*send_coins(feeibc_addr, src_relayer, src_amount, fee_denom),
distribute_fee(RELAYER_CALLER, fee),
*send_coins(feeibc_addr, RELAYER_CALLER, src_amount, fee_denom),
distribute_fee(src_relayer, fee),
*send_coins(feeibc_addr, src_relayer, src_amount, fee_denom),
distribute_fee(cronos_signer2, ""),
*send_coins(feeibc_addr, cronos_signer2, 0, fee_denom),
fungible(checksum_dst_adr, cronos_signer2, amount, dst_denom),
Expand Down
5 changes: 3 additions & 2 deletions integration_tests/test_ibc_rly_gas.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
ibc_transfer,
log_gas_records,
prepare_network,
rly_transfer,
)
from .utils import wait_for_new_blocks

Expand All @@ -18,7 +19,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.HERMES.value)
yield from prepare_network(path, name, relayer=cluster.Relayer.RLY.value)


records = []
Expand All @@ -28,7 +29,7 @@ def test_ibc(ibc):
# chainmain-1 relayer -> cronos_777-1 signer2
cli = ibc.cronos.cosmos_cli()
wait_for_new_blocks(cli, 1)
ibc_transfer(ibc)
ibc_transfer(ibc, rly_transfer)
ibc_incentivized_transfer(ibc)
ibc_multi_transfer(ibc)
diff = 0.1
Expand Down
6 changes: 3 additions & 3 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@
"homepage": "https://github.com/crypto-org-chain/relayer",
"owner": "crypto-org-chain",
"repo": "relayer",
"rev": "fe5722292a9961e80818e3ef5c987330b538bc05",
"sha256": "0jv4pkrqhckbabxxxbr0bcil0fakbnc7sf22k2wa5q6v6921ci0y",
"rev": "a7139118e7204a80e5c277a84a91be2bb8884147",
"sha256": "sha256:1ps8lyh3v0zbwb6dilrn009iwkyck73p17mc0a75w806f1wsxzmn",
"type": "tarball",
"url": "https://github.com/crypto-org-chain/relayer/archive/fe5722292a9961e80818e3ef5c987330b538bc05.tar.gz",
"url": "https://github.com/mmsqe/relayer/archive/a7139118e7204a80e5c277a84a91be2bb8884147.tar.gz",
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
Loading
Loading