Skip to content

Commit

Permalink
Merge branch 'master' into tmpnet-single-node
Browse files Browse the repository at this point in the history
  • Loading branch information
maru-ava authored May 13, 2024
2 parents d5adbac + 4ac6138 commit 1efe8e1
Show file tree
Hide file tree
Showing 55 changed files with 1,305 additions and 1,231 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,16 @@ jobs:
- name: Check image build
shell: bash
run: bash -x scripts/tests.build_image.sh
test_build_antithesis_avalanchego_image:
name: Antithesis avalanchego build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check image build for avalanchego test setup
shell: bash
run: bash -x scripts/tests.build_antithesis_images.sh
env:
TEST_SETUP: avalanchego
govulncheck:
runs-on: ubuntu-latest
name: govulncheck
Expand Down
40 changes: 5 additions & 35 deletions .github/workflows/publish_antithesis_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ on:
env:
REGISTRY: us-central1-docker.pkg.dev
REPOSITORY: molten-verve-216720/avalanche-repository
NODE_NAME: avalanche-node
WORKLOAD_NAME: workload
CONFIG_NAME: config
TAG: latest

jobs:
antithesis:
Expand All @@ -29,35 +25,9 @@ jobs:
username: _json_key
password: ${{ secrets.ANTITHESIS_GAR_JSON_KEY }}

- name: Set the Go version in the environment
# Need an exact version vs the range (~x.x.x) provided by set-go-version-in-env action
run: echo GO_VERSION="$(go list -m -f '{{.GoVersion}}')" >> $GITHUB_ENV
shell: bash

- name: Build node
id: build-node-image
run: |
docker build --build-arg GO_VERSION=${GO_VERSION} -t $REGISTRY/$REPOSITORY/$NODE_NAME:$TAG -f ./tests/antithesis/Dockerfile.node .
echo "name=image::$REGISTRY/$REPOSITORY/$NODE_NAME:$TAG" >> $GITHUB_OUTPUT
env:
GO_VERSION: '${{ env.GO_VERSION }}'

- name: Build workload
id: build-workload-image
run: |
docker build --build-arg GO_VERSION=${GO_VERSION} -t $REGISTRY/$REPOSITORY/$WORKLOAD_NAME:$TAG -f ./tests/antithesis/Dockerfile.workload .
echo "name=image::$REGISTRY/$REPOSITORY/$WORKLOAD_NAME:$TAG" >> $GITHUB_OUTPUT
- name: Build and push images for avalanchego test setup
run: bash -x ./scripts/build_antithesis_images.sh
env:
GO_VERSION: '${{ env.GO_VERSION }}'

- name: Build config
id: build-config-image
run: |
docker build -t $REGISTRY/$REPOSITORY/$CONFIG_NAME:$TAG -f ./tests/antithesis/Dockerfile.config .
echo "name=image::$REGISTRY/$REPOSITORY/$CONFIG_NAME:$TAG" >> $GITHUB_OUTPUT
- name: Publish images
run: |
docker push ${REGISTRY}/${REPOSITORY}/${NODE_NAME}:${TAG}
docker push ${REGISTRY}/${REPOSITORY}/${WORKLOAD_NAME}:${TAG}
docker push ${REGISTRY}/${REPOSITORY}/${CONFIG_NAME}:${TAG}
IMAGE_PREFIX: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}
TAG: latest
TEST_SETUP: avalanchego
10 changes: 5 additions & 5 deletions cache/metercacher/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ var (

type metrics struct {
getCount *prometheus.CounterVec
getTime *prometheus.CounterVec
getTime *prometheus.GaugeVec

putCount prometheus.Counter
putTime prometheus.Counter
putTime prometheus.Gauge

len prometheus.Gauge
portionFilled prometheus.Gauge
Expand All @@ -49,8 +49,8 @@ func newMetrics(
},
resultLabels,
),
getTime: prometheus.NewCounterVec(
prometheus.CounterOpts{
getTime: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: namespace,
Name: "get_time",
Help: "time spent (ns) in get calls",
Expand All @@ -62,7 +62,7 @@ func newMetrics(
Name: "put_count",
Help: "number of put calls",
}),
putTime: prometheus.NewCounter(prometheus.CounterOpts{
putTime: prometheus.NewGauge(prometheus.GaugeOpts{
Namespace: namespace,
Name: "put_time",
Help: "time spent (ns) in put calls",
Expand Down
8 changes: 6 additions & 2 deletions config/viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import (
"github.com/spf13/viper"
)

const EnvPrefix = "avago"

var DashesToUnderscores = strings.NewReplacer("-", "_")

// BuildViper returns the viper environment from parsing config file from
// default search paths and any parsed command line flags
func BuildViper(fs *pflag.FlagSet, args []string) (*viper.Viper, error) {
Expand All @@ -27,8 +31,8 @@ func BuildViper(fs *pflag.FlagSet, args []string) (*viper.Viper, error) {

v := viper.New()
v.AutomaticEnv()
v.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
v.SetEnvPrefix("avago")
v.SetEnvKeyReplacer(DashesToUnderscores)
v.SetEnvPrefix(EnvPrefix)
if err := v.BindPFlags(fs); err != nil {
return nil, err
}
Expand Down
10 changes: 5 additions & 5 deletions database/leveldb/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type metrics struct {
writesDelayedCount prometheus.Counter
// total amount of time (in ns) that writes that have been delayed due to
// compaction
writesDelayedDuration prometheus.Counter
writesDelayedDuration prometheus.Gauge
// set to 1 if there is currently at least one write that is being delayed
// due to compaction
writeIsDelayed prometheus.Gauge
Expand All @@ -44,7 +44,7 @@ type metrics struct {
// size of each level
levelSize *prometheus.GaugeVec
// amount of time spent compacting each level
levelDuration *prometheus.CounterVec
levelDuration *prometheus.GaugeVec
// amount of bytes read while compacting each level
levelReads *prometheus.CounterVec
// amount of bytes written while compacting each level
Expand All @@ -69,7 +69,7 @@ func newMetrics(namespace string, reg prometheus.Registerer) (metrics, error) {
Name: "writes_delayed",
Help: "number of cumulative writes that have been delayed due to compaction",
}),
writesDelayedDuration: prometheus.NewCounter(prometheus.CounterOpts{
writesDelayedDuration: prometheus.NewGauge(prometheus.GaugeOpts{
Namespace: namespace,
Name: "writes_delayed_duration",
Help: "amount of time (in ns) that writes have been delayed due to compaction",
Expand Down Expand Up @@ -129,8 +129,8 @@ func newMetrics(namespace string, reg prometheus.Registerer) (metrics, error) {
},
levelLabels,
),
levelDuration: prometheus.NewCounterVec(
prometheus.CounterOpts{
levelDuration: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: namespace,
Name: "duration",
Help: "amount of time (in ns) spent in compaction by level",
Expand Down
6 changes: 3 additions & 3 deletions database/meterdb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ type Database struct {
db database.Database

calls *prometheus.CounterVec
duration *prometheus.CounterVec
duration *prometheus.GaugeVec
size *prometheus.CounterVec
}

Expand All @@ -112,8 +112,8 @@ func New(
},
methodLabels,
),
duration: prometheus.NewCounterVec(
prometheus.CounterOpts{
duration: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: namespace,
Name: "duration",
Help: "time spent in database calls (ns)",
Expand Down
9 changes: 8 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require (
github.com/ava-labs/ledger-avalanche/go v0.0.0-20231102202641-ae2ebdaeac34
github.com/btcsuite/btcd/btcutil v1.1.3
github.com/cockroachdb/pebble v0.0.0-20230906160148-46873a6a7a06
github.com/compose-spec/compose-go v1.20.2
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0
github.com/ethereum/go-ethereum v1.13.2
github.com/google/btree v1.1.2
Expand Down Expand Up @@ -65,6 +66,7 @@ require (
google.golang.org/grpc v1.62.0
google.golang.org/protobuf v1.33.0
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/yaml.v3 v3.0.1
)

require (
Expand All @@ -85,7 +87,10 @@ require (
github.com/crate-crypto/go-kzg-4844 v0.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127 // indirect
github.com/ethereum/c-kzg-4844 v0.3.1 // indirect
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect
Expand Down Expand Up @@ -119,10 +124,12 @@ require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/mattn/go-shellwords v1.0.12 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/pointerstructure v1.2.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
Expand All @@ -132,6 +139,7 @@ require (
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sanity-io/litter v1.5.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/status-im/keycard-go v0.2.0 // indirect
Expand All @@ -153,6 +161,5 @@ require (
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
17 changes: 17 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ github.com/cockroachdb/pebble v0.0.0-20230906160148-46873a6a7a06/go.mod h1:bynZ3
github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ=
github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
github.com/compose-spec/compose-go v1.20.2 h1:u/yfZHn4EaHGdidrZycWpxXgFffjYULlTbRfJ51ykjQ=
github.com/compose-spec/compose-go v1.20.2/go.mod h1:+MdqXV4RA7wdFsahh/Kb8U0pAJqkg7mr4PM9tFKU8RM=
github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ=
github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI=
github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M=
Expand Down Expand Up @@ -154,9 +156,15 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2U
github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218=
github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4=
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo=
github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk=
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127 h1:qwcF+vdFrvPSEUDSX5RVoRccG8a5DhOdWdQ4zN62zzo=
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4=
Expand Down Expand Up @@ -408,6 +416,8 @@ github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peK
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
Expand Down Expand Up @@ -460,6 +470,8 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
Expand Down Expand Up @@ -505,6 +517,8 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
Expand Down Expand Up @@ -808,6 +822,7 @@ golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down Expand Up @@ -1033,6 +1048,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY=
gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
6 changes: 3 additions & 3 deletions message/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ type msgBuilder struct {

zstdCompressor compression.Compressor
count *prometheus.CounterVec // type + op + direction
duration *prometheus.CounterVec // type + op + direction
duration *prometheus.GaugeVec // type + op + direction

maxMessageTimeout time.Duration
}
Expand Down Expand Up @@ -170,8 +170,8 @@ func newMsgBuilder(
},
metricLabels,
),
duration: prometheus.NewCounterVec(
prometheus.CounterOpts{
duration: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: namespace,
Name: "compressed_duration",
Help: "time spent handling compressed messages",
Expand Down
2 changes: 1 addition & 1 deletion network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ It is expected for Avalanche nodes to allow inbound connections. If a validator

Avalanche nodes that have identified the `IP:Port` pair of a node they want to connect to will initiate outbound connections to this `IP:Port` pair. If the connection is not able to complete the [Peer Handshake](#peer-handshake), the connection will be re-attempted with an [Exponential Backoff](https://en.wikipedia.org/wiki/Exponential_backoff).

A node should initiate outbound connections to an `IP:Port` pair that is beleived to belong to a node that is not connected and meets at least one of the following conditions:
A node should initiate outbound connections to an `IP:Port` pair that is believed to belong to a node that is not connected and meets at least one of the following conditions:
- The node is in the initial bootstrapper set.
- The node is in the default bootstrapper set.
- The node in the current Primary Network validator set.
Expand Down
4 changes: 2 additions & 2 deletions network/p2p/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ type ValidatorHandler struct {

func (v ValidatorHandler) AppGossip(ctx context.Context, nodeID ids.NodeID, gossipBytes []byte) {
if !v.validatorSet.Has(ctx, nodeID) {
v.log.Debug(
"dropping message",
v.log.Debug("dropping message",
zap.Stringer("nodeID", nodeID),
zap.String("reason", "not a validator"),
)
Expand Down Expand Up @@ -127,6 +126,7 @@ func (r *responder) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID
zap.Time("deadline", deadline),
zap.Uint64("handlerID", r.handlerID),
zap.Binary("message", request),
zap.Error(err),
)
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions network/p2p/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ func NewNetwork(
namespace string,
) (*Network, error) {
metrics := metrics{
msgTime: prometheus.NewCounterVec(
prometheus.CounterOpts{
msgTime: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: namespace,
Name: "msg_time",
Help: "message handling time (ns)",
Expand Down
2 changes: 1 addition & 1 deletion network/p2p/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type meteredHandler struct {
}

type metrics struct {
msgTime *prometheus.CounterVec
msgTime *prometheus.GaugeVec
msgCount *prometheus.CounterVec
}

Expand Down
3 changes: 1 addition & 2 deletions network/p2p/throttler_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ type ThrottlerHandler struct {

func (t ThrottlerHandler) AppGossip(ctx context.Context, nodeID ids.NodeID, gossipBytes []byte) {
if !t.throttler.Handle(nodeID) {
t.log.Debug(
"dropping message",
t.log.Debug("dropping message",
zap.Stringer("nodeID", nodeID),
zap.String("reason", "throttled"),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ AVALANCHE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
source "$AVALANCHE_PATH"/scripts/constants.sh

echo "Building Workload..."
go build -o "$AVALANCHE_PATH/build/workload" "$AVALANCHE_PATH/tests/antithesis/"*.go
go build -o "$AVALANCHE_PATH/build/antithesis-avalanchego-workload" "$AVALANCHE_PATH/tests/antithesis/avalanchego/"*.go
Loading

0 comments on commit 1efe8e1

Please sign in to comment.