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

Implement confirmation blocks #613

Closed
andrevmatos opened this issue Nov 27, 2019 · 1 comment · Fixed by #1009, #1013 or #1017
Closed

Implement confirmation blocks #613

andrevmatos opened this issue Nov 27, 2019 · 1 comment · Fixed by #1009, #1013 or #1017
Assignees
Labels
8 enhancement New feature or request sdk 🖥

Comments

@andrevmatos
Copy link
Contributor

Description

Currently, our blockchain interface through ethers treats any event as final, which could not be true if a reorg occurs. Raiden also don't see an event as confirmed before a given number of blocks (currently, default of 5).

Fortunately, our Rx/redux architecture provides a strong ground to support it in a selective manner, as some events may require confirmation and some don't.

This can use #591 between pending and confirmation events actions. Could also make use of #357 to update users about confirmation progress.

TODO: expand implementation description

Acceptance criteria

  • Blockchain actions are emitted twice: on mining and upon confirmation, iff it was not removed due to a reorg
  • On confirmation checks, need to take into account that the block in which the tx was registered could have changed since first mining, if a reorg took place
  • Pending actions are serialized to state and cleaned upon confirmation; on restarts, pending actions can still be confirmed
  • Try to take confirmation into account only when needed, as it slows SDK, e.g:
    • deposit actions should wait for confirmation, as partners aren't going to accept transfers anyway before it, but approves don't, as deposit will only be mined/confirmed if deposit is registed.
    • In the future (when we can receive/mediate), Secrets could be registered/detected as soon as they're seen on-chain, so we "know" the secret when/if they're revealed, even if the block is reorg'ed, but should wait/ensure confirmation if need to take actions depending on it being registered on-chain
  • number of confirmation blocks is configurable

Tasks

  • [ ]
@andrevmatos andrevmatos added enhancement New feature or request sdk 🖥 backlog Proposals or issues to be fixed in the future labels Nov 27, 2019
@andrevmatos andrevmatos added this to the Product Backlog milestone Nov 27, 2019
@christianbrb
Copy link
Contributor

@andrevmatos to describe the design / architecture / tasks

@taleldayekh taleldayekh added the 8 label Jan 9, 2020
@kelsos kelsos removed this from the Product Backlog milestone Jan 9, 2020
@taleldayekh taleldayekh added this to the Product Backlog milestone Jan 9, 2020
@kelsos kelsos removed this from the Product Backlog milestone Feb 6, 2020
@andrevmatos andrevmatos removed the backlog Proposals or issues to be fixed in the future label Feb 10, 2020
@andrevmatos andrevmatos linked a pull request Feb 11, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment