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

librustzcash fails to spend a note at the edge of a shard #1609

Open
AArnott opened this issue Nov 6, 2024 · 4 comments
Open

librustzcash fails to spend a note at the edge of a shard #1609

AArnott opened this issue Nov 6, 2024 · 4 comments
Assignees

Comments

@AArnott
Copy link
Contributor

AArnott commented Nov 6, 2024

One of my eZcash users is getting an error from librustzcash:

"commitmenttree: unable to compute root; missing values for nodes [Address { level: Level(0), index: 73203711 }]"

This number is exactly -1 from a multiple of 2^16, suggesting the software has a bug in processing notes near the edge of a shard.

See discord discussion: https://discord.com/channels/809218587167293450/1300986651484360716

@nuttycom nuttycom self-assigned this Nov 7, 2024
@daira
Copy link
Contributor

daira commented Nov 18, 2024

What commit of librustzcash is being used?

@AArnott
Copy link
Contributor Author

AArnott commented Nov 18, 2024

That was on 04478c7

@str4d
Copy link
Contributor

str4d commented Jan 9, 2025

I spent the past day building zcash/zcash-devtool#76 to enable debugging this kind of issue. In a wallet I have access to, I observe a level 1 nil node, indicating that the ShardTree contains neither the two leaf nodes nor their parent, and has been pruned back to level 2. The nil node is on the right-most side of a subtree, same as in this issue.

@str4d
Copy link
Contributor

str4d commented Jan 9, 2025

That was on 04478c7

This is zcash_client_sqlite 0.11.2 plus whatever was in main after it was merged back, in particular #1524. I don't see any changes between zcash_client_sqlite 0.11.0 and that commit related to shardtree, so I think that means it was using shardtree 0.4 (which we upgraded to for zcash_client_sqlite 0.11.0 in #1493). That was the bugfix release in which we supposedly fixed the pruning-related bugs.

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

4 participants