|
|
@ -19,7 +19,6 @@ import ( |
|
|
|
"github.com/tendermint/tendermint/internal/consensus" |
|
|
|
"github.com/tendermint/tendermint/internal/mempool" |
|
|
|
"github.com/tendermint/tendermint/internal/p2p" |
|
|
|
"github.com/tendermint/tendermint/internal/p2p/pex" |
|
|
|
"github.com/tendermint/tendermint/internal/proxy" |
|
|
|
rpccore "github.com/tendermint/tendermint/internal/rpc/core" |
|
|
|
sm "github.com/tendermint/tendermint/internal/state" |
|
|
@ -277,7 +276,7 @@ func makeNode(cfg *config.Config, |
|
|
|
makeCloser(closers)) |
|
|
|
} |
|
|
|
|
|
|
|
mpReactorShim, mpReactor, mp, err := createMempoolReactor( |
|
|
|
mpReactor, mp, err := createMempoolReactor( |
|
|
|
cfg, proxyApp, state, nodeMetrics.mempool, peerManager, router, logger, |
|
|
|
) |
|
|
|
if err != nil { |
|
|
@ -285,7 +284,7 @@ func makeNode(cfg *config.Config, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
evReactorShim, evReactor, evPool, err := createEvidenceReactor( |
|
|
|
evReactor, evPool, err := createEvidenceReactor( |
|
|
|
cfg, dbProvider, stateDB, blockStore, peerManager, router, logger, |
|
|
|
) |
|
|
|
if err != nil { |
|
|
@ -304,7 +303,7 @@ func makeNode(cfg *config.Config, |
|
|
|
sm.BlockExecutorWithMetrics(nodeMetrics.state), |
|
|
|
) |
|
|
|
|
|
|
|
csReactorShim, csReactor, csState := createConsensusReactor( |
|
|
|
csReactor, csState := createConsensusReactor( |
|
|
|
cfg, state, blockExec, blockStore, mp, evPool, |
|
|
|
privValidator, nodeMetrics.consensus, stateSync || blockSync, eventBus, |
|
|
|
peerManager, router, consensusLogger, |
|
|
@ -312,7 +311,7 @@ func makeNode(cfg *config.Config, |
|
|
|
|
|
|
|
// Create the blockchain reactor. Note, we do not start block sync if we're
|
|
|
|
// doing a state sync first.
|
|
|
|
bcReactorShim, bcReactor, err := createBlockchainReactor( |
|
|
|
bcReactor, err := createBlockchainReactor( |
|
|
|
logger, state, blockExec, blockStore, csReactor, |
|
|
|
peerManager, router, blockSync && !stateSync, nodeMetrics.consensus, |
|
|
|
) |
|
|
@ -335,7 +334,6 @@ func makeNode(cfg *config.Config, |
|
|
|
// we should clean this whole thing up. See:
|
|
|
|
// https://github.com/tendermint/tendermint/issues/4644
|
|
|
|
ssLogger := logger.With("module", "statesync") |
|
|
|
ssReactorShim := p2p.NewReactorShim(ssLogger, "StateSyncShim", statesync.ChannelShims) |
|
|
|
channels := makeChannelsFromShims(router, statesync.ChannelShims) |
|
|
|
|
|
|
|
peerUpdates := peerManager.Subscribe() |
|
|
@ -357,16 +355,6 @@ func makeNode(cfg *config.Config, |
|
|
|
nodeMetrics.statesync, |
|
|
|
) |
|
|
|
|
|
|
|
// add the channel descriptors to both the transports
|
|
|
|
// FIXME: This should be removed when the legacy p2p stack is removed and
|
|
|
|
// transports can either be agnostic to channel descriptors or can be
|
|
|
|
// declared in the constructor.
|
|
|
|
transport.AddChannelDescriptors(mpReactorShim.GetChannels()) |
|
|
|
transport.AddChannelDescriptors(bcReactorShim.GetChannels()) |
|
|
|
transport.AddChannelDescriptors(csReactorShim.GetChannels()) |
|
|
|
transport.AddChannelDescriptors(evReactorShim.GetChannels()) |
|
|
|
transport.AddChannelDescriptors(ssReactorShim.GetChannels()) |
|
|
|
|
|
|
|
// Optionally, start the pex reactor
|
|
|
|
//
|
|
|
|
// TODO:
|
|
|
@ -382,9 +370,6 @@ func makeNode(cfg *config.Config, |
|
|
|
|
|
|
|
var pexReactor service.Service |
|
|
|
|
|
|
|
pexCh := pex.ChannelDescriptor() |
|
|
|
transport.AddChannelDescriptors([]*p2p.ChannelDescriptor{&pexCh}) |
|
|
|
|
|
|
|
pexReactor, err = createPEXReactor(logger, peerManager, router) |
|
|
|
if err != nil { |
|
|
|
return nil, combineCloseError(err, makeCloser(closers)) |
|
|
@ -501,13 +486,6 @@ func makeSeedNode(cfg *config.Config, |
|
|
|
|
|
|
|
var pexReactor service.Service |
|
|
|
|
|
|
|
// add the pex reactor
|
|
|
|
// FIXME: we add channel descriptors to both the router and the transport but only the router
|
|
|
|
// should be aware of channel info. We should remove this from transport once the legacy
|
|
|
|
// p2p stack is removed.
|
|
|
|
pexCh := pex.ChannelDescriptor() |
|
|
|
transport.AddChannelDescriptors([]*p2p.ChannelDescriptor{&pexCh}) |
|
|
|
|
|
|
|
pexReactor, err = createPEXReactor(logger, peerManager, router) |
|
|
|
if err != nil { |
|
|
|
return nil, combineCloseError(err, closer) |
|
|
|