feat(ethexe-consensus): in case of equal outcome prefer base announces #5261
feat(ethexe-consensus): in case of equal outcome prefer base announces #5261grishasobol wants to merge 17 commits intomasterfrom
Conversation
Changed Files
|
…e/base-announce-priority
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the consensus mechanism in the ethexe layer by prioritizing base announces when outcomes are identical, which optimizes batch commitment processes. Additionally, it streamlines the network layer by replacing custom connection limit logic with standard libp2p capabilities and updates testing utilities to support these changes. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a 'base-announce-priority' mechanism to the ethexe consensus layer, ensuring that base announces are preferred when outcomes are identical to non-base siblings. This change aims to maintain consistent batch commitment expiry even during idle periods. The implementation includes updates to the producer and subordinate state machines to handle concurrent computation of base and non-base announces, along with new utility functions in the announces module. While the logic correctly addresses the described goal, several critical issues were identified in the review: a performance-degrading debug block was left in the validator context, a change to the network connection manager bypasses the backoff mechanism for outbound connections, and there are potential integer underflow risks in the consensus logic. Additionally, some redundant database lookups and complex logic could be simplified for better maintainability.
3436867 to
1554071
Compare
|
@claude opus review |
|
Claude finished @grishasobol's task in 1m 28s —— View job Code Review: feat(ethexe-consensus): base announce priority
SummaryThis PR adds a preference for base announces when they have the same outcome as non-base siblings. The goal is to maintain a chain of base announces during idle blocks (no user messages), ensuring batch commitment expiry equals The overall design is sound and well-tested. A few issues below, mostly around edge cases in the new logic. Findingsseverity: medium — Duplicated base-preference logic in File:
severity: medium — File:
severity: medium — Producer does not emit File: When the Producer is in severity: medium — Subordinate doesn't apply base-preference when choosing announce for commitment File: The Subordinate computes both the base and non-base announces, emits severity: low — Large block of commented-out test code File: The severity: low — File: Timeout changed from 30s to 60s. Also the test now uses severity: low — File: This Overall AssessmentThe core design — eagerly computing base announces and preferring them when outcomes match — is well-reasoned and addresses a real issue with batch commitment expiry degradation during idle periods. The new The main concerns are about code clarity rather than correctness: the duplicated base-preference logic across |
| #[derive(Debug, Clone, PartialEq, Eq)] | ||
| pub struct WithHashOf<T: 'static> { | ||
| pub hash: HashOf<T>, | ||
| pub value: T, |
There was a problem hiding this comment.
can you please replace it to data: T, because value sounds like transaction value or something that have digital type.
Also in announces.rs file it would be easy to read:
Current announce.value from first view is not clearly describe the logic
let not_base_announce_hash = db.find_block_announce(block_hash, |announce| {
announce.value.parent == best_parent && !announce.value.is_base()
})?;| } else { | ||
| unreachable!(); | ||
| } | ||
| // log::info!("📗 Sending third PING message, one more attempt for Bob to catch up Alice"); |
There was a problem hiding this comment.
this is old test case, which is not correct now but and must be fixed by todo above
| db: &impl DBAnnouncesExt, | ||
| announces: impl IntoIterator<Item = HashOf<Announce>>, | ||
| commitment_delay_limit: u32, | ||
| limit: u32, |
There was a problem hiding this comment.
I think here must be ancestor_depth_limit.
Current name is misleading
|
@claude fix |
|
Claude finished @grishasobol's task in 2m 43s —— View job Fixed review feedback
Changes made
|
- Rename `WithHashOf.value` field to `data` to avoid confusion with numeric value types - Rename `limit` parameter to `ancestor_depth_limit` in `best_announce` for clarity Co-authored-by: Gregory Sobol <grishasobol@users.noreply.github.com>
No description provided.