Skip to content

Conversation

@bomanaps
Copy link
Member

Implements comprehensive unit test suite for eth2network connections and primary messaging functionality, covering all network layer components without node dependencies.
closes #159

@bomanaps bomanaps requested a review from GrapeBaBa September 17, 2025 15:17
@GrapeBaBa
Copy link
Member

@bomanaps @g11tech I thought we main need to test real gossip networking not mock network, is it correct?

@bomanaps
Copy link
Member Author

h I thought we main need to test real gossip networking not mock net

We have blockers for this cannot test full protocol functionality without complete ReqResp implementation, we need to fix loop scheduling, resolve memory management these are todos we need to address before we can test real network

@g11tech
Copy link
Member

g11tech commented Sep 23, 2025

h I thought we main need to test real gossip networking not mock net

We have blockers for this cannot test full protocol functionality without complete ReqResp implementation, we need to fix loop scheduling, resolve memory management these are todos we need to address before we can test real network

yes we need to test ethlibp2p network connections, leave req/resp out of it, let there be other issues why are they blocker to complete this job

// TODO: prevent from publishing to self handler
const self: *Self = @ptrCast(@alignCast(ptr));
return self.gossipHandler.onGossip(data, true);
return self.gossipHandler.onGossip(data, false); // Use sync delivery for tests
Copy link
Member

Choose a reason for hiding this comment

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

do not change the intended behavior of mock network

Copy link
Member Author

Choose a reason for hiding this comment

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

I made this so to ensure deterministic delivery without relying on event-loop scheduling, which isn’t running in our unit tests.

Copy link
Member

@g11tech g11tech Sep 27, 2025

Choose a reason for hiding this comment

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

no this can't be done, fix tests
though you can have this for your dev, ethlibp2p network anyway doesnt use event loop scheduling which is what this PR has to target

pub fn onGossip(ptr: *anyopaque, data: *const interface.GossipMessage) anyerror!void {
const self: *Self = @ptrCast(@alignCast(ptr));
return self.gossipHandler.onGossip(data, true);
return self.gossipHandler.onGossip(data, false); // Use sync delivery for tests
Copy link
Member

Choose a reason for hiding this comment

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

undo

@g11tech
Copy link
Member

g11tech commented Jan 1, 2026

is this PR needed (post fixing the issues) or do we already have tests to cover eth2network?
@GrapeBaBa @anshalshukla @chetanyb

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.

add unit test for testing eth2network connections and primary messaging

3 participants