Skip to content

fixed issue with expensive tx (only for polygon) - #13

Open
CryptoTransformator wants to merge 2 commits into
web3engineering:mainfrom
CryptoTransformator:main
Open

fixed issue with expensive tx (only for polygon)#13
CryptoTransformator wants to merge 2 commits into
web3engineering:mainfrom
CryptoTransformator:main

Conversation

@CryptoTransformator

Copy link
Copy Markdown

fixed issue with expensive tx (only for polygon). adapter_params = '0x000100000000000249f0' is fixed.
But fee = 1800000 may be increased to 2500000 (depends on gas).

@ikapeykin
ikapeykin requested a review from unordered-set August 3, 2023 21:47
@unordered-set

Copy link
Copy Markdown
Collaborator

Hi! Thanks a lot for the contribution!

The value on a destination chain is maintained by the LZ infra, and not constant. This value is actually encoded as "adapter_params", even though it is not obvious, but as far as I can tell, adapter_params just hides everything what we need to know about the destination chain [you can see what is there and how it is stored: https://github.com/web3engineering/LayerZero-python-aptos/blob/a0dc0bd94d7a1d5615dcb6994da7f9ed32543455/src/executor.py#L20

Our SDK has a parity between JS and Python, so

  1. JS: https://github.com/LayerZero-Labs/LayerZero-Aptos-Contract/blob/main/sdk/src/modules/executor.ts#L43C11-L43C34
  2. Python: https://github.com/web3engineering/LayerZero-python-aptos/blob/a0dc0bd94d7a1d5615dcb6994da7f9ed32543455/src/executor.py#L43C52-L43C52

As I can see, there is an adapter record for chain 109:

>>> from aptos_sdk.client import RestClient
>>> WALLET_RPC = "https://fullnode.mainnet.aptoslabs.com/v1"
>>> client = RestClient(WALLET_RPC)
>>> client.get_table_item("0xe31c3b7c6a76c2c9a38683fdb66ecbaecbce9bdbadb533c4f992509f46709a5a", 'u64', 'vector<u8>', '109')
'0x0001000000000003d090'

and as you can see, it changed from what you provided in your pull request.

Could you please, double check (I admit we have a bug there, if this problem appeared) where exactly we lots the gas price from the adapter params?

Again, thanks a lot for your work, appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants