Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Client floods server with requests after a topup #353

Open
devium opened this issue Jan 12, 2018 · 1 comment
Open

Client floods server with requests after a topup #353

devium opened this issue Jan 12, 2018 · 1 comment

Comments

@devium
Copy link
Contributor

devium commented Jan 12, 2018

This is very much notable in an on-chain test of test_session_topup:
After topping up, the client will resume paying the server on the topped up channel. The server does not accept the topup yet for a few more blocks. The response includes a RDN-Invalid-Amount header, causing the client to adopt the server's last known "valid" amount and retrying the payment immediately again.

The client cannot differentiate between a balance signature update/recovery (which also returns a RDN-Invalid-Amount header) and an unconfirmed topup.

So there are two possible solutions for this:

  • Introduce a new error header RDN-Insufficient-Funds (which exists but is currently unused) or something along those lines, to indicate that this is a different error than an outdated balance signature or wrong price paid. This could be used in combination with RDN-Insufficient-Confirmations.
  • Introduce some client-side-only logic that tries to detect situations like this (for example by checking if the exact price requested has already been paid and the channel has recently been topped up). Though I think this might be too unnecessarily complex.
@pcppcp
Copy link
Contributor

pcppcp commented Jan 12, 2018

New error header will do it. Much better than wild client-side guess which may introduce new errors.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants