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 RootHash to Commitment based on ZIP-244 #1957

Merged
merged 2 commits into from
Mar 30, 2021

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Mar 29, 2021

Motivation

The goal of this PR is to make progress on the outstanding cleanups on the block commitment field from #881.

In ZIP-244, the root hash field is renamed to block commitment. This name is more generic, and will probably stay the same going forward.

Solution

Interactive replace using:

fastmod RootHash Commitment
fastmod root_hash commitment
fastmod root_bytes commitment_bytes
git mv zebra-chain/src/block/root_hash.rs zebra-chain/src/block/commitment.rs

All replacements were accepted.

Review

@dconnolly or @oxarbitrage just a quick search and replace PR that's blocking other issues.

Related Issues

Implements part of #1874 and #881, but doesn't finish either of them.

Follow Up Work

Finish #881
Do design for #1874

Interactive replace using:
```sh
fastmod RootHash Commitment
fastmod root_hash commitment
fastmod root_bytes commitment_bytes
git mv zebra-chain/src/block/root_hash.rs zebra-chain/src/block/commitment.rs
```

All replacements were accepted.
@teor2345 teor2345 added A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement NU-5 Network Upgrade: NU5 specific tasks P-Medium labels Mar 29, 2021
@teor2345 teor2345 added this to the 2021 Sprint 6 milestone Mar 29, 2021
@teor2345 teor2345 self-assigned this Mar 29, 2021
Copy link
Contributor

@dconnolly dconnolly left a comment

Choose a reason for hiding this comment

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

A thought: in (sapling|orchard)::commitments, because there are several (Note, Value), they are explicitly named as such, even if it's a little redundant based on module paths and context, etc. Would naming this BlockCommitment work? Or is that possibly a less accurate name than just Commitment. Hm.

@teor2345
Copy link
Contributor Author

teor2345 commented Mar 30, 2021

A thought: in (sapling|orchard)::commitments, because there are several (Note, Value), they are explicitly named as such, even if it's a little redundant based on module paths and context, etc. Would naming this BlockCommitment work? Or is that possibly a less accurate name than just Commitment. Hm.

I had expected we would use Commitment like Height and Hash:

use path::to::block;

const commitment: block::Commitment = Default::default();

@dconnolly
Copy link
Contributor

I had expected we would use Commitment like Height and Hash:

use path::to::block;

const commitment: block::Commitment = Default::default();

OK yeah, sounds good. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement NU-5 Network Upgrade: NU5 specific tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants