Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Higher Raiden balance causes "Assertion failed" error (`channelbalance`) #1097

Closed
kilrau opened this issue Jul 12, 2019 · 6 comments

Comments

3 participants
@kilrau
Copy link
Contributor

commented Jul 12, 2019

xud@xud-test-1:~$ xucli channelbalance
Error: 13 INTERNAL: Assertion failed

Reliably reproducable with 25btc in dai. That is 25 times 11500 times 1e18. Looks like something still violates the int64 limit.

@kilrau kilrau added the bug label Jul 12, 2019

@kilrau kilrau added this to To do in 1.0.0-bounty via automation Jul 12, 2019

@sangaman

This comment has been minimized.

Copy link
Collaborator

commented Jul 17, 2019

Can you confirm whether this is still happening? I lost my raiden channels for testing purposes and am having issues getting them back to properly debug this, but when I simulate a balance of 25 * 11500 for raiden (by hardcoding it in and debugging) I don't get this assertion error.

@kilrau

This comment has been minimized.

Copy link
Contributor Author

commented Jul 17, 2019

I can confirm that this still happening. Since the raiden channel manager is working now, you can easily reproduce this by spinning up a docker environment, wait for btc/ltc/weth/dai channels opened to you automatically and then run channelbalance. Result:

simnet > channelbalance
D0717 12:40:18.323560156     419 env_linux.cc:71]            Warning: insecure environment read function 'getenv' used
Error: 13 INTERNAL: Assertion failed
@sangaman

This comment has been minimized.

Copy link
Collaborator

commented Jul 17, 2019

I'm not getting this error with 1,625,000 DAI in docker after setting up as you described. Any ideas?

{
  "balancesMap": [
    [
      "BTC",
      {
        "balance": 1250000000,
        "pendingOpenBalance": 0
      }
    ],
    [
      "DAI",
      {
        "balance": 162500000000000,
        "pendingOpenBalance": 0
      }
    ],
    [
      "LTC",
      {
        "balance": 112500000000,
        "pendingOpenBalance": 0
      }
    ],
    [
      "WETH",
      {
        "balance": 500000000000,
        "pendingOpenBalance": 0
      }
    ]
  ]
}
@erkarl

This comment has been minimized.

Copy link
Collaborator

commented Jul 18, 2019

Try doing a successful swap and then channelbalance.

@kilrau

This comment has been minimized.

Copy link
Contributor Author

commented Jul 18, 2019

That's exactly how I saw it so far too. Initially all good, then once the raiden balance changed, it throws Assertion failed.

sangaman added a commit that referenced this issue Jul 18, 2019

fix: round unitsToAmount conversion result
This prevents unwanted fractional values from the `unitsToAmount`
method return value.

Fixes #1097.
@sangaman

This comment has been minimized.

Copy link
Collaborator

commented Jul 18, 2019

I finally was able to reproduce while debugging, the problem was not with a value that's too high but rather a fractional value that wasn't rounded. Simple fix.

1.0.0-bounty automation moved this from To do to Done Jul 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.