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

Remove unused ValidateStateUpdate Event, Consolidate Shared state insertions #3866

Merged
merged 4 commits into from
Nov 8, 2024

Conversation

bfish713
Copy link
Collaborator

@bfish713 bfish713 commented Nov 7, 2024

Closes #<ISSUE_NUMBER>

This PR:

  • Removes ValidatedStateUpdated event - nobody was listening for it anymore
  • Consolidates the two functions: update_saved_leafs and update_validate_state because in most cases they should be called together.
  • Adds update_da_view for the once case where we want to update the validate state map without a leaf yet.

Overall this should make it harder to do the wrong thing and makes the code updating shared state easier to write

This PR does not:

Key places to review:

@bfish713 bfish713 marked this pull request as ready for review November 7, 2024 22:14
@@ -257,34 +256,23 @@ pub(crate) async fn update_shared_state<
// We will defer broadcast until all states are updated to avoid holding onto the lock during a network call.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: comment doesn't seem valid now that we don't broadcast_event

@@ -203,10 +203,6 @@ pub enum HotShotEvent<TYPES: NodeType> {
/// Upgrade certificate has been sent to the network
UpgradeCertificateFormed(UpgradeCertificate<TYPES>),

/* Consensus State Update Events */
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this comment be kept, as it applies to the following non-removed events as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It should, I do delete in the next pr though

@bfish713 bfish713 merged commit cd5fda6 into main Nov 8, 2024
16 checks passed
@bfish713 bfish713 deleted the bf/shared-state branch November 8, 2024 22:29
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.

4 participants