Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
8f70329
allow commiting message_propagation image
Oct 17, 2025
2d2b041
register a topic validator
bharath-123 Oct 17, 2025
fd5305c
commit the plot
Oct 17, 2025
cd21ba9
update message_propoagation file name
bharath-123 Oct 17, 2025
9d5d3fe
add graph
Oct 17, 2025
beb9ef4
take in output message propagation file as a cmd line param
bharath-123 Oct 17, 2025
7180bb9
add test file png
Oct 17, 2025
67fff58
update async validation time to 50ms
bharath-123 Oct 17, 2025
cc29723
add first run image
Oct 17, 2025
6a92465
add graphs
Oct 17, 2025
7f71448
reduce gossipsub sleep by half
bharath-123 Oct 17, 2025
2d2d948
runs with 25ms sleep
Oct 17, 2025
1bfe29a
use 5ms sleep
bharath-123 Oct 17, 2025
69ed451
add test output
Oct 17, 2025
a37b397
add test output
Oct 17, 2025
1b3fe22
add test output
Oct 17, 2025
31e0000
add test output
Oct 17, 2025
81a67ad
set sleep time to 4ms
bharath-123 Oct 17, 2025
51c831d
Plot a CDF
bharath-123 Oct 20, 2025
e9b76a1
undo cdf graph
bharath-123 Oct 20, 2025
cc7b2d3
save
Oct 20, 2025
88ca25e
plot
Oct 20, 2025
8f1afc3
consider nodes to publish while testing and plotting graphs
bharath-123 Oct 20, 2025
4ee30ee
plot
Oct 20, 2025
2227aab
plot
bharath-123 Oct 20, 2025
ab5ef61
mark percentiles in plot
bharath-123 Oct 20, 2025
e80c528
plot
bharath-123 Oct 20, 2025
2c3d476
add batch verifier
bharath-123 Oct 20, 2025
726ddaa
start with 50ms ticker
bharath-123 Oct 20, 2025
d9cc19c
remove some logs
bharath-123 Oct 20, 2025
23dbe6b
uncomment
bharath-123 Oct 20, 2025
5c571bd
increase timeout
bharath-123 Oct 20, 2025
8282a6e
plot
bharath-123 Oct 21, 2025
e1773c5
remove test results which do not consider batch verification
bharath-123 Oct 21, 2025
0d4ee86
only plot the arrival times for publishers
bharath-123 Oct 21, 2025
4a74f63
only allow publishers to subscribe
bharath-123 Oct 21, 2025
7c5045f
include peer count in graph
bharath-123 Oct 21, 2025
3c7ee7e
plot
bharath-123 Oct 21, 2025
41f068d
plot
bharath-123 Oct 21, 2025
6eb44fe
parameterise the BATCH_INTERVAL and BATCH_VERIFIER_TIME
bharath-123 Oct 21, 2025
7323a93
fix typo in calling flag
bharath-123 Oct 21, 2025
ea52893
initial runs
Oct 21, 2025
2366fbe
Squashed commit of the following:
bharath-123 Oct 22, 2025
fc759eb
plot
Oct 22, 2025
b05e109
Squashed commit of the following:
bharath-123 Oct 22, 2025
bbb169d
plot
Oct 22, 2025
71cb353
correct total_expected messages
bharath-123 Oct 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ shadow.data/
topology.json
gossipsub/topology.json
shadow-gossipsub.yaml
message_propagation.png

# Go build artifacts
*.out
Expand Down
37 changes: 24 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@

# Default parameters
NODE_COUNT ?= 10
NODES_TO_PUBLISH ?= 10
NODES_TO_SUBSCRIBE ?=10
MSG_SIZE ?= 256
TOPOLOGY_TYPE ?= random-regular
PEER_COUNT ?= 4
BRANCHING ?= 2
PROGRESS ?= false
LOG_LEVEL ?= info
BATCH_INTERVAL ?= 5
BATCH_VERIFIER_TIME ?= 4500

# Paths
TOPOLOGY_GEN_DIR = topology/gen
Expand Down Expand Up @@ -46,28 +50,28 @@ build: check-deps

# Generate network graph and Shadow configuration
generate-config: generate-topology
@echo "Generating Shadow network configuration for $(NODE_COUNT) nodes..."
uv run network_graph.py $(NODE_COUNT) $(MSG_SIZE) $(TOPOLOGY_FILE)
@echo "Generating Shadow network configuration for $(NODE_COUNT) nodes with $(NODES_TO_PUBLISH) publishers and $(NODES_TO_SUBSCRIBE) subscribers..."
uv run network_graph.py $(NODE_COUNT) $(MSG_SIZE) $(TOPOLOGY_FILE) $(NODES_TO_PUBLISH) $(NODES_TO_SUBSCRIBE) $(BATCH_INTERVAL) $(BATCH_VERIFIER_TIME)
@test -f shadow-gossipsub.yaml && test -f graph.gml || (echo "Config generation failed" && exit 1)
@echo "Configuration generated"

# Run the complete Shadow simulation
run-sim: build generate-config
@echo "Starting GossipSub Shadow simulation ($(NODE_COUNT) nodes, $(MSG_SIZE) byte message)..."
@echo "Starting GossipSub Shadow simulation ($(NODE_COUNT) nodes, $(NODES_TO_PUBLISH) publishers, $(NODES_TO_SUBSCRIBE) subscribers, $(MSG_SIZE) byte message)..."
@rm -rf shadow.data/
shadow --progress $(PROGRESS) shadow-gossipsub.yaml
@echo "GossipSub simulation completed"

# Test simulation results
test:
@echo "Testing GossipSub simulation results..."
uv run test_results.py $(NODE_COUNT)
uv run test_results.py $(NODE_COUNT) $(NODES_TO_PUBLISH) $(NODES_TO_SUBSCRIBE)

# Plot message propagation
plot:
@echo "Plotting message propagation..."
uv run plot_propagation.py $(NODE_COUNT)
@test -f message_propagation.png && echo "Plot generated: message_propagation.png" || echo "Plot generation failed"
uv run plot_propagation.py $(NODE_COUNT) -p $(NODES_TO_PUBLISH) -s $(NODES_TO_SUBSCRIBE) --peer-count $(PEER_COUNT) --batch-interval $(BATCH_INTERVAL) --batch-verifier-time $(BATCH_VERIFIER_TIME) -o plots/batch_$(BATCH_INTERVAL)ms_node$(NODE_COUNT)_publishers$(NODES_TO_PUBLISH)_subscribers$(NODES_TO_SUBSCRIBE).png
@test -f plots/batch_$(BATCH_INTERVAL)ms_node$(NODE_COUNT)_publishers$(NODES_TO_PUBLISH)_subscribers$(NODES_TO_SUBSCRIBE).png && echo "Plot generated: plots/batch_$(BATCH_INTERVAL)ms_node$(NODE_COUNT)_publishers$(NODES_TO_PUBLISH)_subscribers$(NODES_TO_SUBSCRIBE).png" || echo "Plot generation failed"

# Clean build artifacts and simulation results
clean:
Expand Down Expand Up @@ -103,20 +107,27 @@ help:
@echo " help - Show this help message"
@echo ""
@echo "Configuration variables:"
@echo " NODE_COUNT - Number of nodes (default: $(NODE_COUNT))"
@echo " MSG_SIZE - Message size in bytes (default: $(MSG_SIZE))"
@echo " TOPOLOGY_TYPE - Topology type: mesh, tree, random-regular (default: $(TOPOLOGY_TYPE))"
@echo " PEER_COUNT - Peer count for random-regular (default: $(PEER_COUNT))"
@echo " BRANCHING - Branching factor for tree (default: $(BRANCHING))"
@echo " PROGRESS - Show Shadow progress bar (default: $(PROGRESS))"
@echo " LOG_LEVEL - Log level (default: $(LOG_LEVEL))"
@echo " NODE_COUNT - Number of nodes (default: $(NODE_COUNT))"
@echo " NODES_TO_PUBLISH - Number of nodes that will publish messages (default: $(NODES_TO_PUBLISH))"
@echo " NODES_TO_SUBSCRIBE - Number of nodes that will subscribe to messages (default: $(NODES_TO_SUBSCRIBE))"
@echo " MSG_SIZE - Message size in bytes (default: $(MSG_SIZE))"
@echo " TOPOLOGY_TYPE - Topology type: mesh, tree, random-regular (default: $(TOPOLOGY_TYPE))"
@echo " PEER_COUNT - Peer count for random-regular (default: $(PEER_COUNT))"
@echo " BRANCHING - Branching factor for tree (default: $(BRANCHING))"
@echo " PROGRESS - Show Shadow progress bar (default: $(PROGRESS))"
@echo " LOG_LEVEL - Log level (default: $(LOG_LEVEL))"
@echo " BATCH_INTERVAL - BLS batch interval in milliseconds (default: $(BATCH_INTERVAL))"
@echo " BATCH_VERIFIER_TIME - BLS batch verifier time in microseconds (default: $(BATCH_VERIFIER_TIME))"
@echo ""
@echo "Examples:"
@echo " make all # Run simulation, test, and plot (random-regular)"
@echo " make run-sim NODE_COUNT=20 MSG_SIZE=512 # Custom parameters"
@echo " make run-sim NODE_COUNT=20 NODES_TO_PUBLISH=5 # 20 nodes, only 5 publish"
@echo " make run-sim NODE_COUNT=20 NODES_TO_PUBLISH=5 NODES_TO_SUBSCRIBE=15 # 5 publishers, 15 subscribers"
@echo " make run-sim TOPOLOGY_TYPE=mesh NODE_COUNT=10 # Mesh topology"
@echo " make run-sim TOPOLOGY_TYPE=tree NODE_COUNT=31 BRANCHING=2 # Tree topology"
@echo " make run-sim TOPOLOGY_TYPE=random-regular PEER_COUNT=6 # Random-regular with 6 peers"
@echo " make run-sim PROGRESS=true # Run with progress bar"
@echo " make run-sim BATCH_INTERVAL=2 BATCH_VERIFIER_TIME=2000 # Custom batch parameters"
@echo " make test # Test existing simulation results"
@echo " make plot NODE_COUNT=10 # Plot message propagation"
Loading