Skip to content

Conversation

@bharath-123
Copy link
Contributor

@bharath-123 bharath-123 commented Oct 21, 2025

This PR has logic to:

  1. We define 3 node roles, Mesh Nodes, Mesh Attester Nodes and Non-Mesh Attester Nodes. Mesh Nodes are nodes which subscribe to the topic but do not publish. Mesh Attester Nodes subscribe to the topic and also publish messages. Non-Mesh Attester Nodes do not subscribe to the topic but publish messages. Attsim uses nodeIds to give each node a unique ID. We reserve the first n IDs for the n Mesh Nodes, The next k ids for the k Mesh Attester Nodes and the remaining ids for Non-Mesh Attester Nodes. Non-Mesh Attester Nodes are only connected to Mesh Nodes and Mesh Attester Nodes with a degree which can be specified in the NON_MESH_NODE_PEER_COUNT flag in the Makefile.
  2. Simulate BLS batch verification in the async validator for each gossipsub nodes. We define the batch interval with BATCH_INTERVAL i.e how frequently the batch is flushed and verified and BATCH_VERIFIER_TIME to define the time taken for the batch verifier to run. The BLS batch verification simulation is integrated into the async validator for the topic. When we receive a message for async validation, it is sent to the BLS batch verification simulator where it sits in a batch until it is flushed and the batch verifier runs(it just runs as a sleep in this case)
  3. Mark percentiles in the output plot. We clearly mark when 50th, 75th, 90th and 99th percentile of the messages have been received by all nodes. In the Y-Axis of the plot, we mark the cumulative %ge of messages received.
  4. Define the notion of a Slot similar to an Ethereum slot. We use this to run the simulation for any given number of times.
  5. Have a SimConfig file to which we will eventually move all simulation parameters.

case <-ctx.Done():
return pubsub.ValidationReject
case <-time.After(100 * time.Millisecond):
// Timeout after 50ms (should be well within batch processing time)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

stale comment

Makefile Outdated
Comment on lines 75 to 76
uv run plot_propagation.py $(NODE_COUNT) --topology-file $(TOPOLOGY_FILE) --peer-count $(PEER_COUNT) --non-mesh-node-peer-count $(NON_MESH_NODE_PEER_COUNT) --batch-interval $(BATCH_INTERVAL) --batch-verifier-time $(BATCH_VERIFIER_TIME) -o plots/batch_$(BATCH_INTERVAL)ms_node$(NODE_COUNT)_mesh_nodes$(MESH_NODE_COUNT)_mesh_attesters$(MESH_ATTESTER_COUNT)_non_mesh_attesters$(NON_MESH_ATTESTER_COUNT).png
@test -f plots/batch_$(BATCH_INTERVAL)ms_node$(NODE_COUNT)_mesh_nodes$(MESH_NODE_COUNT)_mesh_attesters$(MESH_ATTESTER_COUNT)_non_mesh_attesters$(NON_MESH_ATTESTER_COUNT).png && echo "Plot generated: plots/batch_$(BATCH_INTERVAL)ms_node$(NODE_COUNT)_mesh_nodes$(MESH_NODE_COUNT)_mesh_attesters$(MESH_ATTESTER_COUNT)_non_mesh_attesters$(NON_MESH_ATTESTER_COUNT).png" || echo "Plot generation failed"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The names are a little long. Probably we could shorten them


# Build args with topology file
args = f"-node-id {i} -node-count {node_count} -msg-size {msg_size} -topology-file {topology_file}"
# Build args with topology file, nodes to publish, and batch parameters
Copy link
Contributor Author

Choose a reason for hiding this comment

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

stale comment.

return
}

time.Sleep(bv.batchVerifierTime)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of having a hard coded batch verifier time. It would be better to define the time taken per signature and multiply it with the batch size. That would be more accurate.

Copy link

@raulk raulk left a comment

Choose a reason for hiding this comment

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

Merging to review everything at once on main.

@raulk raulk merged commit 12bc390 into main Nov 7, 2025
1 of 3 checks passed
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.

3 participants