status-mobile icon indicating copy to clipboard operation
status-mobile copied to clipboard

L1 - L2 transaction fails with `L1_ETH_BRG: Value does not match amount` in blockchain

Open pavloburykh opened this issue 1 year ago • 12 comments

Looks like this is third party (hopper side) issue. Currently I am unable to perform transaction that includes L1 - L2 bridging neither in develop nor in release builds.

Steps:

  1. Send L1 - L2 transaction. I used eth for testing.
  2. Check transaction on blockchain

Actual result: Transaction fails with L1_ETH_BRG: Value does not match amount

https://etherscan.io/tx/0x1867537c062312f3e9f19289b6a18c704c76f332a980d6ee2dbc8a74efb28e5b

Status-debug-logs - 2024-09-04T183851.348.zip

Ethereum Transaction Hash (Txhash) Details | Etherscan 2024-09-04 18-23-04

https://github.com/user-attachments/assets/22f6e03d-b582-431f-bc92-3ade65da32c3

  • Status version: nightly, release 2.30
  • Operating System: Android, iOS

pavloburykh avatar Sep 05 '24 08:09 pavloburykh

Can't verify this yet due to high fees on L1. Need to wait for the merge of this PR.

VolodLytvynenko avatar Oct 07 '24 15:10 VolodLytvynenko

@pavloburykh yes, I agree, it's hard for all of us to test bridge since it only works on real chains, not on test chains, but wondering if have you faced the same using the desktop app? And if yes, is that easily reproducible in the desktop app?

saledjenic avatar Oct 14 '24 10:10 saledjenic

@pavloburykh yes, I agree, it's hard for all of us to test bridge since it only works on real chains, not on test chains, but wondering if have you faced the same using the desktop app? And if yes, is that easily reproducible in the desktop app?

@saledjenic I as far as I remember bridge was failing on Desktop as well, but we need to recheck. Currently I am not able to re-check on Desktop develop as I am getting abi: cannot use func as type ptr as argument when building L1-L2 route. We need to get this fix https://github.com/status-im/status-go/pull/5915 into Desktop develop, I suppose it is not there yet.

Image

pavloburykh avatar Oct 14 '24 11:10 pavloburykh

@pavloburykh that was fixed here https://github.com/status-im/status-go/pull/5915 and merged last week, could be that you're using an old build? Or the desktop master branch still doesn't include that change?

saledjenic avatar Oct 14 '24 11:10 saledjenic

@pavloburykh that was fixed here status-im/status-go#5915 and merged last week, could be that you're using an old build? Or the desktop master branch still doesn't include that change?

@saledjenic yes, I know it was fixed as I have mentioned in my comment above, I suspect Desktop go version hasn't been updated yet and does not include the fix. As I am using latest Desktop master version and I am getting this error.

pavloburykh avatar Oct 14 '24 11:10 pavloburykh

@saledjenic regarding the bug itself: in the title and description I have mentioned that bridge is failing with this error L1_ETH_BRG: Value does not match amount. But in fact it fails with other errors too. For example this transaction which I performed on Friday on mobile is just marked as Fail, without any specific errors https://etherscan.io/tx/0x2319ea9c04cd9f5586eac2922e484eae4484ff82412eda6c5722b84c4fed98d7 In other words, the main problem is that we are unable to perform L1-L2 bridge, because it is failing and reverted with different errors.

pavloburykh avatar Oct 14 '24 11:10 pavloburykh

https://etherscan.io/tx/0x2319ea9c04cd9f5586eac2922e484eae4484ff82412eda6c5722b84c4fed98d7 In other words, the main problem is that we are unable to perform L1-L2 bridge, because it is failing and reverted with different errors.

Looking at the tx on etherscan.io, I cannot say what's wrong, all looks correct, maybe it's up to the network itself, don't know. Is that happening with each bridge tx?

saledjenic avatar Oct 14 '24 12:10 saledjenic

Is that happening with each bridge tx?

For me it happens all the time when tying to bridge L1-L2. L2-L2 works fine.

pavloburykh avatar Oct 14 '24 12:10 pavloburykh

Update:

Had a conversation today with @saledjenic. I have tried to bridge L1-L2 and for some reason it worked this time. So according to Sale investigation it seems to be a network issue which is the reason why L1-L2 transactions often failing in blockchain. I am going to make some more transactions to make sure it works and then probably descope or close this issue as a third party problem.

@smohamedjavid I see you have assigned yourself for this PR. In case you have already conducted some investigation and think that problem still might be on our side - please share.

pavloburykh avatar Oct 15 '24 12:10 pavloburykh

Javid was assigned under the presumption that https://github.com/status-im/status-go/pull/5941 will fix this issue.

If the Go PR doesn't fix this issue, we'll have to move it to the next release ((

shivekkhurana avatar Oct 16 '24 08:10 shivekkhurana

@pavloburykh I did a couple of L1-L2(opt/arb) and L2(opt/arb)-L2(arb/opt) bridge TX on the mainnet, and they all succeeded. This is WITHOUT the status-go PR (https://github.com/status-im/status-go/pull/5941). Can you check once again with the latest nightly on your side and see if the issue persists? 🙏

smohamedjavid avatar Oct 16 '24 11:10 smohamedjavid

@pavloburykh I did a couple of L1-L2(opt/arb) and L2(opt/arb)-L2(arb/opt) bridge TX on the mainnet, and they all succeeded. This is WITHOUT the status-go PR (status-im/status-go#5941). Can you check once again with the latest nightly on your side and see if the issue persists? 🙏

Thanks @smohamedjavid! As I have mentioned above, I also managed to perform successful transaction, so the reason of previous failures must have been third party network issues. It has nothing to do with https://github.com/status-im/status-go/pull/5941.

I will close this issue later after I perform some more testing on mainnet in scope of https://github.com/status-im/status-mobile/pull/21116

pavloburykh avatar Oct 16 '24 11:10 pavloburykh

Quick update:

The Bridge-only transactions (Bridge Flow) are working well; the issue occurs only on Send flow transactions where Bridge and Send (sendToL2) are involved (e.g., Sending ETH from 0x1 (L1) -> 0x2 (L2)).

The error L1_ETH_BRG: Value does not match amount (Tx hash posted by @pavloburykh in the issue description) comes from the Hop contract where the TX value (0.005) and amount (0.004554216928840596) passed to the contract call are not equal.

https://etherscan.io/address/0xb8901acb165ed027e32754e0ffe830802919727f#code#F1#L23

We need to check the route calculation code in status-go as mobile returns the amount-out returned by the route, and the client sends it back again while creating the (multi) transaction.

The other failed transaction (Tx hash posted by @pavloburykh in https://github.com/status-im/status-mobile/issues/21180#issuecomment-2410980288) where no error is shown was due to out of gas but the value and amount are equal and passed the contract validation.

https://eth.blockscout.com/tx/0x2319ea9c04cd9f5586eac2922e484eae4484ff82412eda6c5722b84c4fed98d7?tab=internal

We need to check the status-go code to increase the Gas Limit for those transactions.

Special thanks to @briansztamfater

cc @saledjenic @shivekkhurana


On a side note, If we simplify the send flow in upcoming releases, we probably won't have to spend effort on this.

smohamedjavid avatar Oct 25 '24 14:10 smohamedjavid

Quick update:

Thanks for great research @smohamedjavid

pavloburykh avatar Oct 25 '24 15:10 pavloburykh

@pavloburykh @smohamedjavid is that error happening if you're doing the same in the desktop app?

If that's the mobile-only issue then it could be up to wallet_createMultiTransaction call that is not maintained anymore, the desktop app uses new endpoints for sending tx.

If not, then it would be nice to have the input parameters for calling the wallet_getSuggestedRoutesAsync so that I can test the router for that specific case.

the issue occurs only on Send flow transactions where Bridge and Send (sendToL2) are involved (e.g., Sending ETH from 0x1 (L1) -> 0x2 (L2)).

If you've set the params properly, there should be no differences between doing a bridge or sending tx.

Here you can see the route when I tried to bridge:

Image

And here when I tried to send, setting params that the bridge is the only option for send (disabling "to" chains):

Image

On a side note, If we simplify the send flow in upcoming releases, we probably won't have to spend effort on this.

The router is pretty configurable, we can simplify UI, and that's not a problem, but the routing algorithm will be unchanged, cause it's configurable. We need to check how does the mobile app do the send?

saledjenic avatar Oct 29 '24 13:10 saledjenic

I spent some time inspecting the code and analyzing errors that we're getting when bridging, and I think that changes done in this PR https://github.com/status-im/status-go/pull/6012 should fix both issues we have:

  • reverted tx due to out of gas error
  • Fail with error 'L1_ETH_BRG: Value does not match amount' error

Here is a desktop PR that includes statusgo fixes from PR#6012.

@smohamedjavid could you please create a corresponding mobile PR that will include the mentioned statusgo changes?

Here is the bridge tx I did running the Send flow in the desktop app:

  • https://etherscan.io/tx/0xee2484f85ead30396fdbaeb9bd3c71d45f32f400513eef8ccd0ef409e0601930

@pavloburykh please give it a try and let me know.

saledjenic avatar Oct 29 '24 17:10 saledjenic

Corresponding Mobile PR: https://github.com/status-im/status-mobile/pull/21523

smohamedjavid avatar Oct 29 '24 17:10 smohamedjavid