Skip to content

Error: Assertion failed after funding a new wallet #328

Closed

Description

@HunterSides

Issue Description

Receiving Error: Assertion when attempting to initialize Platform connection after funding a new wallet.

Mnemonic (non production)

{"mnemonic":"need grab endorse wine around fuel lawn flame tide section original boss"}

Expected Behavior

After funding a new wallet with tDash a user should be able to initialize and connect to platform.

Current Behavior

Throws Error: Assertion failed
image

Steps to Reproduce (for bugs)

using this repo https://github.com/HunterSides/DDR-React

clone & npm install & npm start
open localhost:3000
open console & fund wallet address given
reload page after funding wallet

Process Point Failure

Platform connection initialization after funding given wallet address with tDash.

Your Environment

@dash-incubator/dapp-sdk": "*"
Chrome & Firefox latest
Windows 10 64 bit
Link to your project:

Activity

  1. added
    bug
    on Apr 5, 2022
  2. markin-io commented on Apr 22, 2022

    @markin-io
    Contributor

    What is the version of dash SDK is used? Can you also provide a link to the repo with @dash-incubator/dapp-sdk

  3. HunterSides commented on Apr 28, 2022

    @HunterSides
    Author
  4. markin-io commented on Apr 29, 2022

    @markin-io
    Contributor

    @HunterSides thank you. dash-incubator/dapp-sdk needs to update Dash SDK to v3.22.3.
    From what I see, currently, the project is on 3.21.7

    Perhaps the issue itself is better transferred to https://github.com/dash-incubator/dapp-sdk as well?
    This is a side project from Dash Incubator, and we don't have an access to it.

  5. SamKirby22 commented on May 6, 2022

    @SamKirby22

    @HunterSides - am I right in saying "it looks like ICJR needs to update the dapp sdk - Dash SDK package to v3.22.3 from v3.21.7"?

  6. SamKirby22 commented on May 6, 2022

    @SamKirby22

    ICJR - any update here?

  7. ICJR commented on May 6, 2022

    @ICJR

    @SamKirby22 Updated dash dependency to use the latest version. I am now seeing RuntimeError: abort(both async and sync fetching of the wasm failed). Build with -s ASSERTIONS=1 for more info. after I fund a new testnet wallet with tDash.

  8. markin-io commented on May 13, 2022

    @markin-io
    Contributor

    @ICJR @HunterSides thank you for the provided details and updates, we added this to our backlog

  9. markin-io commented on May 20, 2022

    @markin-io
    Contributor

    @ICJR @HunterSides I launched the DDR-React project. Thank you for driving the Dash React App initiative - frontend Dash efforts are crucial for project development.

    I reproduced the issue and I think that the underlying problem is that currently, dash SDK requires an extra webpack configuration that provides Node.JS polyfills for browsers. We are currently working out a solution for proper bundling for the web without the additional configuration to improve the developer experience.

    Having in mind that you are working with the CRA, you can not alter your webpack config without the eject (which is not desirable).

    Here's what I suggest to do as a workaround for now:

    • In @dash-incubator/dapp-sdk project:
      • Configure webpack.typescript.config.js to provide all required polyfills. This comment will help.
      • Add "browser": "./dist/dapp.js" to the package.json (This would make web-apps using dapp-sdk look for dapp.js bundle instead of the typescript build)
      • Build and publish to NPM
    • Update @dash-incubator/dapp-sdk in DDR-React to a newer version and try running app again.
  10. ICJR commented on May 20, 2022

    @ICJR
  11. markin-io commented on May 27, 2022

    @markin-io
    Contributor

    @ICJR thank you. We're currently in progress with a proper SDK bundle for the web.

  12. markin-io commented on Jun 10, 2022

    @markin-io
    Contributor

    @ICJR please update dash to v0.22.12 and retest, you could also try getting rid of Node node polyfills if they were only used for dash

  13. SamKirby22 commented on Jun 10, 2022

    @SamKirby22

    This one is for Hunter to check but would be good for ICJR to take a look too - as impacting both bounties.

  14. markin-io commented on Jun 10, 2022

    @markin-io
    Contributor

    Aha, all right. @HunterSides @ICJR please also check out a new section in the documentation about using primitives https://github.com/dashevo/platform/tree/master/packages/js-dash-sdk#primitives-and-essentials

    If you need more PlatformProtocol essentials exposed, please let us know. For the first iteration we only did ones that used by our internal platform test suite.

  15. ICJR commented on Jun 10, 2022

    @ICJR

    @markin-io
    error

    Still receiving the errors above. I removed the node polyfill plugin provider, and updated dash npm to the latest version. Have you guys tested on another web app using just the dash npm package and a normal testnet platform connection?

    Asking so I can just tear everything apart on my end to find the issue.

  16. markin-io commented on Jun 10, 2022

    @markin-io
    Contributor
  17. ICJR commented on Jun 10, 2022

    @ICJR

    @markin-io

    Tried a few things still no luck

    Received More than one instance of dashcore-lib found. Please make sure that you are not mixing instances of classes of the different versions of dashcore. used npm dedupe warning won't go away.

    Also noticed the following endpoints
    /org.dash.platform.dapi.v0.Core/getStatus
    /org.dash.platform.dapi.v0.Core/subscribeToTransactionsWithProofs

    Constantly take 60186ms to respond throwing a 503/504 error.

  18. markin-io commented on Jun 17, 2022

    @markin-io
    Contributor

    @ICJR dashcore-lib duplicate shouldn't cause this kind of an error.
    As of getStatus - yes it is quite slow, it's sitting in our optimizations list.
    subscribeToTransactionsWithProofs is a stream, and it is expected to disconnect after a minute due to a nginx configuration of the masternode. (It reconnects afterwards)

    From what I see this is some wasm issue (SDK internally uses wasm code), and probably related to a second layer of bundling in dapp-sdk.
    So far we tested only dash -> Frontend app use case, but dash -> second-tier-wrapper -> Frondend app isn't covered yet.

    We would appreciate any additional information and debugging of the case with the second tier wrappers for dash library. Will add it to our backlog.

  19. markin-io commented on Jun 17, 2022

    @markin-io
    Contributor

    For now to unblock your endeavor I might suggest using dash directly in DDR React.

    If using dapp-sdk is a must-have for you, there are two options that could possibly solve the problem:

    • Use dapp-sdk as a git submodule and directly refer to its src from the DDR-React project (instead of installing dapp-sdk via npm).
    • Instead of a webpack bundle, do just TypeScript (tsc) build for dapp-sdk

    Both cases will avoid producing a wrapping bundle around the dash

  20. HunterSides commented on Jun 22, 2022

    @HunterSides
    Author

    @markin-io error

    Still receiving the errors above. I removed the node polyfill plugin provider, and updated dash npm to the latest version. Have you guys tested on another web app using just the dash npm package and a normal testnet platform connection?

    Just reiterating ICJR here, I also still receive the errors after updating.

  21. markin-io commented on Jun 24, 2022

    @markin-io
    Contributor

    @HunterSides thanks. Please try out one of the steps #328 (comment)

  22. HunterSides commented on Jun 27, 2022

    @HunterSides
    Author

    @markin-io @ICJR Attempting to use dapp-sdk as a git submodule gives me
    image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions