Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

feat: benchmark logs#80

Merged
richard-ramos merged 2 commits intomainfrom
mixrunner
Sep 8, 2025
Merged

feat: benchmark logs#80
richard-ramos merged 2 commits intomainfrom
mixrunner

Conversation

@richard-ramos
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces "mixrunner", a comprehensive benchmarking and testing framework for the Mix protocol implementation. The framework enables performance measurement and testing of mix network operations through Docker-based deployments.

  • Adds conditional benchmarking instrumentation throughout the mix protocol to track message processing and timing
  • Implements a complete mixrunner example with node management, Docker containerization, and automated testing capabilities
  • Provides utility functions for node information serialization and multi-address management

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
mix/mix_protocol.nim Adds conditional benchmarking code with timing measurements and metadata tracking for mix message processing
mix/mix_node.nim Adds utility function to update mix node multi-addresses by index
mix.nim Exports the new multi-address initialization function
examples/mixrunner/node.nim Implements node information management with serialization/deserialization capabilities
examples/mixrunner/mixrunner.sh Provides Docker orchestration script for running multiple mix nodes
examples/mixrunner/main.nim Main application logic for mixrunner with libp2p integration and message handling
examples/mixrunner/cron_runner.sh Cron-based scheduling utility for automated test execution
README.md Updates documentation with new usage instructions and Docker build information
Dockerfile Multi-stage Docker build configuration for the mixrunner application
Comments suppressed due to low confidence (1)

examples/mixrunner/main.nim:1

  • The command contains a typo: 'sexamples' should be 'examples'.
import chronos, chronicles, results

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@AkshayaMani AkshayaMani left a comment

Choose a reason for hiding this comment

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

Thanks for adding the logging! :) I’ve just left a couple of minor suggestions around logging structure and clarity.
Marking it as Request Changes mainly to move the DST-related changes and files into a separate branch.

Dockerfile Outdated
@@ -0,0 +1,79 @@
# Build nim
Copy link
Collaborator

Choose a reason for hiding this comment

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

As discussed, we could move the DST-related changes to a separate dst-gossipsub-test-node branch for now, until we figure out if/how to split it into a separate library.
We can keep just the logging-related changes in mix_protocol.nim in the main-s2 branch for debugging.

trace "Exit node - Received mix message",
receiver = multiAddr, message = deserialized.message, codec = deserialized.codec

when defined(enable_mix_benchmarks):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Optional: If we plan to expand benchmark support or keep these logs around, it might be worth extracting the repeated logging logic in handleMixNodeConnection (e.g., startTime, endTime, procDelay, shared log fields) into a small helper.
This would complement the existing SendPacketConfig abstraction used in sendPacket and help reduce duplication across Exit, Reply, etc. paths.

when defined(enable_mix_benchmarks):
config.orig = uint64.fromBytesLE(msg[5 ..< 13])
config.msgid = uint64.fromBytesLE(msg[13 ..< 21])
config.origAndMsgId = msg[5 ..< 21]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor suggestion: IIRC, this assumes a fixed GossipSub message layout (message size = 100) as defined in tmp/mix-gossipsub-logging branch. Might be worth adding a short comment or defining constants just to make that assumption clearer.

@richard-ramos richard-ramos changed the base branch from no-more-globals to main September 5, 2025 18:08
@richard-ramos richard-ramos force-pushed the mixrunner branch 3 times, most recently from 23a65e1 to bbb15af Compare September 6, 2025 23:21
@richard-ramos richard-ramos changed the base branch from main to rm-exit-is-destination September 6, 2025 23:21
@richard-ramos richard-ramos changed the base branch from rm-exit-is-destination to main September 8, 2025 14:27
@richard-ramos richard-ramos changed the title feat: mixrunner feat: benchmark logs Sep 8, 2025
@richard-ramos richard-ramos merged commit bc0a9be into main Sep 8, 2025
35 of 65 checks passed
@richard-ramos richard-ramos deleted the mixrunner branch September 19, 2025 02:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants