Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix load test #1043

Merged
merged 15 commits into from
Jan 22, 2024
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/VictoriaMetrics/fastcache v1.10.0
github.com/ava-labs/avalanche-network-runner v1.7.4-0.20231127162258-2f3ceed8ae4b
github.com/ava-labs/avalanchego v1.10.18-rc.16
github.com/ava-labs/avalanchego v1.10.18-rc.17
github.com/cespare/cp v0.1.0
github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811
github.com/davecgh/go-spew v1.1.1
Expand Down Expand Up @@ -57,7 +57,7 @@ require (
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/ava-labs/coreth v0.12.10-rc.4 // indirect
github.com/ava-labs/coreth v0.12.9-rc.9.0.20240110070856-c8809cc3c436 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.7.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
Expand Down Expand Up @@ -126,7 +126,6 @@ require (
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/rs/cors v1.7.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.3.0 // indirect
Expand Down
10 changes: 4 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/ava-labs/avalanche-network-runner v1.7.4-0.20231127162258-2f3ceed8ae4b h1:iH6q+S7dmBOYCXrZx+nNlS1HBp72L2msiVCLs39Ls5A=
github.com/ava-labs/avalanche-network-runner v1.7.4-0.20231127162258-2f3ceed8ae4b/go.mod h1:aeAm8dgJ1xucQKlYoRDMgYjA0UWGwmaICG9wL0WvseU=
github.com/ava-labs/avalanchego v1.10.18-rc.16 h1:gEH0ZSqbvWKITMk/i6qAeaeEUSAH/BGgfQgxZYAK/ck=
github.com/ava-labs/avalanchego v1.10.18-rc.16/go.mod h1:eJiCzwIhrR9HWeryQ/tRP4w0Kg7bTDJ0t9cxjWxqd6o=
github.com/ava-labs/coreth v0.12.10-rc.4 h1:+Ll3cpi3tZbw37lTa+1a/VnPa7xZktpbAFiuKtDKnIE=
github.com/ava-labs/coreth v0.12.10-rc.4/go.mod h1:8pt5LW6MP/luIdhQA+gvs8LobKE8tP/5APXUiFbfb2c=
github.com/ava-labs/avalanchego v1.10.18-rc.17 h1:ZZxjDy54NDBwMW3b6LtBoDTe5jaJJipCQcq4iUXRskE=
github.com/ava-labs/avalanchego v1.10.18-rc.17/go.mod h1:7+Ao/l/f7PCMeVyYAn7xF0Xy8iX/MMLEr95pyoeURJM=
github.com/ava-labs/coreth v0.12.9-rc.9.0.20240110070856-c8809cc3c436 h1:s2LATNf3948KEIkgpUONktGKUhaU3rb6/o2b4KA1bcQ=
github.com/ava-labs/coreth v0.12.9-rc.9.0.20240110070856-c8809cc3c436/go.mod h1:fHAYNaRtIA+rkrHzy8i2HhXyj6dqC64C5ZfiXymZlQM=
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
Expand Down Expand Up @@ -557,8 +557,6 @@ github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic
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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo=
github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo=
Expand Down
7 changes: 4 additions & 3 deletions plugin/evm/gossip.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (t txGossipHandler) CrossChainAppRequest(context.Context, ids.ID, time.Time
}

func NewGossipEthTxPool(mempool *txpool.TxPool) (*GossipEthTxPool, error) {
bloom, err := gossip.NewBloomFilter(txGossipBloomMaxItems, txGossipBloomFalsePositiveRate)
bloom, err := gossip.NewBloomFilter(txGossipBloomMinTargetElements, txGossipBloomTargetFalsePositiveRate, txGossipBloomResetFalsePositiveRate)
if err != nil {
return nil, fmt.Errorf("failed to initialize bloom filter: %w", err)
}
Expand Down Expand Up @@ -115,10 +115,11 @@ func (g *GossipEthTxPool) Subscribe(ctx context.Context) {
return
case pendingTxs := <-g.pendingTxs:
g.lock.Lock()
optimalElements := (g.mempool.PendingSize() + len(pendingTxs.Txs)) * txGossipBloomChurnMultiplier
for _, pendingTx := range pendingTxs.Txs {
tx := &GossipEthTx{Tx: pendingTx}
g.bloom.Add(tx)
reset, err := gossip.ResetBloomFilterIfNeeded(g.bloom, txGossipMaxFalsePositiveRate)
reset, err := gossip.ResetBloomFilterIfNeeded(g.bloom, optimalElements)
if err != nil {
log.Error("failed to reset bloom filter", "err", err)
continue
Expand Down Expand Up @@ -150,7 +151,7 @@ func (g *GossipEthTxPool) Iterate(f func(tx *GossipEthTx) bool) {
})
}

func (g *GossipEthTxPool) GetFilter() ([]byte, []byte, error) {
func (g *GossipEthTxPool) GetFilter() ([]byte, []byte) {
g.lock.RLock()
defer g.lock.RUnlock()

Expand Down
4 changes: 2 additions & 2 deletions plugin/evm/tx_gossip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ func TestEthTxGossip(t *testing.T) {
}

// Ask the VM for any new transactions. We should get nothing at first.
emptyBloomFilter, err := gossip.NewBloomFilter(txGossipBloomMaxItems, txGossipBloomFalsePositiveRate)
emptyBloomFilter, err := gossip.NewBloomFilter(txGossipBloomMinTargetElements, txGossipBloomTargetFalsePositiveRate, txGossipBloomResetFalsePositiveRate)
require.NoError(err)
emptyBloomFilterBytes, _, err := emptyBloomFilter.Marshal()
emptyBloomFilterBytes, _ := emptyBloomFilter.Marshal()
require.NoError(err)
request := &sdk.PullGossipRequest{
Filter: emptyBloomFilterBytes,
Expand Down
19 changes: 10 additions & 9 deletions plugin/evm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,16 @@ const (
ethTxGossipProtocol = 0x0

// gossip constants
txGossipBloomMaxItems = 8 * 1024
txGossipBloomFalsePositiveRate = 0.01
txGossipMaxFalsePositiveRate = 0.05
txGossipTargetMessageSize = 20 * units.KiB
maxValidatorSetStaleness = time.Minute
txGossipThrottlingPeriod = 10 * time.Second
txGossipThrottlingLimit = 2
gossipFrequency = 10 * time.Second
txGossipPollSize = 10
txGossipBloomMinTargetElements = 8 * 1024
txGossipBloomTargetFalsePositiveRate = 0.01
txGossipBloomResetFalsePositiveRate = 0.05
txGossipBloomChurnMultiplier = 3
txGossipTargetMessageSize = 20 * units.KiB
maxValidatorSetStaleness = time.Minute
txGossipThrottlingPeriod = 10 * time.Second
txGossipThrottlingLimit = 2
gossipFrequency = 10 * time.Second
txGossipPollSize = 10
)

// Define the API endpoints for the VM
Expand Down
2 changes: 1 addition & 1 deletion scripts/versions.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# Don't export them as they're used in the context of other calls
AVALANCHE_VERSION=${AVALANCHE_VERSION:-'v1.10.18-rc.16'}
AVALANCHE_VERSION=${AVALANCHE_VERSION:-'v1.10.18-rc.17'}
GINKGO_VERSION=${GINKGO_VERSION:-'v2.2.0'}

# This won't be used, but it's here to make code syncs easier
Expand Down
4 changes: 3 additions & 1 deletion tests/utils/runner/network_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ func NewDefaultANRConfig() ANRConfig {
AvalancheGoExecPath: os.ExpandEnv("$GOPATH/src/github.com/ava-labs/avalanchego/build/avalanchego"),
PluginDir: os.ExpandEnv("$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins"),
GlobalNodeConfig: `{
"log-level":"info",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove log-display-level if we are going to specify log-level? Also, not sure why we were originally specifying log-display-level here (although it looks like I wrote it, I think I copied it from somewhere).

Most likely this was to log to stdout without writing to the log directory. I'd assume if anything we'd want more specific logs written to stdout, so that we can inspect them on test failure without crowding out the output from the network runner, which pipes the logs from stdout (as I understand it).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

"log-display-level":"info",
"proposervm-use-current-height":true
}`,
GlobalCChainConfig: `{
"warp-api-enabled": true,
"log-level": "debug"
"log-level": "debug",
"log-display-level": "debug"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"log-level": "debug",
"log-display-level": "debug"
"log-level": "debug",

There is no log-display-level for the C-Chain specific config

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

}`,
}
// If AVALANCHEGO_BUILD_PATH is populated, override location set by GOPATH
Expand Down
Loading