-
Notifications
You must be signed in to change notification settings - Fork 184
Description
I've tried to integrate the Gravity bridge into our Cosmos-based chain and did some Ganache-cli local testing.
Overall it worked, but I've faced some issues I'd like to share.
-
Cosmos Gas limit for Tx
By default, it is set to
500_000_000u64.
That is a huge value (we have a default limit of 1M).
Cosmos errors don't tell you much why the Tx didn't pass through (the only way is to enable debug logs on the Cosmos side), so it took some time to debug.
I think it would be a good idea to make it configurable on the orchestrator side. -
Ganache crashes and VM errors
All the problems I've faced were about missing / huge Gas limits for Txs to the Ethereum node.
For example:
deploy_erc20(client)- I had to add Gas price, limit and multiplier to the call;
estimate_valset_cost,estimate_tx_batch_cost- I had to replace the
let gas_limit = min((u64::MAX - 1).into(), our_balance.clone());line tolet gas_limit: Uint256 = 100000u64.into();; - I didn't dig into the problem, but I assume it is an int64 overflow when Ganache tries to multiply the Gas limit to Gas price;
- I had to replace the
I'm not an Ethereum expert and those problems might be only Ganache related, but I thought it might be usefull to share.
-
Cosmos gRPC protobuf
Facing gRPC transport errors (orchestrator <-> Cosmos) I had to rebuild and replace the
gravity.v1.rsusing theorchestrator/proto_buildscript.
That one is a bit strange as my quick look through the diff didn't show much of a difference, but it worked. -
Custom CosmosERC20 contract deployer
Two problems here with an existing deployer (
Gravity.solcontract andorchestrator/client):_mint(_gravityAddress, MAX_UINT)mints tokens to the Gravity contract address by default, I've changed the constructor argument tomsg.Sender;- An additional
IncreaseAllowancecall have to be made to enable the Eth -> Cosmos transfer for a particular Eth account;
-
Orchestrator startup crash
As I see, it's been already fixed: not initialized
contactvariable within thecreate_rpc_connectionsfunc. -
Custom Cosmos bech32 prefix
We're using a custom prefix (not
cosmos) for the account address prefix.
That was fixed a few days ago too.
I hope this report might be helpful. I'd be happy to share more on my future integration attempts if needed.