Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph committed Mar 6, 2024
2 parents e806c97 + 639b9ca commit 812b0c7
Show file tree
Hide file tree
Showing 58 changed files with 179 additions and 1,071 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-linux-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- "*"

env:
go_version: '~1.21.7'
go_version: '~1.21.8'

jobs:
build-x86_64-binaries-tarball:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-macos-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '~1.21.7'
go-version: '~1.21.8'
check-latest: true
- run: go version

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-public-ami.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '~1.21.7'
go-version: '~1.21.8'
check-latest: true
- run: go version

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ubuntu-amd64-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- "*"

env:
go_version: '~1.21.7'
go_version: '~1.21.8'

jobs:
build-jammy-amd64-package:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ubuntu-arm64-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- "*"

env:
go_version: '~1.21.7'
go_version: '~1.21.8'

jobs:
build-jammy-arm64-package:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-win-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: '~1.21.7'
go-version: '~1.21.8'
check-latest: true

- run: go version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ concurrency:
cancel-in-progress: true

env:
go_version: '~1.21.7'
go_version: '~1.21.8'
tmpnet_data_path: ~/.tmpnet/networks/1000

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: '~1.21.7'
go-version: '~1.21.8'
check-latest: true

# Initializes the CodeQL tools for scanning.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '~1.21.7'
go-version: '~1.21.8'
check-latest: true
- name: Run fuzz tests
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fuzz_merkledb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '~1.21.7'
go-version: '~1.21.8'
check-latest: true
- name: Run merkledb fuzz tests
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

To start developing on AvalancheGo, you'll need a few things installed.

- Golang version >= 1.21.7
- Golang version >= 1.21.8
- gcc
- g++

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# README.md
# go.mod
# ============= Compilation Stage ================
FROM golang:1.21.7-bullseye AS builder
FROM golang:1.21.8-bullseye AS builder

WORKDIR /build
# Copy and download avalanche dependencies using go mod
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The minimum recommended hardware specification for nodes connected to Mainnet is

If you plan to build AvalancheGo from source, you will also need the following software:

- [Go](https://golang.org/doc/install) version >= 1.21.7
- [Go](https://golang.org/doc/install) version >= 1.21.8
- [gcc](https://gcc.gnu.org/)
- g++

Expand Down
40 changes: 6 additions & 34 deletions chains/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -607,16 +607,6 @@ func (m *manager) createAvalancheChain(
avalancheMessageSender = sender.Trace(avalancheMessageSender, m.Tracer)
}

err = m.VertexAcceptorGroup.RegisterAcceptor(
ctx.ChainID,
"gossip",
avalancheMessageSender,
false,
)
if err != nil { // Set up the event dispatcher
return nil, fmt.Errorf("problem initializing event dispatcher: %w", err)
}

// Passes messages from the snowman engines to the network
snowmanMessageSender, err := sender.New(
ctx,
Expand All @@ -635,16 +625,6 @@ func (m *manager) createAvalancheChain(
snowmanMessageSender = sender.Trace(snowmanMessageSender, m.Tracer)
}

err = m.BlockAcceptorGroup.RegisterAcceptor(
ctx.ChainID,
"gossip",
snowmanMessageSender,
false,
)
if err != nil { // Set up the event dispatcher
return nil, fmt.Errorf("problem initializing event dispatcher: %w", err)
}

chainConfig, err := m.getChainConfig(ctx.ChainID)
if err != nil {
return nil, fmt.Errorf("error while fetching chain config: %w", err)
Expand Down Expand Up @@ -841,13 +821,14 @@ func (m *manager) createAvalancheChain(
Params: consensusParams,
Consensus: snowmanConsensus,
}
snowmanEngine, err := smeng.New(snowmanEngineConfig)
var snowmanEngine common.Engine
snowmanEngine, err = smeng.New(snowmanEngineConfig)
if err != nil {
return nil, fmt.Errorf("error initializing snowman engine: %w", err)
}

if m.TracingEnabled {
snowmanEngine = smeng.TraceEngine(snowmanEngine, m.Tracer)
snowmanEngine = common.TraceEngine(snowmanEngine, m.Tracer)
}

// create bootstrap gear
Expand Down Expand Up @@ -999,16 +980,6 @@ func (m *manager) createSnowmanChain(
messageSender = sender.Trace(messageSender, m.Tracer)
}

err = m.BlockAcceptorGroup.RegisterAcceptor(
ctx.ChainID,
"gossip",
messageSender,
false,
)
if err != nil { // Set up the event dispatcher
return nil, fmt.Errorf("problem initializing event dispatcher: %w", err)
}

var (
bootstrapFunc func()
subnetConnector = validators.UnhandledSubnetConnector
Expand Down Expand Up @@ -1188,13 +1159,14 @@ func (m *manager) createSnowmanChain(
Consensus: consensus,
PartialSync: m.PartialSyncPrimaryNetwork && ctx.ChainID == constants.PlatformChainID,
}
engine, err := smeng.New(engineConfig)
var engine common.Engine
engine, err = smeng.New(engineConfig)
if err != nil {
return nil, fmt.Errorf("error initializing snowman engine: %w", err)
}

if m.TracingEnabled {
engine = smeng.TraceEngine(engine, m.Tracer)
engine = common.TraceEngine(engine, m.Tracer)
}

// create bootstrap gear
Expand Down
8 changes: 2 additions & 6 deletions chains/subnets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,12 @@ func TestSubnetConfigs(t *testing.T) {
config: map[ids.ID]subnets.Config{
constants.PrimaryNetworkID: {},
testSubnetID: {
GossipConfig: subnets.GossipConfig{
AcceptedFrontierValidatorSize: 123456789,
},
ValidatorOnly: true,
},
},
subnetID: testSubnetID,
want: subnets.Config{
GossipConfig: subnets.GossipConfig{
AcceptedFrontierValidatorSize: 123456789,
},
ValidatorOnly: true,
},
},
}
Expand Down
40 changes: 4 additions & 36 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ const (
chainUpgradeFileName = "upgrade"
subnetConfigFileExt = ".json"

keystoreDeprecationMsg = "keystore API is deprecated"
acceptedFrontierGossipDeprecationMsg = "push-based accepted frontier gossip is deprecated"
peerListPushGossipDeprecationMsg = "push-based peer list gossip is deprecated"
keystoreDeprecationMsg = "keystore API is deprecated"
)

var (
Expand All @@ -65,18 +63,6 @@ var (
deprecatedKeys = map[string]string{
KeystoreAPIEnabledKey: keystoreDeprecationMsg,

ConsensusGossipAcceptedFrontierValidatorSizeKey: acceptedFrontierGossipDeprecationMsg,
ConsensusGossipAcceptedFrontierNonValidatorSizeKey: acceptedFrontierGossipDeprecationMsg,
ConsensusGossipAcceptedFrontierPeerSizeKey: acceptedFrontierGossipDeprecationMsg,
ConsensusGossipOnAcceptValidatorSizeKey: acceptedFrontierGossipDeprecationMsg,
ConsensusGossipOnAcceptNonValidatorSizeKey: acceptedFrontierGossipDeprecationMsg,
ConsensusGossipOnAcceptPeerSizeKey: acceptedFrontierGossipDeprecationMsg,

NetworkPeerListValidatorGossipSizeKey: peerListPushGossipDeprecationMsg,
NetworkPeerListNonValidatorGossipSizeKey: peerListPushGossipDeprecationMsg,
NetworkPeerListPeersGossipSizeKey: peerListPushGossipDeprecationMsg,
NetworkPeerListGossipFreqKey: peerListPushGossipDeprecationMsg,

SnowRogueCommitThresholdKey: commitThresholdDeprecationMsg,
SnowVirtuousCommitThresholdKey: commitThresholdDeprecationMsg,
}
Expand Down Expand Up @@ -263,17 +249,6 @@ func getAdaptiveTimeoutConfig(v *viper.Viper) (timer.AdaptiveTimeoutConfig, erro
return config, nil
}

func getGossipConfig(v *viper.Viper) subnets.GossipConfig {
return subnets.GossipConfig{
AcceptedFrontierValidatorSize: uint(v.GetUint32(ConsensusGossipAcceptedFrontierValidatorSizeKey)),
AcceptedFrontierNonValidatorSize: uint(v.GetUint32(ConsensusGossipAcceptedFrontierNonValidatorSizeKey)),
AcceptedFrontierPeerSize: uint(v.GetUint32(ConsensusGossipAcceptedFrontierPeerSizeKey)),
OnAcceptValidatorSize: uint(v.GetUint32(ConsensusGossipOnAcceptValidatorSizeKey)),
OnAcceptNonValidatorSize: uint(v.GetUint32(ConsensusGossipOnAcceptNonValidatorSizeKey)),
OnAcceptPeerSize: uint(v.GetUint32(ConsensusGossipOnAcceptPeerSizeKey)),
}
}

func getNetworkConfig(
v *viper.Viper,
networkID uint32,
Expand Down Expand Up @@ -386,13 +361,9 @@ func getNetworkConfig(
},

PeerListGossipConfig: network.PeerListGossipConfig{
PeerListNumValidatorIPs: v.GetUint32(NetworkPeerListNumValidatorIPsKey),
PeerListValidatorGossipSize: v.GetUint32(NetworkPeerListValidatorGossipSizeKey),
PeerListNonValidatorGossipSize: v.GetUint32(NetworkPeerListNonValidatorGossipSizeKey),
PeerListPeersGossipSize: v.GetUint32(NetworkPeerListPeersGossipSizeKey),
PeerListGossipFreq: v.GetDuration(NetworkPeerListGossipFreqKey),
PeerListPullGossipFreq: v.GetDuration(NetworkPeerListPullGossipFreqKey),
PeerListBloomResetFreq: v.GetDuration(NetworkPeerListBloomResetFreqKey),
PeerListNumValidatorIPs: v.GetUint32(NetworkPeerListNumValidatorIPsKey),
PeerListPullGossipFreq: v.GetDuration(NetworkPeerListPullGossipFreqKey),
PeerListBloomResetFreq: v.GetDuration(NetworkPeerListBloomResetFreqKey),
},

DelayConfig: network.DelayConfig{
Expand Down Expand Up @@ -426,8 +397,6 @@ func getNetworkConfig(
return network.Config{}, fmt.Errorf("%s must be in [0,1]", NetworkHealthMaxPortionSendQueueFillKey)
case config.DialerConfig.ConnectionTimeout < 0:
return network.Config{}, fmt.Errorf("%q must be >= 0", NetworkOutboundConnectionTimeoutKey)
case config.PeerListGossipFreq < 0:
return network.Config{}, fmt.Errorf("%s must be >= 0", NetworkPeerListGossipFreqKey)
case config.PeerListPullGossipFreq < 0:
return network.Config{}, fmt.Errorf("%s must be >= 0", NetworkPeerListPullGossipFreqKey)
case config.PeerListBloomResetFreq < 0:
Expand Down Expand Up @@ -1124,7 +1093,6 @@ func getDefaultSubnetConfig(v *viper.Viper) subnets.Config {
return subnets.Config{
ConsensusParameters: getConsensusConfig(v),
ValidatorOnly: false,
GossipConfig: getGossipConfig(v),
ProposerMinBlockDelay: proposervm.DefaultMinBlockDelay,
ProposerNumHistoricalBlocks: proposervm.DefaultNumHistoricalBlocks,
}
Expand Down
16 changes: 0 additions & 16 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/snow/consensus/snowball"
"github.com/ava-labs/avalanchego/subnets"
"github.com/ava-labs/avalanchego/utils/constants"
)

func TestGetChainConfigsFromFiles(t *testing.T) {
Expand Down Expand Up @@ -420,20 +419,6 @@ func TestGetSubnetConfigsFromFile(t *testing.T) {
},
expectedErr: nil,
},
"gossip config": {
fileName: "2Ctt6eGAeo4MLqTmGa7AdRecuVMPGWEX9wSsCLBYrLhX4a394i.json",
givenJSON: `{"gossipOnAcceptValidatorSize": 100 }`,
testF: func(require *require.Assertions, given map[ids.ID]subnets.Config) {
id, _ := ids.FromString("2Ctt6eGAeo4MLqTmGa7AdRecuVMPGWEX9wSsCLBYrLhX4a394i")
config, ok := given[id]
require.True(ok)
require.Equal(uint(100), config.GossipConfig.OnAcceptValidatorSize)
// must still respect defaults
require.Equal(20, config.ConsensusParameters.K)
require.Equal(uint(constants.DefaultConsensusGossipOnAcceptPeerSize), config.GossipConfig.OnAcceptPeerSize)
},
expectedErr: nil,
},
}

for name, test := range tests {
Expand Down Expand Up @@ -528,7 +513,6 @@ func TestGetSubnetConfigsFromFlags(t *testing.T) {
require.Equal(20, config.ConsensusParameters.AlphaConfidence)
require.Equal(30, config.ConsensusParameters.K)
// must still respect defaults
require.Equal(uint(constants.DefaultConsensusGossipAcceptedFrontierPeerSize), config.GossipConfig.AcceptedFrontierPeerSize)
require.Equal(256, config.ConsensusParameters.MaxOutstandingItems)
},
expectedErr: nil,
Expand Down
10 changes: 0 additions & 10 deletions config/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ func addNodeFlags(fs *pflag.FlagSet) {

// Peer List Gossip
fs.Uint(NetworkPeerListNumValidatorIPsKey, constants.DefaultNetworkPeerListNumValidatorIPs, "Number of validator IPs to gossip to other nodes")
fs.Uint(NetworkPeerListValidatorGossipSizeKey, constants.DefaultNetworkPeerListValidatorGossipSize, "Number of validators that the node will gossip peer list to")
fs.Uint(NetworkPeerListNonValidatorGossipSizeKey, constants.DefaultNetworkPeerListNonValidatorGossipSize, "Number of non-validators that the node will gossip peer list to")
fs.Uint(NetworkPeerListPeersGossipSizeKey, constants.DefaultNetworkPeerListPeersGossipSize, "Number of total peers (including non-validators and validators) that the node will gossip peer list to")
fs.Duration(NetworkPeerListGossipFreqKey, constants.DefaultNetworkPeerListGossipFreq, "Frequency to gossip peers to other nodes")
fs.Duration(NetworkPeerListPullGossipFreqKey, constants.DefaultNetworkPeerListPullGossipFreq, "Frequency to request peers from other nodes")
fs.Duration(NetworkPeerListBloomResetFreqKey, constants.DefaultNetworkPeerListBloomResetFreq, "Frequency to recalculate the bloom filter used to request new peers from other nodes")

Expand Down Expand Up @@ -187,12 +183,6 @@ func addNodeFlags(fs *pflag.FlagSet) {
fs.Uint(ConsensusAppConcurrencyKey, constants.DefaultConsensusAppConcurrency, "Maximum number of goroutines to use when handling App messages on a chain")
fs.Duration(ConsensusShutdownTimeoutKey, constants.DefaultConsensusShutdownTimeout, "Timeout before killing an unresponsive chain")
fs.Duration(ConsensusFrontierPollFrequencyKey, constants.DefaultFrontierPollFrequency, "Frequency of polling for new consensus frontiers")
fs.Uint(ConsensusGossipAcceptedFrontierValidatorSizeKey, constants.DefaultConsensusGossipAcceptedFrontierValidatorSize, "Number of validators to gossip to when gossiping accepted frontier")
fs.Uint(ConsensusGossipAcceptedFrontierNonValidatorSizeKey, constants.DefaultConsensusGossipAcceptedFrontierNonValidatorSize, "Number of non-validators to gossip to when gossiping accepted frontier")
fs.Uint(ConsensusGossipAcceptedFrontierPeerSizeKey, constants.DefaultConsensusGossipAcceptedFrontierPeerSize, "Number of peers to gossip to when gossiping accepted frontier")
fs.Uint(ConsensusGossipOnAcceptValidatorSizeKey, constants.DefaultConsensusGossipOnAcceptValidatorSize, "Number of validators to gossip to each accepted container to")
fs.Uint(ConsensusGossipOnAcceptNonValidatorSizeKey, constants.DefaultConsensusGossipOnAcceptNonValidatorSize, "Number of non-validators to gossip to each accepted container to")
fs.Uint(ConsensusGossipOnAcceptPeerSizeKey, constants.DefaultConsensusGossipOnAcceptPeerSize, "Number of peers to gossip to each accepted container to")

// Inbound Throttling
fs.Uint64(InboundThrottlerAtLargeAllocSizeKey, constants.DefaultInboundThrottlerAtLargeAllocSize, "Size, in bytes, of at-large byte allocation in inbound message throttler")
Expand Down
10 changes: 0 additions & 10 deletions config/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ const (
NetworkHealthMaxSendFailRateKey = "network-health-max-send-fail-rate"
NetworkHealthMaxOutstandingDurationKey = "network-health-max-outstanding-request-duration"
NetworkPeerListNumValidatorIPsKey = "network-peer-list-num-validator-ips"
NetworkPeerListValidatorGossipSizeKey = "network-peer-list-validator-gossip-size"
NetworkPeerListNonValidatorGossipSizeKey = "network-peer-list-non-validator-gossip-size"
NetworkPeerListPeersGossipSizeKey = "network-peer-list-peers-gossip-size"
NetworkPeerListGossipFreqKey = "network-peer-list-gossip-frequency"
NetworkPeerListPullGossipFreqKey = "network-peer-list-pull-gossip-frequency"
NetworkPeerListBloomResetFreqKey = "network-peer-list-bloom-reset-frequency"
NetworkInitialReconnectDelayKey = "network-initial-reconnect-delay"
Expand Down Expand Up @@ -145,12 +141,6 @@ const (
ConsensusAppConcurrencyKey = "consensus-app-concurrency"
ConsensusShutdownTimeoutKey = "consensus-shutdown-timeout"
ConsensusFrontierPollFrequencyKey = "consensus-frontier-poll-frequency"
ConsensusGossipAcceptedFrontierValidatorSizeKey = "consensus-accepted-frontier-gossip-validator-size"
ConsensusGossipAcceptedFrontierNonValidatorSizeKey = "consensus-accepted-frontier-gossip-non-validator-size"
ConsensusGossipAcceptedFrontierPeerSizeKey = "consensus-accepted-frontier-gossip-peer-size"
ConsensusGossipOnAcceptValidatorSizeKey = "consensus-on-accept-gossip-validator-size"
ConsensusGossipOnAcceptNonValidatorSizeKey = "consensus-on-accept-gossip-non-validator-size"
ConsensusGossipOnAcceptPeerSizeKey = "consensus-on-accept-gossip-peer-size"
ProposerVMUseCurrentHeightKey = "proposervm-use-current-height"
FdLimitKey = "fd-limit"
IndexEnabledKey = "index-enabled"
Expand Down
Loading

0 comments on commit 812b0c7

Please sign in to comment.