loomnetwork / loomchain

Loom DAppChain Engine
Other
166 stars 32 forks source link

Oracle only method to clear an accounts recpeit to the gateway #836

Open traceCall opened 5 years ago

traceCall commented 5 years ago

We should add an oracle-only method that's able to clear an account's receipt to the gateway. This would help in case the oracle signs something wrong, which would free up a user's account for resigning again at a later point.

traceCall commented 5 years ago

Vadim: Signs wrong how? Here's why I haven't implemented this yet:

  1. User begins withdrawal to eth account A, Oracle signs receipt.
  2. User takes Oracle signature from receipt.
  3. User complains they've lost their Eth key and therefore can't complete the withdrawal to eth account A.
  4. We clear out the withdrawal receipt.
  5. User starts new withdrawal to eth account B, Oracle signs the receipt.
  6. User submits old signature to Ethereum Gateway with eth account A, and gets N tokens.
  7. User submits new signature to Ethereum Gateway with eth account B, and gets N tokens.
  8. User had N tokens on DAppChain but withdrew 2N tokens on Ethereum.

Now, maybe we'll only clear out a receipt only if the signature itself is invalid... but this comes back to my initial question.

traceCall commented 5 years ago

Parth: One scenario would be, that when Decentralised oracle goes live, we will be periodically changing validator set on mainnet (to be in sync with changed validator set on dappchain), when we do this, signature in pending withdrawal receipts at that point will become invalid, and need to resign by new set of validators.

traceCall commented 5 years ago

Vadim: k, well, we'd need to have a 100% reliable way of figuring out if a receipt sig is no longer valid, and once invalid it should never be valid again.