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: estimate gas in evm tx is not accurate in relayer #1209

Merged
merged 33 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ffc8a14
Problem: relayer does't make use of binding contract
mmsqe Oct 5, 2023
48f11c0
add executor
mmsqe Oct 5, 2023
7c4c82a
Update CHANGELOG.md
mmsqe Oct 5, 2023
ddf6e8d
Problem: estimate gas in evm tx is not accurate in relayer
mmsqe Oct 16, 2023
40d4077
Merge remote-tracking branch 'origin/main' into json_rpc_addr
mmsqe Oct 17, 2023
1b1f43c
Merge branch 'bind_relayer' into json_rpc_addr
mmsqe Oct 17, 2023
214d819
try continuous state changes
mmsqe Oct 17, 2023
65eebef
add execMultiple
mmsqe Oct 17, 2023
ee48035
pass capability check
mmsqe Oct 19, 2023
9f8c340
add updateClientAndRecvPacket to combos
mmsqe Oct 19, 2023
4c48569
test less
mmsqe Oct 19, 2023
0fcc54a
Merge remote-tracking branch 'origin/main' into json_rpc_addr
mmsqe Oct 19, 2023
2bbd1e3
update rly
mmsqe Oct 19, 2023
06f2b77
add updateClientAndAcknowledgement
mmsqe Oct 20, 2023
cc3014f
execMultipleWithHooks with preAction
mmsqe Oct 19, 2023
97840ba
fix channel capability key name
mmsqe Oct 20, 2023
4af0a81
add rest methods
mmsqe Oct 20, 2023
04a4738
Revert "test less"
mmsqe Oct 20, 2023
1bdb91c
rm setMemStoreKeys
mmsqe Oct 30, 2023
0e6382c
Merge remote-tracking branch 'origin/main' into json_rpc_addr
mmsqe Oct 30, 2023
b804a2b
fix gas formula
mmsqe Oct 30, 2023
36fdb8a
fix test
mmsqe Oct 30, 2023
b1fc6f3
Merge remote-tracking branch 'origin/main' into json_rpc_addr
mmsqe Nov 6, 2023
e2c560f
add missing method
mmsqe Nov 6, 2023
136ced6
add missing channel close
mmsqe Nov 6, 2023
376d0ed
fix resolve
mmsqe Nov 6, 2023
3918b96
Merge remote-tracking branch 'origin/main' into json_rpc_addr
mmsqe Nov 27, 2023
1ae9638
fix test
mmsqe Nov 27, 2023
1baba1b
cleanup
mmsqe Nov 27, 2023
5e91c62
more buffer
mmsqe Nov 27, 2023
42125a9
Merge branch 'main' into json_rpc_addr
mmsqe Nov 29, 2023
2dea6f4
Apply suggestions from code review
mmsqe Nov 29, 2023
ec8bf4b
Merge remote-tracking branch 'origin/main' into json_rpc_addr
mmsqe Dec 4, 2023
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
### State Machine Breaking

- [#1232](https://github.com/crypto-org-chain/cronos/pull/1232) Adjust require gas in relayer precompile to be closed with actual consumed.
- [#1209](https://github.com/crypto-org-chain/cronos/pull/1209) Support accurate estimate gas in evm tx from relayer.

### Improvements

- [#1239](https://github.com/crypto-org-chain/cronos/pull/1239) Refactor websocket/subscription system to improve performance and stability.
- [#1241](https://github.com/crypto-org-chain/cronos/pull/1241) Improve parallelization of memiavl restoration.


*October 17, 2023*

## v1.1.0-rc1
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/configs/ibc_rly.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ibc {
relayer+: {
chains: [super.chains[0] {
max_gas: 1000000,
gas_multiplier: 1.2,
gas_multiplier: 1.1,
}] + super.chains[1:],
},
}
10 changes: 3 additions & 7 deletions integration_tests/ibc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ def check_balance_change():

wait_for_fn("balance change", check_balance_change)
assert old_dst_balance + dst_amount == new_dst_balance

# assert that the relayer transactions do enables the dynamic fee extension option.
cli = ibc.cronos.cosmos_cli()
criteria = "message.action=/ibc.core.channel.v1.MsgChannelOpenInit"
Expand Down Expand Up @@ -666,9 +665,6 @@ def log_gas_records(cli):
records = []
for tx in txs:
res = tx["tx_result"]
actions = []
for event in res["events"]:
for attribute in event["attributes"]:
if attribute["key"] == "action":
actions.append(attribute["value"])
records.append(res["gas_used"])
if res["gas_used"]:
records.append(res["gas_used"])
return records
4 changes: 2 additions & 2 deletions integration_tests/test_ibc_rly_gas.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ def test_ibc(ibc):
cli = ibc.cronos.cosmos_cli()
wait_for_new_blocks(cli, 1)
rly_transfer(ibc)
diff = 0.5
diff = 0.004
record = log_gas_records(cli)
if record:
records.append(record)
if len(records) == 2:
for e1, e2 in zip(*records):
res = e2 / e1
res = int(e2) / int(e1)
assert 1 - diff <= res <= 1 + diff, res
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import sources.nixpkgs {
name = "rly";
src = sources.relayer;
subPackages = [ "." ];
vendorSha256 = "sha256-IoaGLD3XKRmD61qcr/sPn3aWaa7zYAO9EbMiJFnF5BY=";
vendorSha256 = "sha256-5s5URiAZk59mOfZdUcqYAB/IvzFuBiQH5jDBuh6huTE=";
doCheck = false;
GOWORK = "off";
postInstall = ''
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": "e097df316002173930a408cb5a7bce3040131c9c",
"sha256": "0xhgba9db9i56gglpgznpilkv0kb98m299yzgvpla60ldsd41imp",
"rev": "1432eb16fae943d7da2878893129cbf22406238d",
"sha256": "1i1270z9j68vpz0p4awl9v9br1cyp39qfwzsfy8vks1k33ibyzws",
"type": "tarball",
"url": "https://github.com/crypto-org-chain/relayer/archive/e097df316002173930a408cb5a7bce3040131c9c.tar.gz",
"url": "https://github.com/crypto-org-chain/relayer/archive/1432eb16fae943d7da2878893129cbf22406238d.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
2 changes: 2 additions & 0 deletions scripts/gen-bindings-contracts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

solc08 --abi --bin x/cronos/events/bindings/src/CosmosTypes.sol -o build --overwrite
solc08 --abi --bin x/cronos/events/bindings/src/Relayer.sol -o build --overwrite
solc08 --abi --bin x/cronos/events/bindings/src/RelayerFunctions.sol -o build --overwrite
solc08 --abi --bin x/cronos/events/bindings/src/Bank.sol -o build --overwrite
solc08 --abi --bin x/cronos/events/bindings/src/ICA.sol -o build --overwrite
solc08 --abi --bin x/cronos/events/bindings/src/ICACallback.sol -o build --overwrite


abigen --pkg lib --abi build/CosmosTypes.abi --bin build/CosmosTypes.bin --out x/cronos/events/bindings/cosmos/lib/cosmos_types.abigen.go --type CosmosTypes
abigen --pkg relayer --abi build/IRelayerModule.abi --bin build/IRelayerModule.bin --out x/cronos/events/bindings/cosmos/precompile/relayer/i_relayer_module.abigen.go --type RelayerModule
abigen --pkg relayer --abi build/IRelayerFunctions.abi --bin build/IRelayerFunctions.bin --out x/cronos/events/bindings/cosmos/precompile/relayer/i_relayer_functions.abigen.go --type RelayerFunctions
abigen --pkg bank --abi build/IBankModule.abi --bin build/IBankModule.bin --out x/cronos/events/bindings/cosmos/precompile/bank/i_bank_module.abigen.go --type BankModule
abigen --pkg ica --abi build/IICAModule.abi --bin build/IICAModule.bin --out x/cronos/events/bindings/cosmos/precompile/ica/i_ica_module.abigen.go --type ICAModule
abigen --pkg icacallback --abi build/IICACallback.abi --bin build/IICACallback.bin --out x/cronos/events/bindings/cosmos/precompile/icacallback/i_ica_callback.abigen.go --type ICACallback
mmsqe marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading