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

Add cryptarchia consensus service #612

Merged
merged 4 commits into from
Mar 15, 2024
Merged

Add cryptarchia consensus service #612

merged 4 commits into from
Mar 15, 2024

Conversation

zeegomo
Copy link
Contributor

@zeegomo zeegomo commented Mar 14, 2024

First PR for adding cryptarchia support in nomos node.

Leadership and tests will come in following iterations

@zeegomo zeegomo self-assigned this Mar 14, 2024
@zeegomo zeegomo marked this pull request as draft March 14, 2024 12:11
@zeegomo zeegomo marked this pull request as ready for review March 14, 2024 15:13
Comment on lines 49 to 50
fn try_apply_header(&self, header: &Header) -> Result<Self, Error> {
let header = header.cryptarchia();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not simply take cryptarchia::Header here and force the caller to prove an instance of cryptarchia::Header?

This seems falsely general (i.e. type sig claims to work for any header)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fair enough

let ledger = self.ledger.try_update(
id,
parent,
header.slot(),
Copy link
Contributor

Choose a reason for hiding this comment

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

header.slot() is stored in the slot variable above.

Is header moved in this call to try_update()? If not, you could inline all the variables (id()|parent()|slot())

Copy link
Contributor

@youngjoon-lee youngjoon-lee 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. I'll open a PR for the mixnet network adapter for the cryptarchia consensus service.

@zeegomo zeegomo merged commit 1b925d9 into master Mar 15, 2024
12 checks passed
@zeegomo zeegomo deleted the cryptarchia-consensus branch March 15, 2024 14:53
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

3 participants