Giter VIP home page Giter VIP logo

Comments (4)

mfornet avatar mfornet commented on August 16, 2024

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.

paouvrard avatar paouvrard commented on August 16, 2024

The current proof verifier uses import Tree from 'merkle-patricia-tree' as a dependency:
For example:

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.

paouvrard avatar paouvrard commented on August 16, 2024

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.

paouvrard avatar paouvrard commented on August 16, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.