fix: gossip config for devnet interop#139
fix: gossip config for devnet interop#139pablodeymo wants to merge 2 commits intoport-leanspec-on-tickfrom
Conversation
🤖 Kimi Code ReviewReview SummaryThis PR introduces important fixes for attestation validation and aggregation logic, along with some configuration updates. Here are the key findings: Critical Issues
Security Considerations
Performance & Correctness
Code Quality
Minor Suggestions
The changes appear correct and address important consensus-layer validation issues. The PR is ready for merge. Automated review by Kimi (Moonshot AI) · custom prompt |
🤖 Codex Code ReviewReview summary: mostly solid changes, with a few correctness and security/perf concerns to address. Findings
Notable improvements
Tests/SSZ
If you want, I can dig into the attestation extraction path to confirm whether double-counting is currently possible (depends on how Automated review by OpenAI Codex · custom prompt |
Greptile SummaryThis PR fixes several gossip interop and attestation handling issues that were preventing justification and finalization in devnet-3.
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| crates/blockchain/src/store.rs | Core attestation pipeline fixes: merges known+new pools in update_safe_target, returns new aggregates from aggregate_committee_signatures for gossip broadcast, adds head >= target and head slot consistency validation checks. Logic is sound. |
| crates/blockchain/src/lib.rs | Wires up aggregated attestation broadcasting: on_tick return value is iterated and each aggregate is published to the P2P layer. Clean integration with existing P2PMessage enum. |
| crates/net/p2p/src/lib.rs | Removes validate_messages() (was silently dropping all gossip since no validation callback existed) and flood_publish(false), restoring default flood publishing. Network name changed from devnet3 to devnet0 for cross-client interop. |
| crates/blockchain/tests/signature_types.rs | Replaces ~130 lines of manual SSZ construction code with a simple hex deserializer for proposer signatures, matching the new leanSpec format. Clean simplification. |
| Makefile | Bumps leanSpec commit hash to 8b7636b for updated test fixtures. No logic changes. |
Sequence Diagram
sequenceDiagram
participant Timer as Tick Timer
participant BC as BlockChainServer
participant Store as Store (on_tick)
participant Agg as aggregate_committee_signatures
participant ST as update_safe_target
participant P2P as P2P Network
Timer->>BC: on_tick(timestamp_ms)
BC->>Store: on_tick(store, ts, has_proposal, is_aggregator)
Note over Store: Interval 0: accept attestations if proposer
Note over Store: Interval 1: vote propagation (no-op)
Store->>Agg: Interval 2: aggregate_committee_signatures(store)
Agg-->>Store: Vec<SignedAggregatedAttestation> (NEW)
Store->>ST: Interval 3: update_safe_target(store)
Note over ST: Merge known + new pools (NEW)
ST-->>Store: safe_target updated
Note over Store: Interval 4: accept new attestations
Store-->>BC: Vec<SignedAggregatedAttestation>
loop For each aggregate
BC->>P2P: PublishAggregatedAttestation(aggregate) (NEW)
end
Last reviewed commit: a10a4d4
| .expect("failed to bind gossipsub listening address"); | ||
|
|
||
| let network = "devnet3"; | ||
| let network = "devnet0"; |
There was a problem hiding this comment.
Hardcoded network name
The network identifier is hardcoded as "devnet0" (previously "devnet3"). This means every devnet migration requires a code change and rebuild. Consider making this configurable (e.g., via CLI argument, environment variable, or config file) so that the binary can be reused across devnets without source changes.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/net/p2p/src/lib.rs
Line: 156
Comment:
**Hardcoded network name**
The network identifier is hardcoded as `"devnet0"` (previously `"devnet3"`). This means every devnet migration requires a code change and rebuild. Consider making this configurable (e.g., via CLI argument, environment variable, or config file) so that the binary can be reused across devnets without source changes.
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
Motivation
Devnet-3 runs with ethlambda and Zeam showed gossip messages not being delivered properly between clients, contributing to justification/finalization failures.
Description
validate_messages()from gossipsub config — was causing messages to be silently dropped.flood_publish(false)— was preventing reliable message propagation across clients.devnet3todevnet0— aligns with the network name used by other clients, ensuring gossipsub topic strings match (e.g.,/leanconsensus/devnet0/block/ssz_snappy).How to test
Full validation requires a multi-client devnet with Zeam nodes to verify gossip interop.