Comments (4)
We can implement a proof verifier in javascript, that will work for unit-tests, and that can be used before hand to check the validity of the generated proof! The goal is to detect where the divergence happens, because ultimately we should be computing proofs properly.
from rainbow-bridge-client.
The current proof verifier uses import Tree from 'merkle-patricia-tree'
as a dependency:
For example:
- https://github.com/djsatok/bridge-testing/blob/89e41e3dc2f3804b494b1404fafc394323e88273/src/generate-proof.js#L1
and here - https://github.com/near/rainbow-bridge-client/blob/5e48919bf878cd742417dd146ce114b6ba8a1e23/packages/nep141-erc20/src/natural-erc20/sendToNear/findProof.js#L1
After commenting out the line above: the dapp could load properly on FF and Safari.
So this dependency is also the root cause of this issue: aurora-is-near/rainbow-bridge-frontend#128 where the dapp cannot load on FF and Safari. So let's not use it for implementing a new verifier.
from rainbow-bridge-client.
The error in proof calculation is due to an invalid result returned by the WalletConnect rpc provider when calling getTransactionReceipt.
Here is an example receipt:
blockHash: "0xa0460b2b0f48600a3e40b5c97aa50bddd7989ed30a4b36aab86b8fd756fd1d9a"
blockNumber: 9955674
contractAddress: null
cumulativeGasUsed: 36623
from: "0xc7cc0cbc712ba155e7b5ff02772a1277d6d8cab0"
gasUsed: 36623
logs: (2) [{…}, {…}]
logsBloom: "0x00000000000000000000000000000000000000000000000000000000000010000000000100000000000000000000000000000000000000000080000000000000000000000000000000000008000000000000000000200020000000000000000000000000000020000000000000000000000400000000000000000011000000000000080000000040000000000000000000000000000000000000000000000000000000000000000080000010000000002000000000000000000000004000000800000002002000000000000000000000400000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000"
status: false
to: "0xb48e6441524f261e141bc766a7ebd54b19ca7465"
transactionHash: "0x8d1329d2cd171f43d2bdff8d2865a4afda275430c3c18210cf12f48fe6182499"
transactionIndex: 0
type: "0x0"
This ropsten transaction is success but the status is false when it should be true, which explains the byte difference in the submitted receipt_data.
If this failed mint() is retried with metamask as the connected ethereum account, the mint transaction will succeed due to the receipt status now being correct.
cc @mfornet @vgrichina
from rainbow-bridge-client.
curl https://ropsten.infura.io/v3/infura_id \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params": ["0x8d1329d2cd171f43d2bdff8d2865a4afda275430c3c18210cf12f48fe6182499"],"id":3}'
returns
{"jsonrpc":"2.0","id":3,"result":{"blockHash":"0xa0460b2b0f48600a3e40b5c97aa50bddd7989ed30a4b36aab86b8fd756fd1d9a","blockNumber":"0x97e95a","contractAddress":null,"cumulativeGasUsed":"0x8f0f","from":"0xc7cc0cbc712ba155e7b5ff02772a1277d6d8cab0","gasUsed":"0x8f0f","logs":[{"address":"0x722dd3f80bac40c951b51bdd28dd19d435762180","blockHash":"0xa0460b2b0f48600a3e40b5c97aa50bddd7989ed30a4b36aab86b8fd756fd1d9a","blockNumber":"0x97e95a","data":"0x000000000000000000000000000000000000000000000000016345785d8a0000","logIndex":"0x0","removed":false,"topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x000000000000000000000000c7cc0cbc712ba155e7b5ff02772a1277d6d8cab0","0x000000000000000000000000b48e6441524f261e141bc766a7ebd54b19ca7465"],"transactionHash":"0x8d1329d2cd171f43d2bdff8d2865a4afda275430c3c18210cf12f48fe6182499","transactionIndex":"0x0"},{"address":"0xb48e6441524f261e141bc766a7ebd54b19ca7465","blockHash":"0xa0460b2b0f48600a3e40b5c97aa50bddd7989ed30a4b36aab86b8fd756fd1d9a","blockNumber":"0x97e95a","data":"0x000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000116f70615f636f6465372e746573746e6574000000000000000000000000000000","logIndex":"0x1","removed":false,"topics":["0xdd85dc56b5b4da387bf69c28ec19b1d66e793e0d51b567882fa31dc50bbd32c5","0x000000000000000000000000722dd3f80bac40c951b51bdd28dd19d435762180","0x000000000000000000000000c7cc0cbc712ba155e7b5ff02772a1277d6d8cab0"],"transactionHash":"0x8d1329d2cd171f43d2bdff8d2865a4afda275430c3c18210cf12f48fe6182499","transactionIndex":"0x0"}],"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000010000000000100000000000000000000000000000000000000000080000000000000000000000000000000000008000000000000000000200020000000000000000000000000000020000000000000000000000400000000000000000011000000000000080000000040000000000000000000000000000000000000000000000000000000000000000080000010000000002000000000000000000000004000000800000002002000000000000000000000400000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000","status":"0x1","to":"0xb48e6441524f261e141bc766a7ebd54b19ca7465","transactionHash":"0x8d1329d2cd171f43d2bdff8d2865a4afda275430c3c18210cf12f48fe6182499","transactionIndex":"0x0","type":"0x0"}}
Where status is true (0x1) which can also be verified from the Browser devtools network tab.
So it looks like the walletconnect provider library which formats the rpc result has a bug causing status to be false
when console logging the formatted receipt object
from rainbow-bridge-client.
Related Issues (16)
- Add codeowner HOT 1
- Use latest height from NearOnEthClient to submit the unlock transaction HOT 1
- Rare bug with transfer initialization from NEAR. HOT 2
- View function to check used proofs in ethereum without changing contract HOT 7
- Used proofs in workflows (Ethereum -> NEAR) / (Ethereum -> Aurora) HOT 3
- Update near-api-js when https://github.com/near/near-api-js/pull/620 is released HOT 3
- Create function to update metadata in FT contracts HOT 3
- getBalance is not a generic ERC20 metadata
- Reduce quantity of data queries to Ethereum/NEAR nodes. HOT 4
- Standardize connector APIs. HOT 5
- feat: multiple network/bridge support ? HOT 2
- Remove `sourceTokenName` and `destinationTokenName`.
- Increase gas attached to `deploy_bridge_token` HOT 2
- BorshError: Expected buffer length 20 isn't within bounds: recipient HOT 6
- Get the info from relayers on the NEAR->Ethereum syncing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rainbow-bridge-client.