Within the peer package, createChain sets up a number of config bundle listeners. One of these supports gossip.
The current implementation for gossip involves a gossipSupport struct in the peer that embeds channelconfig.Application, configtx.Validator, and channelconfig.Channel.
This is rendered as a Config interface:
In addition to employing the "support" anti-pattern, it violates the tell-don't-ask principle as the object presented to gossip is used to repeatedly get the information from the config bundle.
This needs to be refactored to create a single-responsibility object that acts as an adapter between gossip and the BundleActor. This object should be created with the necessary dependencies and attach a method that satisfies the channelconfig.BundleActor interface. When the BundleActor callback is driven, the adapter should create a value object that contains the necessary data for gossip and calls the gossip handler with the value object.
This approach tells gossip the information it needs, allows the adapter layer to be explicitly tested, and it removes the gossipSupport struct from the peer.