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

Refactor demo and block payload implementations #1770

Merged
merged 7 commits into from
Sep 19, 2023
Merged

Conversation

shenkeyao
Copy link
Member

  • Removes vdemo (for validating consensus).
  • Moves sdemo to the upper crate, and renames it to demo since it's now the only demo.
  • Extract block payload-related implementations from demo to block_impl.

Closes #1673.

@shenkeyao shenkeyao marked this pull request as ready for review September 18, 2023 16:03
elliedavidson
elliedavidson previously approved these changes Sep 18, 2023
Copy link
Member

@elliedavidson elliedavidson left a comment

Choose a reason for hiding this comment

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

Looks good!

crates/hotshot/examples/web-server-da/multi-validator.rs Outdated Show resolved Hide resolved
crates/hotshot/src/block_impl.rs Outdated Show resolved Hide resolved
crates/hotshot/src/block_impl.rs Outdated Show resolved Hide resolved
jbearer
jbearer previously approved these changes Sep 18, 2023
Copy link
Member

@jbearer jbearer left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 18 to 20
// TODO: Use use VID block commitment.
// <https://github.com/EspressoSystems/HotShot/issues/1730>
commit::RawCommitmentBuilder::new("Txn Comm").finalize()
Copy link
Member

Choose a reason for hiding this comment

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

How does the transaction commitment relate to the block commitment? Does it at all? My understanding is VID just treats the whole block as a blob, without regard for transaction boundaries. Then I think the only use of the transaction hash would be as a unique index, say for filtering duplicate transactions and stuff, peripheral to the core of consensus? In that case I think this can just be a regular Keccak commitment (ie using the commit library as we normally do)

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree! Ideally, this function could just return the keccak hash, but this would need updates to the Committable trait and some other structs that implement Committable, so as a short-term fix, I calculated the Keccak256 hash and then converted it into a Commitment.

Copy link
Member Author

Choose a reason for hiding this comment

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

Made an issue for commitment refactoring: #1774.

crates/hotshot/src/block_impl.rs Outdated Show resolved Hide resolved
jbearer
jbearer previously approved these changes Sep 19, 2023
crates/hotshot/src/block_impl.rs Outdated Show resolved Hide resolved
@shenkeyao shenkeyao merged commit fe199a2 into main Sep 19, 2023
4 of 6 checks passed
@shenkeyao shenkeyao deleted the keyao/block-payload branch September 19, 2023 17:37
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.

Add block payload building API
4 participants