Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Fix: Remove hashing from leaf keys in SMT Node #69

Merged
merged 5 commits into from
Feb 28, 2022

Conversation

bvrooman
Copy link
Contributor

@bvrooman bvrooman commented Feb 28, 2022

The current SMT implementation hashes keys provided by calls to update and delete. The SMT spec mandates leaves use the raw 32 byte key input, rather than the hash of the key input. This means clients are able to decide on the algorithm that produces 32 byte keys.

This behaviour is an artifact of the Celestia SMT implementation. Both the Celestia implementation and the Fuel implementation are moving towards an SMT interface that takes in 32 byte keys for update and delete functions.

In this PR, I am changing the internal SMT node structure so that leaves are constructed using raw 32 byte keys. The WIP SMT PR has been similarly modified to expose the correct update and delete interface using 32 byte keys. I am also including minor changes to the Node structure from the SMT PR in this PR.

@bvrooman bvrooman self-assigned this Feb 28, 2022
src/sparse/node.rs Outdated Show resolved Hide resolved
src/sparse/node.rs Outdated Show resolved Hide resolved
src/sparse/node.rs Outdated Show resolved Hide resolved
src/sparse/node.rs Outdated Show resolved Hide resolved
src/sparse/node.rs Outdated Show resolved Hide resolved
@bvrooman
Copy link
Contributor Author

bvrooman commented Feb 28, 2022

I think the moral of the story is not to mix orthogonal changes. I repent!

@bvrooman bvrooman merged commit 41d15e8 into master Feb 28, 2022
@bvrooman bvrooman deleted the bvrooman-fix-remove-leaf-key-hashing branch February 28, 2022 19:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants