Skip to content

Raiden does not handle recoverable errors for channel open & deposit #4937

@rakanalh

Description

@rakanalh

When opening a channel, the rest module calls channel_open from the python module:

raiden/raiden/api/rest.py

Lines 639 to 653 in 6983c90

try:
self.raiden_api.channel_open(
registry_address, token_address, partner_address, settle_timeout
)
except (
InvalidBinaryAddress,
InvalidSettleTimeout,
SamePeerAddress,
AddressWithoutCode,
DuplicatedChannelError,
TokenNotRegistered,
) as e:
return api_error(errors=str(e), status_code=HTTPStatus.CONFLICT)
except (InsufficientFunds, InsufficientGasReserve) as e:
return api_error(errors=str(e), status_code=HTTPStatus.PAYMENT_REQUIRED)

However, the python module calls the proxy's set_total_deposit which means that RaidenRecoverableErrors will just bubble up with nothing to handle them.

channel_proxy.set_total_deposit(total_deposit=total_deposit, block_identifier=blockhash)

The same thing happens when invoking the channel deposit directly:

raiden/raiden/api/rest.py

Lines 1110 to 1126 in 6983c90

try:
self.raiden_api.set_total_channel_deposit(
registry_address,
channel_state.token_address,
channel_state.partner_state.address,
total_deposit,
)
except InsufficientFunds as e:
return api_error(errors=str(e), status_code=HTTPStatus.PAYMENT_REQUIRED)
except DepositOverLimit as e:
return api_error(errors=str(e), status_code=HTTPStatus.CONFLICT)
except DepositMismatch as e:
return api_error(errors=str(e), status_code=HTTPStatus.CONFLICT)
except TokenNetworkDeprecated as e:
return api_error(errors=str(e), status_code=HTTPStatus.CONFLICT)
except UnexpectedChannelState as e:
return api_error(errors=str(e), status_code=HTTPStatus.CONFLICT)

TODO

  • Make sure RaidenRecoverableError is handled here
  • Check those modules for other potential areas where RaidenRecoverableError is not handled.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions