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

darksidewalletd: check the correctness of incoming transactions' merkle root anchors #346

Open
2 tasks
defuse opened this issue Apr 19, 2021 · 2 comments
Open
2 tasks
Assignees

Comments

@defuse
Copy link
Collaborator

defuse commented Apr 19, 2021

The bug in Electric-Coin-Company/zcash-swift-wallet-sdk#253 cannot be properly tested using darksidewalletd because the failure there gets detected by the consensus rules implemented in zcashd, which are not present in darksidewalletd.

To properly test that bug, we'll want darksidewalletd to:

  • Calculate the correct merkle root for each fake "mined" block in its state, which is produced by appending each mined transaction's commitments to the merkle tree.
  • Check, when a transaction is submitted, that the anchor it used is a valid merkle tree root for one of the mined blocks as calculated above.

We should also think more generally about which consensus rules it will be important to emulate in darksidewalletd for testing---I'd really like to avoid implementing consensus rules in darksidewalletd as much as possible because it's a lot of effort and will be prone to diverging from the actual consensus rules in zcashd.

@pacu
Copy link
Contributor

pacu commented Apr 19, 2021

@LarryRuane @gmale and I discussed this over an ad-hoc standup meeting today.

Kevin proposed that we could probably spin up a testnet build and try to reproduce this against a that network. The problem I see is that we need to force a reorg to test our hypothesis and that's not possible to do on testnet as is (maybe testnet in a box?)

@defuse
Copy link
Collaborator Author

defuse commented Apr 19, 2021

If we had an ASIC we could forcefully reorg testnet, but we probably don't want to rely on that because (a) it may interrupt other testing going on on testnet and (b) if other ASICs start mining on testnet then we won't be able to do it anymore.

I'm curious if it's possible with testnet in a box though, that would be really really cool!

@LarryRuane LarryRuane self-assigned this Sep 22, 2021
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

3 participants