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

Raiden crashes with "Deposit amount decreased" #3135

Closed
LefterisJP opened this issue Dec 7, 2018 · 7 comments · Fixed by #3142
Closed

Raiden crashes with "Deposit amount decreased" #3135

LefterisJP opened this issue Dec 7, 2018 · 7 comments · Fixed by #3142
Assignees
Labels
State / Investigating For issues that are currently being looked into before labeling further

Comments

@LefterisJP
Copy link
Contributor

LefterisJP commented Dec 7, 2018

Problem Definition

This was seen only once by @czepluch during trying out latest nightly.

Network was Kovan.
Logs are here
The failing setTotalDeposit() transaction is here

Task

Investigate to see why this can be happening and fix it.

@LefterisJP LefterisJP added the State / Investigating For issues that are currently being looked into before labeling further label Dec 7, 2018
@LefterisJP LefterisJP self-assigned this Dec 7, 2018
@arseneeth
Copy link

arseneeth commented Dec 8, 2018

I had the same issue at the ETHSingapore hackathon. Happened on a newly registered token network, when opening the first channel.

Worked after 3 iterations

@LefterisJP
Copy link
Contributor Author

LefterisJP commented Dec 8, 2018

Happened on a newly registered token network, when opening the first channel.

Thank you @arsenyjin -- this gives a hint as to what the reason for the bug may be. Do you by any chance have any logs?

@czepluch
Copy link
Contributor

czepluch commented Dec 8, 2018

Weird thing here is, that for me it only happened the first time I opened a channel in a newly registered token network. In this case the crash kept happening over and over again.

@arseneeth
Copy link

I guess I posted the logs in the issue #3139

@LefterisJP
Copy link
Contributor Author

@arsenyjin you posted 43 logs in that zip. Can you by any chance help us narrow it down by telling us which are relevant?

@LefterisJP
Copy link
Contributor Author

Relevant log from #3139 for setTotalDepositFailed is here

LefterisJP added a commit to LefterisJP/raiden that referenced this issue Dec 10, 2018
LefterisJP added a commit to LefterisJP/raiden that referenced this issue Dec 10, 2018
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
hackaugusto pushed a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
In development mode we unfortunately seem to still have limits as we
can see from the code
https://github.com/raiden-network/raiden-contracts/blob/7105cf818fc290107ad48df9497bddcdec5c540e/raiden_contracts/contracts/TokenNetwork.sol
of what is probably the pre_limits contracts.

The fix for now, is to also take that limit into account at
development mode and not allow the client to send a transaction when
the token amount is above the limit that development mode contracts
have.

Fixes raiden-network#3135
@hackaugusto
Copy link
Contributor

hackaugusto commented Sep 11, 2019

This is the stacktrace:

Traceback (most recent call last):
  File "site-packages/flask/app.py", line 1813, in full_dispatch_request
  File "site-packages/flask/app.py", line 1799, in dispatch_request
  File "site-packages/flask_restful/__init__.py", line 480, in wrapper
  File "site-packages/flask/views.py", line 88, in view
  File "site-packages/flask_restful/__init__.py", line 595, in dispatch_request
  File "site-packages/webargs/core.py", line 478, in wrapper
  File "site-packages/raiden/api/v1/resources.py", line 52, in put
  File "site-packages/raiden/api/rest.py", line 608, in open
  File "site-packages/raiden/api/python.py", line 423, in set_total_channel_deposit
  File "site-packages/raiden/network/proxies/payment_channel.py", line 164, in set_total_deposit
  File "site-packages/raiden/network/proxies/token_network.py", line 652, in set_total_deposit
  File "site-packages/raiden/network/proxies/token_network.py", line 1150, in _check_channel_state_for_deposit
raiden.exceptions.RaidenUnrecoverableError: Deposit amount decreased

This is the code at that time:

elif participant_details.our_details.deposit < deposit_amount:
raise RaidenUnrecoverableError('Deposit amount decreased')

That code was executed after the transaction was sent and mined, and the receipt result was a failure.

These are the logs relevant for the deposit.

The transaction pointed above if for a 0.3._ smart contract, available here.

These are the values used then:

>>> tn.functions.deposit_limit().call()
100000000000000000000
>>> int('00000000000000000000000000000000000000000000021e19e0c9bab2400000', 16)
10000000000000000000000

The first is the deposit_limit set in the smart contract. The later is the value given in the transaction. So, the problem was this require require(total_deposit <= deposit_limit);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
State / Investigating For issues that are currently being looked into before labeling further
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants