-
Notifications
You must be signed in to change notification settings - Fork 273
Problem: require gas in relayer precompile is higher than consumed #1232
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
13b06c8
Problem: require gas in relayer precompile is higher than consumed
mmsqe 3d76f83
fix balance change in timeout test
mmsqe df15db2
fix test
mmsqe 68bae71
simplify event test
mmsqe 32f392b
fix recvPacket
mmsqe 13aa167
add missing channel close
mmsqe ab069ac
fix build
mmsqe 7b3c0f4
Update x/cronos/keeper/precompiles/relayer.go
mmsqe 5eefb77
Update x/cronos/keeper/precompiles/relayer.go
mmsqe e5a4713
Update x/cronos/keeper/precompiles/relayer.go
mmsqe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,24 @@ | ||
| local ibc = import 'ibc.jsonnet'; | ||
|
|
||
| ibc { | ||
| 'chainmain-1'+: { | ||
| validators: [ | ||
| { | ||
| coins: '987870000000000000cro', | ||
| staked: '20000000000000cro', | ||
| mnemonic: '${VALIDATOR' + i + '_MNEMONIC}', | ||
| client_config: { | ||
| 'broadcast-mode': 'block', | ||
| }, | ||
| base_port: 26800 + i * 10, | ||
| } | ||
| for i in std.range(1, 2) | ||
| ], | ||
| }, | ||
| relayer+: { | ||
| chains: [super.chains[0] { | ||
| precompiled_contract_address: '0x0000000000000000000000000000000000000065', | ||
| max_gas: 1000000, | ||
| gas_multiplier: 1.2, | ||
| }] + super.chains[1:], | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| local ibc = import 'ibc_rly.jsonnet'; | ||
|
|
||
| ibc { | ||
| relayer+: { | ||
| chains: [super.chains[0] { | ||
| precompiled_contract_address: '0x0000000000000000000000000000000000000065', | ||
| }] + super.chains[1:], | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import pytest | ||
| from pystarport import cluster | ||
|
|
||
| from .ibc_utils import log_gas_records, prepare_network, rly_transfer | ||
| from .utils import wait_for_new_blocks | ||
|
|
||
|
|
||
| @pytest.fixture(scope="module", params=["ibc_rly", "ibc_rly_evm"]) | ||
| 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) | ||
|
|
||
|
|
||
| records = [] | ||
mmsqe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| 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.5 | ||
| record = log_gas_records(cli) | ||
| if record: | ||
| records.append(record) | ||
| if len(records) == 2: | ||
| for e1, e2 in zip(*records): | ||
| res = e2 / e1 | ||
| assert 1 - diff <= res <= 1 + diff, res | ||
mmsqe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.