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

rename keccak #6197

Merged
merged 1 commit into from
Oct 27, 2023
Merged

rename keccak #6197

merged 1 commit into from
Oct 27, 2023

Conversation

tanishqjasoria
Copy link
Contributor

With verkle tree, we would be using Pedersen in instead of Keccak for state related operations.
Also there are other chains, that we plan to support, using differnet commitment schemes (For eg. poseidon).
This PR replaces Keccak with a more generic class Commitment that can be used to represent any commitment scheme (32 bytes).

Changes

  • rename Keccak -> Commitment, ValueKeccak -> ValueCommitemnt, KeccakStructRef -> CommitmentStructRef
  • seperate the representation and computation of Keccak.

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Current unittest already cover this properly

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No

@tanishqjasoria
Copy link
Contributor Author

https://github.com/NethermindEth/nethermind/pull/6197/files#diff-126685825e25ecfb16e932661d002ae93a9a4b630fc6aba8cf79c9201726c397

https://github.com/NethermindEth/nethermind/pull/6197/files#diff-a8b151e18c2db3d54234d51fe2fed07f325470326500bb87e44d9cff6c44b4fb

these are the two files that are the important - rest almost everthing is result of renaming.

@benaadams
Copy link
Member

Why Commitment?

That seems more for what its used for (i.e. variable name) than what it is (i.e. class name)

Pedersen is also a Hash; as is Poseidon; would generic Hash be better?

I may have this wrong, but I think a Commitment scheme can use hashes, but a Cryptographic hash function is not necessarily part of a Commitment scheme?

@tanishqjasoria
Copy link
Contributor Author

Yes, I think we can rename it to Hash insted of Commitment.

@LukaszRozmej
Copy link
Member

+1 for Hash or even better Hash256?

@tanishqjasoria
Copy link
Contributor Author

+1 for Hash or even better Hash256?

or Hash32?

@asdacap
Copy link
Contributor

asdacap commented Oct 18, 2023

I vote for Hash256.

add keccak for computation

fix test file

rename commitment > hash256
@tanishqjasoria
Copy link
Contributor Author

renamed to Hash256, ready for a review!

@tanishqjasoria tanishqjasoria self-assigned this Oct 27, 2023
@LukaszRozmej LukaszRozmej merged commit 422a1fe into master Oct 27, 2023
61 checks passed
@LukaszRozmej LukaszRozmej deleted the replace-keccak-v2 branch October 27, 2023 13:21
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.

None yet

4 participants