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: packed batch is not supported #1476

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions integration_tests/configs/ibc.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ config {
id: 'cronos_777-1',
max_gas: 2500000,
gas_multiplier: 1.1,
max_msg_num: 5,
address_type: {
derivation: 'ethermint',
proto_type: {
Expand Down
9 changes: 5 additions & 4 deletions integration_tests/contracts/contracts/TestRelayer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ pragma solidity ^0.8.4;
contract TestRelayer {
address constant relayer = 0x0000000000000000000000000000000000000065;

function batchCall(bytes[] memory payloads) public {
for (uint256 i = 0; i < payloads.length; i++) {
(bool success,) = relayer.call(payloads[i]);
require(success);
function batchCall(bytes[][] memory batches) public {
for (uint256 i = 0; i < batches.length; i++) {
bytes memory payload = abi.encode(batches[i]);
(bool success, ) = relayer.call(payload);
require(success, "Relayer call failed");
}
}
}
9 changes: 4 additions & 5 deletions integration_tests/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion integration_tests/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protobuf = "^4.25"
python-dateutil = "^2.8"
web3 = "^6.15"
python-dotenv = "^1.0"
pystarport = { git = "https://github.com/crypto-com/pystarport.git", branch = "main" }
pystarport = { git = "https://github.com/mmsqe/pystarport.git", branch = "packed_batch" }
websockets = "^12.0"
toml = "^0"
jsonnet = "^0"
Expand Down
5 changes: 3 additions & 2 deletions integration_tests/test_ibc_rly.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
ibc_multi_transfer,
ibc_transfer,
prepare_network,
rly_transfer,
)
from .utils import (
ADDRS,
Expand Down Expand Up @@ -52,7 +53,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 @@ -230,7 +231,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, transfer_fn=rly_transfer)
denom = ibc_denom(channel, src_denom)
logs = get_logs_since(w3, CONTRACT, start)
chainmain_cli = ibc.chainmain.cosmos_cli()
Expand Down
8 changes: 6 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 @@
"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,13 +29,16 @@
# chainmain-1 relayer -> cronos_777-1 signer2
cli = ibc.cronos.cosmos_cli()
wait_for_new_blocks(cli, 1)
ibc_transfer(ibc)
ibc_transfer(ibc, transfer_fn=rly_transfer)
# ibc_transfer(ibc)
ibc_incentivized_transfer(ibc)
ibc_multi_transfer(ibc)
diff = 0.1
record = log_gas_records(cli)
if record:
print("mm-record", record)
records.append(record)
if len(records) == 2:
res = float(sum(records[0]) / sum(records[1]))
print("mm-res", res)
assert 1 - diff <= res <= 1 + diff, res

Check failure on line 44 in integration_tests/test_ibc_rly_gas.py

View workflow job for this annotation

GitHub Actions / integration_tests (ibc_rly_gas)

test_ibc[ibc_rly] AssertionError: 1.122931744612125 assert 1.122931744612125 <= (1 + 0.1)
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": "9993381407ea57ea75ffb3ebd9e07a9d1ebed2f2",
"sha256": "0kjs1s2ap90rrn4qvbibhad0c4hv4qp9m2nx1mnabadw9yhj5i0b",
"type": "tarball",
"url": "https://github.com/crypto-org-chain/relayer/archive/fe5722292a9961e80818e3ef5c987330b538bc05.tar.gz",
"url": "https://github.com/mmsqe/relayer/archive/9993381407ea57ea75ffb3ebd9e07a9d1ebed2f2.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
Loading
Loading