Skip to content

Warn about using same private key from other applications and remove nonce management #1400

@LefterisJP

Description

@LefterisJP

From this comment.

Either we assume that we share the privatekey or not:

  • if we don't share it, then the nonce update is useless: The running Raiden node is the only one sending transactions with that key, therefor the only node changing the nonce, so the local nonce is always valid.
    • assuming the ethereum node puts transactions in pending faster than Raiden restarts.
  • if we do share, then there will be races where two nodes send the different transactions with the same nonce, only updating the nonce without fixing and resending the transactions is not sufficient. At the best case scenario, the retry logic would also fix the transaction, but then either:
  • the two nodes deadlock each other and waste ether, because one will try to overwrite the other transaction and needs to pay more for the gas
  • the node which sent the rejected transaction accepts that it lost the race and sends a new transaction with a fresher nonce. This is IMO just too annoying, the effort is not worth and would be better to just /not/ use local signing.

TODOs:

  • Provide a warning message to the user in the start of the raiden node, letting him know that he should not use the private key used for raiden in anything else as long as the raiden node is running.
  • Remove the code updating nonce for a given interval. The nonce must be updated from the chain at the start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions