ceremonyclient/go-libp2p-blossomsub
Cassandra Heart 53f7c2b5c9
v2.1.0.2 (#442)
* v2.1.0.2

* restore tweaks to simlibp2p

* fix: nil ref on size calc

* fix: panic should induce shutdown from event_distributor

* fix: friendlier initialization that requires less manual kickstarting for test/devnets

* fix: fewer available shards than provers should choose shard length

* fix: update stored worker registry, improve logging for debug mode

* fix: shut the fuck up, peer log

* qol: log value should be snake cased

* fix:non-archive snap sync issues

* fix: separate X448/Decaf448 signed keys, add onion key to registry

* fix: overflow arithmetic on frame number comparison

* fix: worker registration should be idempotent if inputs are same, otherwise permit updated records

* fix: remove global prover state from size calculation

* fix: divide by zero case

* fix: eager prover

* fix: broadcast listener default

* qol: diagnostic data for peer authenticator

* fix: master/worker connectivity issue in sparse networks

tight coupling of peer and workers can sometimes interfere if mesh is sparse, so give workers a pseudoidentity but publish messages with the proper peer key

* fix: reorder steps of join creation

* fix: join verify frame source + ensure domain is properly padded (unnecessary but good for consistency)

* fix: add delegate to protobuf <-> reified join conversion

* fix: preempt prover from planning with no workers

* fix: use the unallocated workers to generate a proof

* qol: underflow causes join fail in first ten frames on test/devnets

* qol: small logging tweaks for easier log correlation in debug mode

* qol: use fisher-yates shuffle to ensure prover allocations are evenly distributed when scores are equal

* qol: separate decisional logic on post-enrollment confirmation into consensus engine, proposer, and worker manager where relevant, refactor out scoring

* reuse shard descriptors for both join planning and confirm/reject decisions

* fix: add missing interface method and amend test blossomsub to use new peer id basis

* fix: only check allocations if they exist

* fix: pomw mint proof data needs to be hierarchically under global intrinsic domain

* staging temporary state under diagnostics

* fix: first phase of distributed lock refactoring

* fix: compute intrinsic locking

* fix: hypergraph intrinsic locking

* fix: token intrinsic locking

* fix: update execution engines to support new locking model

* fix: adjust tests with new execution shape

* fix: weave in lock/unlock semantics to liveness provider

* fix lock fallthrough, add missing allocation update

* qol: additional logging for diagnostics, also testnet/devnet handling for confirmations

* fix: establish grace period on halt scenario to permit recovery

* fix: support test/devnet defaults for coverage scenarios

* fix: nil ref on consensus halts for non-archive nodes

* fix: remove unnecessary prefix from prover ref

* add test coverage for fork choice behaviors and replay – once passing, blocker (2) is resolved

* fix: no fork replay on repeat for non-archive nodes, snap now behaves correctly

* rollup of pre-liveness check lock interactions

* ahead of tests, get the protobuf/metrics-related changes out so teams can prepare

* add test coverage for distributed lock behaviors – once passing, blocker (3) is resolved

* fix: blocker (3)

* Dev docs improvements (#445)

* Make install deps script more robust

* Improve testing instructions

* Worker node should stop upon OS SIGINT/SIGTERM signal (#447)

* move pebble close to Stop()

* move deferred Stop() to Start()

* add core id to worker stop log message

* create done os signal channel and stop worker upon message to it

---------

Co-authored-by: Cassandra Heart <7929478+CassOnMars@users.noreply.github.com>

---------

Co-authored-by: Daz <daz_the_corgi@proton.me>
Co-authored-by: Black Swan <3999712+blacks1ne@users.noreply.github.com>
2025-10-23 01:03:06 -05:00
..
pb IDONTWANT Support (#376) 2024-11-23 17:15:41 -06:00
timecache detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
.gitignore Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
backoff_test.go v2.1.0 (#439) 2025-09-30 02:48:15 -05:00
backoff.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
bitmask_test.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
bitmask.go v2.1.0 (#439) 2025-09-30 02:48:15 -05:00
blacklist_test.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
blacklist.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
blossomsub_connmgr_test.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
blossomsub_feat_test.go IDONTWANT Support (#376) 2024-11-23 17:15:41 -06:00
blossomsub_feat.go IDONTWANT Support (#376) 2024-11-23 17:15:41 -06:00
blossomsub_matchfn_test.go extend test to verify mainnet bug is fixed 2024-11-22 19:36:48 -06:00
blossomsub_spam_test.go IDONTWANT Support (#376) 2024-11-23 17:15:41 -06:00
blossomsub_test.go v2.1.0 (#439) 2025-09-30 02:48:15 -05:00
blossomsub.go v2.1.0 (#439) 2025-09-30 02:48:15 -05:00
comm.go Avoid pooling large buffers (#399) 2024-12-02 17:07:58 -06:00
discovery_test.go v2.1.0.2 (#442) 2025-10-23 01:03:06 -05:00
discovery.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
go.mod v2.1.0 (#439) 2025-09-30 02:48:15 -05:00
go.sum v2.1.0 (#439) 2025-09-30 02:48:15 -05:00
gossip_tracer_test.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
gossip_tracer.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
LICENSE Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
LICENSE-APACHE Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
LICENSE-MIT Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
mcache_test.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
mcache.go Fix gossip (#378) 2024-11-22 10:30:33 -06:00
midgen.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
peer_gater_test.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
peer_gater.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
peer_notify.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
pubsub_test.go IDONTWANT Support (#376) 2024-11-23 17:15:41 -06:00
pubsub.go v2.1.0.1 (#441) 2025-09-30 15:42:34 -05:00
README.md detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
rpc_queue_test.go IDONTWANT Support (#376) 2024-11-23 17:15:41 -06:00
rpc_queue.go IDONTWANT Support (#376) 2024-11-23 17:15:41 -06:00
score_params_test.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
score_params.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
score_test.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
score.go remaining blossomsub fixes 2024-11-23 19:23:44 -06:00
sign_test.go v2.1.0 (#439) 2025-09-30 02:48:15 -05:00
sign.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
subscription_filter_test.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
subscription_filter.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
subscription.go Add ceremony-targeted go-libp2p-blossomsub 2023-07-07 01:07:10 -05:00
tag_tracer_test.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
tag_tracer.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
trace_test.go v2.1.0 (#439) 2025-09-30 02:48:15 -05:00
trace.go IDONTWANT Support (#376) 2024-11-23 17:15:41 -06:00
tracer.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
validation_builtin_test.go v2.1.0 (#439) 2025-09-30 02:48:15 -05:00
validation_builtin.go detangling merge of main node for v2 (#293) 2024-10-12 11:55:17 -07:00
validation_test.go extend test to verify mainnet bug is fixed 2024-11-22 19:36:48 -06:00
validation.go Add additional P2P configuration (#352) 2024-11-16 17:54:34 -06:00

go-libp2p-blossomsub

This repo contains the canonical blossomsub implementation for Quilibrium. It has historical origins in Gossipsub, but has diverged significantly. Floodsub and Randomsub are not included in this fork.

Table of Contents

Install

go get source.quilibrium.com/quilibrium/monorepo/go-libp2p-pubsub

Usage

To be used for messaging in high scale, high throughput p2p instrastructure such as Quilibrium.

Overview

.
├── LICENSE
├── README.md
# Regular Golang repo set up
├── codecov.yml
├── pb
├── go.mod
├── go.sum
├── doc.go
# PubSub base
├── backoff.go
├── bitmask.go
├── blacklist.go
├── comm.go
├── discovery.go
├── gossip_tracer.go
├── midgen.go
├── peer_gater.go
├── peer_notify.go
├── pubsub.go
├── sign.go
├── subscription.go
├── tag_tracer.go
├── trace.go
├── tracer.go
├── validation.go
# Blossomsub router
├── blossomsub_feat.go
├── blossomsub.go
├── mcache.go
├── score.go
└── score_params.go

Tracing

The pubsub system supports tracing, which collects all events pertaining to the internals of the system. This allows you to recreate the complete message flow and state of the system for analysis purposes.

To enable tracing, instantiate the pubsub system using the WithEventTracer option; the option accepts a tracer with three available implementations in-package (trace to json, pb, or a remote peer). If you want to trace using a remote peer in the same way gossipsub tracing worked, you would need to do so by forking the traced daemon from go-libp2p-pubsub-tracer.

For instance, to capture the trace as a json file, you can use the following option:

tracer, err := pubsub.NewJSONTracer("/path/to/trace.json")
if err != nil {
  panic(err)
}

pubsub.NewBlossomSub(..., pubsub.WithEventTracer(tracer))

To capture the trace as a protobuf, you can use the following option:

tracer, err := pubsub.NewPBTracer("/path/to/trace.pb")
if err != nil {
  panic(err)
}

pubsub.NewBlossomSub(..., pubsub.WithEventTracer(tracer))

Finally, to use the remote tracer, you can use the following incantations:

// assuming that your tracer runs in x.x.x.x and has a peer ID of QmTracer
pi, err := peer.AddrInfoFromP2pAddr(ma.StringCast("/ip4/x.x.x.x/tcp/4001/p2p/QmTracer"))
if err != nil {
  panic(err)
}

tracer, err := pubsub.NewRemoteTracer(ctx, host, pi)
if err != nil {
  panic(err)
}

ps, err := pubsub.NewBlossomSub(..., pubsub.WithEventTracer(tracer))

Contribute

Contributions welcome. Please check out the issues.

Quilibrium does not have a code of conduct for contributions  contributions are accepted on merit and benefit to the protocol.

License

The go-libp2p-blossomsub project being forked from go-libp2p-pubsub inherits the dual-license under Apache 2.0 and MIT terms: