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

Keep track of known transactions in the wallet primitive logic #90

Closed
3 tasks done
paweljakubas opened this issue Mar 20, 2019 · 1 comment
Closed
3 tasks done
Assignees

Comments

@paweljakubas
Copy link
Contributor

paweljakubas commented Mar 20, 2019

Context

At this moment we follow pending transaction set. We need to account also for confirmed transactions. In order to do it we need to extend the wallet state by the list of transaction. Caution should be put here as this extension (in contrast to pending transaction set) is not covered in the wallet spec. There may be the need to extend the wallet spec because of that. Moreover, the keeping tract of known transactions should not affect already established invariances and laws following from wallet spec.

Decision

We will add known transactions to the wallet state.

Acceptance Criteria

  1. The known transaction list must be added to wallet state
  2. The extension must not break anything from the wallet spec
  3. Known transaction should be investigated for possible nontrivial laws and invariances with possible wallet spec extension.

Development Plan

  • Look in to how wallet state is updated with applyBlock
  • I have decided to add a field to Wallet rather than to the Wallet state parameter.
  • Figure out some properties

PR

Number Base
#114 master
#137 master
#148 master
#150 master

QA

  • We have extended our primitive model to now keep track of discovered transactions during block applications. These transactions are then returned as outputs rather than being stored in the wallet state (as they can grow out-of-bounds) and stored separately from the wallet state itself.

  • We have manually compared the results of restoring an existing known wallet from mainnet in Yoroi and in our current backend (I can share the mnemonic if interested to compare and tests). This wallet is rather useful as it contains both incoming and outgoing transactions, as well as transactions with no change. So it allows us to test various edge-cases of the discovery process.

  • Alongside that, we've also extended our automated test-suite and, in particular, our test data in Tests for tracking known transactions #148 such that we would generate better "fake" blockchain with both incoming and outgoing transactions.

@piotr-iohk
Copy link
Contributor

lgtm 👍

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

No branches or pull requests

5 participants