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

Handle CollationSeconded Logs Conditionally #1475

Merged
merged 6 commits into from
Sep 8, 2023

Conversation

BradleyOlson64
Copy link
Contributor

@BradleyOlson64 BradleyOlson64 commented Sep 8, 2023

Separating the VStaging message handling case from V1 made the most sense to me. Let me know if there was a more concise way!

Closes #1469

@slumber
Copy link
Contributor

slumber commented Sep 8, 2023

We could also just drop it instead of duplicating code (if others agree)

@rphmeier
Copy link
Contributor

rphmeier commented Sep 8, 2023

@slumber is right.

This isn't a V1/VStaging difference. You could write a V1 collator which didn't rely on receiving Seconded messages and a VStaging collator which did.

The logic change needed is to expect a CollationSeconded statement even when no higher-level code cares about it.

@rphmeier
Copy link
Contributor

rphmeier commented Sep 8, 2023

We have three variables.

  1. collation submitted
  2. listener registered (can only be true if (1) is true)
  3. received a CollationSeconded message.

We want to warn when (3) is true and (1) is false. We don't want to warn when (1), (3) are true but (2) is false. We don't want to warn when (1) and (3) are true in general.
The current code assumes (1) implies (2) and that !(2) -> !(1) but that is not true and why we are getting sporadic warnings.

I hope this is clear now.

@BradleyOlson64 BradleyOlson64 changed the title Remove Non-applicable Log from VStaging::CollationSeconded Message Handling Handle CollationSeconded Logs Conditionally Sep 8, 2023
);
},
None => {
gum::debug!(
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd make this a warning, usually a mismatch here is likely a bug.

Copy link
Contributor

Choose a reason for hiding this comment

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

debug! logs are often for bugs, just not critical ones.

@rphmeier
Copy link
Contributor

rphmeier commented Sep 8, 2023

bot merge

@command-bot
Copy link

command-bot bot commented Sep 8, 2023

@rphmeier Unknown command "merge". Refer to help docs and/or source code.

@rphmeier rphmeier merged commit 6b3aa7d into master Sep 8, 2023
@rphmeier rphmeier deleted the brad-silence-non-applicable-log branch September 8, 2023 22:28
Daanvdplas pushed a commit that referenced this pull request Sep 11, 2023
* Removing unnecessary log

* Drop unneeded log

* Handling logs conditionally

* Changing unexpected message to warn

* Back to debug

* fmt
bkchr pushed a commit that referenced this pull request Apr 10, 2024
* store both block number and hash in BestFinalized

* also fix relay code

* spelling
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.

Silence "unexpected CollationResult" log when no listener was registered
4 participants