Skip to content

Commit

Permalink
Merge "FAB-2486 remove sync from core.yaml"
Browse files Browse the repository at this point in the history
  • Loading branch information
C0rWin authored and Gerrit Code Review committed Apr 30, 2017
2 parents 8f7bfc3 + 7c908df commit 3a2a717
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 58 deletions.
31 changes: 0 additions & 31 deletions core/peer/config.go
Expand Up @@ -52,9 +52,6 @@ var peerEndpoint *pb.PeerEndpoint
var peerEndpointError error

// Cached values of commonly used configuration constants.
var syncStateSnapshotChannelSize int
var syncStateDeltasChannelSize int
var syncBlocksChannelSize int

// Note: There is some kind of circular import issue that prevents us from
// importing the "core" package into the "peer" package. The
Expand Down Expand Up @@ -97,10 +94,6 @@ func CacheConfiguration() (err error) {
localAddress, localAddressError = getLocalAddress()
peerEndpoint, peerEndpointError = getPeerEndpoint()

syncStateSnapshotChannelSize = viper.GetInt("peer.sync.state.snapshot.channelSize")
syncStateDeltasChannelSize = viper.GetInt("peer.sync.state.deltas.channelSize")
syncBlocksChannelSize = viper.GetInt("peer.sync.blocks.channelSize")

securityEnabled = true

configurationCached = true
Expand Down Expand Up @@ -138,30 +131,6 @@ func GetPeerEndpoint() (*pb.PeerEndpoint, error) {
return peerEndpoint, peerEndpointError
}

// SyncStateSnapshotChannelSize returns the peer.sync.state.snapshot.channelSize property
func SyncStateSnapshotChannelSize() int {
if !configurationCached {
cacheConfiguration()
}
return syncStateSnapshotChannelSize
}

// SyncStateDeltasChannelSize returns the peer.sync.state.deltas.channelSize property
func SyncStateDeltasChannelSize() int {
if !configurationCached {
cacheConfiguration()
}
return syncStateDeltasChannelSize
}

// SyncBlocksChannelSize returns the peer.sync.blocks.channelSize property
func SyncBlocksChannelSize() int {
if !configurationCached {
cacheConfiguration()
}
return syncBlocksChannelSize
}

// SecurityEnabled returns the securityEnabled property from cached configuration
func SecurityEnabled() bool {
if !configurationCached {
Expand Down
27 changes: 0 additions & 27 deletions sampleconfig/core.yaml
Expand Up @@ -146,33 +146,6 @@ peer:
# Time between peer sends propose message and declare itself as a leader (sends declaration message) (unit: second)
leaderElectionDuration: 5s

# Sync related configuration
sync:
blocks:
# Channel size for readonly SyncBlocks messages channel for receiving
# blocks from oppositie Peer Endpoints.
# NOTE: currently messages are not stored and forwarded, but rather
# lost if the channel write blocks.
channelSize: 10
state:
snapshot:
# Channel size for readonly syncStateSnapshot messages channel
# for receiving state deltas for snapshot from oppositie Peer Endpoints.
# NOTE: when the channel is exhausted, the writes block for up to the
# writeTimeout specified below
channelSize: 50
# Write timeout for the syncStateSnapshot messages
# When the channel above is exhausted, messages block before being
# discarded for this amount of time
writeTimeout: 60s
deltas:
# Channel size for readonly syncStateDeltas messages channel for
# receiving state deltas for a syncBlockRange from oppositie
# Peer Endpoints.
# NOTE: currently messages are not stored and forwarded,
# but rather lost if the channel write blocks.
channelSize: 20

# Validator defines whether this peer is a validating peer or not, and if
# it is enabled, what consensus plugin to load
events:
Expand Down

0 comments on commit 3a2a717

Please sign in to comment.