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

fix: coinbase output recovery bug #3789

Merged

Conversation

philipr-za
Copy link
Contributor

Description

A bug was discovered when recovering Coinbase outputs that was revealed when the Key Manager was fixed to actually use branch seeds. Coinbase output keys are derived on a separate key manager branch so when the UTXO scanner tried to update the key manager index it would not find the coinabse key in the main spending key branch which caused an error.

This PR updates the UTXO scanner to check if a recovered output has the coinbase flag or not and then searches on the Coinbase branch when looking for that outputs key index and script key.

How Has This Been Tested?

The PR updates the Wallet recovery with connected base node staying online cucumber test to include recovering some coinbase outputs.
The PR also updates the Multiple Wallet recovery from seed node cucumber test to work now that the coinbase issue is fixed. The test is also updated so that it recovered N distinct wallets to the same seed node where as before it would create N wallet with the same seed words and thus network identity.

A bug was discovered when recovering Coinbase outputs that was revealed when the Key Manager was fixed to actually use branch seeds. Coinbase output keys are derived on a separate key manager branch so when the UTXO scanner tried to update the key manager index it would not find the coinabse key in the main spending key branch which caused an error.

This PR updates the UTXO scanner to check if a recovered output has the coinbase flag or not and then searches on the Coinbase branch when looking for that outputs key index and script key.

The PR updates the `Wallet recovery with connected base node staying online` cucumber test to include recovering some coinbase outputs.
The PR also updates the `Multiple Wallet recovery from seed node` cucumber test to work now that the coinbase issue is fixed. The test is also updated so that it recovered N distinct wallets to the same seed node where as before it would create N wallet with the same seed words and thus network identity.
@philipr-za philipr-za changed the title Fix: coinbase output recovery bug fix: coinbase output recovery bug Feb 2, 2022
Copy link
Member

@sdbondi sdbondi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aviator-app aviator-app bot merged commit beb299e into tari-project:development Feb 3, 2022
sdbondi added a commit to sdbondi/tari that referenced this pull request Feb 8, 2022
* development:
  refactor: reduce log level of some messages (tari-project#3804)
  ci: move Apple IDs into envs (tari-project#3797)
  feat: read asset definitions from base layer (tari-project#3802)
  fix: bump flood ban messages config (tari-project#3799)
  docs: readme fixes (tari-project#3800)
  feat(wallet_ffi)!:  add base node connectivity callback to wallet ffi (tari-project#3796)
  fix: minor fixes on collectibles (tari-project#3795)
  refactor: outbound message pipeline, threads and mempool improvements (tari-project#3792)
  feat(collectibles): add delete committee member button (tari-project#3786)
  fix(comms): minor edge-case fix to handle inbound connection while dialing (tari-project#3785)
  fix(core)!: fix potential panic for sidechain merkle root with incorrect length (tari-project#3788)
  fix(core): reduce one block behind waiting period (tari-project#3798)
  feat: add specific LibWallet error code for “Fee is greater than amount” (tari-project#3793)
  fix: coinbase output recovery bug (tari-project#3789)
  feat(base-node): add number of active sync peers metric (tari-project#3784)
  chore: script to keep .gitkeep file (tari-project#3787)
  feat: re-use scanned range proofs (tari-project#3764)
  feat: ability to compile on stable rust (tari-project#3759)
  feat: add logging and config to collectibles (tari-project#3781)
  chore: remove debug info from get-mempool-state (tari-project#3782)
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

Successfully merging this pull request may close these issues.

3 participants