Skip to content

Gossipsub: test extension #686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: marco/gossipsub-extensions
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 37 additions & 0 deletions pubsub/gossipsub/extensions/experimental/test-extension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Test Extension

| Lifecycle Stage | Maturity | Status | Latest Revision |
| --------------- | ------------- | ------ | --------------- |
| 1A | Working Draft | Active | r0, 2025-06-23 |

Authors: [@marcopolo]

Interest Group: @jxs

[@marcopolo]: https://github.com/marcopolo
[@jxs]: https://github.com/jxs

See the [lifecycle document][lifecycle-spec] for context about the maturity level
and spec status.

[lifecycle-spec]: https://github.com/libp2p/specs/blob/master/00-framework-01-spec-lifecycle.md

## Overview

This introduces a minimal extension to Gossipsub. The only motivation is to
test the interoperability of Gossipsub Extensions Control Message across
implementations. One way for example, is to connect different implementations
together and assert that both peers send the TestExtension message.

## The Protocol

If both Peers support the Test Extension, each peer MUST send a TestExtension
Message.

## Protobuf

```protobuf
syntax = "proto2";

message TestExtension {}
```
3 changes: 3 additions & 0 deletions pubsub/gossipsub/gossipsub-v1.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ message ControlExtensions {

// Experimental extensions must use field numbers larger than 0x200000 to be
// encoded with at least 4 bytes

optional bool testExtension = 6492434;
}

message ControlMessage {
Expand All @@ -133,5 +135,6 @@ message RPC {
// Experimental Extensions should register their messages here. They
// must use field numbers larger than 0x200000 to be encoded with at least 4
// bytes
optional TestExtension testExtension = 6492434;
}
```