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

Refactors to fit into sequencer TestNetwork #87

Merged
merged 2 commits into from
Aug 24, 2024
Merged

Conversation

QuentinI
Copy link
Contributor

Closes #<ISSUE_NUMBER>

This PR:

Modifies run_non_permissioned_standalone_builder_service to accept generic event stream for usage in testing with event service replaced by direct access to hotshot event stream. Logic surrounding event service moved to a separate Stream implementation that can be called in the sequencer binary as an utility.

This PR does not:

Key places to review:

"Sending DA proposal to the builder states for view {:?}",
view_number
);
if !sender.validate(&da_proposal.signature, &encoded_txns_hash) {
Copy link
Member

Choose a reason for hiding this comment

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

Is it because the validate function handles the leader == sender check, that we no longer need to explicitly check it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wasn't necessary from the get go, because HotShot simply won't emit an event if the sender isn't the leader. Technically, it's true for the signature validation as well, but I left it be as a sanity check.

src/service.rs Show resolved Hide resolved
}
}

#[instrument(skip_all, fields(sender, quorum_proposal.data.view_number))]
async fn handle_qc_event<TYPES: NodeType>(
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I think qc should be quorum here. No need to do any renaming in this PR. I'm going to make a separate issue for all qc-to-quorum renaming that we can do in the future.

Copy link
Member

Choose a reason for hiding this comment

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

Made a low-priority issue: #88.

src/utils.rs Outdated
Copy link
Member

@shenkeyao shenkeyao Aug 23, 2024

Choose a reason for hiding this comment

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

I really like these utility functions!

Nit: Can we add hotshot to function or struct names that are only for HotShot events? E.g., I would think connect_inner is a helper function for connecting to any event service, but it turns out to be for HotShot specifically.

Copy link
Contributor Author

@QuentinI QuentinI Aug 23, 2024

Choose a reason for hiding this comment

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

Sorry, not sure I understand you right. Those are HotShot events in the same sense as the builder-core is HotShot builder-core, i.e. it builds for any HotShot application, so adding HotShot feels redundant, as if we renamed any other type T we have to HotShotT because it's part of HotShot ecosystem

Copy link
Member

Choose a reason for hiding this comment

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

Was thinking it could be a some other URL, e.g., for solver. But I think what you said also makes sense. No need to change!

@QuentinI QuentinI merged commit 957fd10 into main Aug 24, 2024
5 checks passed
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.

2 participants