Skip to content

Commit

Permalink
test!: adds the ability to set or unset bbr in e2e tests (#3817)
Browse files Browse the repository at this point in the history
Closes #3815 by disabling BBR in e2e tests.
  • Loading branch information
staheri14 authored Sep 11, 2024
1 parent 0d0b9e7 commit 2c53ddb
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/maintainers/release-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The target audience for this guide is maintainers of this repo. In general, the

## Official Release

Follow the [creating a release candidate](#creating-a-release-candidate) section with the following considerations:
Follow the [creating a release candidate](#creating-a-release-candidate) section with the following considerations:

- The version tag should not include the `-rc` suffix.
- The release notes should contain an **Upgrade Notice** section with notable changes for node operators or library consumers.
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/benchmark/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (b *BenchmarkTest) SetupNodes() error {
testnet.NoError("failed to create genesis nodes",
b.CreateGenesisNodes(b.manifest.Validators,
b.manifest.CelestiaAppVersion, b.manifest.SelfDelegation,
b.manifest.UpgradeHeight, b.manifest.ValidatorResource))
b.manifest.UpgradeHeight, b.manifest.ValidatorResource, b.manifest.DisableBBR))

// enable latency if specified in the manifest
if b.manifest.EnableLatency {
Expand Down
10 changes: 8 additions & 2 deletions test/e2e/benchmark/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ type Manifest struct {

UpgradeHeight int64
GovMaxSquareSize int64

DisableBBR bool
}

func (m *Manifest) GetGenesisModifiers() []genesis.Modifier {
Expand All @@ -103,12 +105,16 @@ func (m *Manifest) summary() string {
if m.EnableLatency {
latency = 1
}
bbr := 1
if m.DisableBBR {
bbr = 0
}
maxBlockMB := m.MaxBlockBytes / testnet.MB
summary := fmt.Sprintf("v%d-t%d-b%d-bw%dmb-tc%d-tp%d-l%d-%s-%dmb",
summary := fmt.Sprintf("v%d-t%d-b%d-bw%dmb-tc%d-tp%d-l%d-%s-br%d-%dmb",
m.Validators, m.TxClients,
m.BlobSequences, m.PerPeerBandwidth/testnet.MB,
m.TimeoutCommit/time.Second, m.TimeoutPropose/time.Second,
latency, m.Mempool, maxBlockMB)
latency, m.Mempool, bbr, maxBlockMB)
if len(summary) > 50 {
return summary[:50]
}
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/benchmark/throughput.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ var bigBlockManifest = Manifest{
TestDuration: 5 * time.Minute,
LocalTracingType: "local",
PushTrace: true,
DisableBBR: true,
}

func TwoNodeSimple(logger *log.Logger) error {
Expand Down Expand Up @@ -88,6 +89,7 @@ func TwoNodeSimple(logger *log.Logger) error {
DownloadTraces: false,
TestDuration: 3 * time.Minute,
TxClients: 2,
DisableBBR: true,
}

benchTest, err := NewBenchmarkTest(testName, &manifest)
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/major_upgrade_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ func MajorUpgradeToV2(logger *log.Logger) error {

logger.Println("Creating genesis nodes")
for i := 0; i < numNodes; i++ {
err := testNet.CreateGenesisNode(latestVersion, 10000000, upgradeHeight, testnet.DefaultResources)
err := testNet.CreateGenesisNode(latestVersion, 10000000,
upgradeHeight, testnet.DefaultResources, true)
testnet.NoError("failed to create genesis node", err)
}

Expand Down
4 changes: 3 additions & 1 deletion test/e2e/minor_version_compatibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ func MinorVersionCompatibility(logger *log.Logger) error {
// each node begins with a random version within the same major version set
v := versions.Random(r).String()
logger.Println("Starting node", "node", i, "version", v)
testnet.NoError("failed to create genesis node", testNet.CreateGenesisNode(v, 10000000, 0, testnet.DefaultResources))
testnet.NoError("failed to create genesis node",
testNet.CreateGenesisNode(v, 10000000, 0,
testnet.DefaultResources, false))
}

logger.Println("Creating txsim")
Expand Down
4 changes: 3 additions & 1 deletion test/e2e/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ func E2ESimple(logger *log.Logger) error {
defer testNet.Cleanup()

logger.Println("Creating testnet validators")
testnet.NoError("failed to create genesis nodes", testNet.CreateGenesisNodes(4, latestVersion, 10000000, 0, testnet.DefaultResources))
testnet.NoError("failed to create genesis nodes",
testNet.CreateGenesisNodes(4, latestVersion, 10000000, 0,
testnet.DefaultResources, true))

logger.Println("Creating txsim")
endpoints, err := testNet.RemoteGRPCEndpoints()
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/testnet/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func NewNode(
upgradeHeight int64,
resources Resources,
grafana *GrafanaInfo,
disableBBR bool,
) (*Node, error) {
instance, err := knuu.NewInstance(name)
if err != nil {
Expand Down Expand Up @@ -148,6 +149,9 @@ func NewNode(
return nil, err
}
args := []string{"start", fmt.Sprintf("--home=%s", remoteRootDir), "--rpc.laddr=tcp://0.0.0.0:26657"}
if disableBBR {
args = append(args, "--force-no-bbr")
}
if upgradeHeight != 0 {
args = append(args, fmt.Sprintf("--v2-upgrade-height=%d", upgradeHeight))
}
Expand Down
16 changes: 10 additions & 6 deletions test/e2e/testnet/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ func (t *Testnet) SetConsensusMaxBlockSize(size int64) {
t.genesis.ConsensusParams.Block.MaxBytes = size
}

func (t *Testnet) CreateGenesisNode(version string, selfDelegation, upgradeHeight int64, resources Resources) error {
func (t *Testnet) CreateGenesisNode(version string, selfDelegation, upgradeHeight int64, resources Resources, disableBBR bool) error {
signerKey := t.keygen.Generate(ed25519Type)
networkKey := t.keygen.Generate(ed25519Type)
node, err := NewNode(fmt.Sprintf("val%d", len(t.nodes)), version, 0,
selfDelegation, nil, signerKey, networkKey, upgradeHeight, resources,
t.grafana)
t.grafana, disableBBR)
if err != nil {
return err
}
Expand All @@ -70,9 +70,9 @@ func (t *Testnet) CreateGenesisNode(version string, selfDelegation, upgradeHeigh
return nil
}

func (t *Testnet) CreateGenesisNodes(num int, version string, selfDelegation, upgradeHeight int64, resources Resources) error {
func (t *Testnet) CreateGenesisNodes(num int, version string, selfDelegation, upgradeHeight int64, resources Resources, disableBBR bool) error {
for i := 0; i < num; i++ {
if err := t.CreateGenesisNode(version, selfDelegation, upgradeHeight, resources); err != nil {
if err := t.CreateGenesisNode(version, selfDelegation, upgradeHeight, resources, disableBBR); err != nil {
return err
}
}
Expand Down Expand Up @@ -232,12 +232,12 @@ func (t *Testnet) CreateAccount(name string, tokens int64, txsimKeyringDir strin
return kr, nil
}

func (t *Testnet) CreateNode(version string, startHeight, upgradeHeight int64, resources Resources) error {
func (t *Testnet) CreateNode(version string, startHeight, upgradeHeight int64, resources Resources, disableBBR bool) error {
signerKey := t.keygen.Generate(ed25519Type)
networkKey := t.keygen.Generate(ed25519Type)
node, err := NewNode(fmt.Sprintf("val%d", len(t.nodes)), version,
startHeight, 0, nil, signerKey, networkKey, upgradeHeight, resources,
t.grafana)
t.grafana, disableBBR)
if err != nil {
return err
}
Expand Down Expand Up @@ -383,8 +383,12 @@ func (t *Testnet) StartNodes() error {
for _, node := range genesisNodes {
err := node.WaitUntilStartedAndForwardPorts()
if err != nil {
log.Err(err).Str("name", node.Name).Str("version",
node.Version).Msg("failed to start and forward ports")
return fmt.Errorf("node %s failed to start: %w", node.Name, err)
}
log.Info().Str("name", node.Name).Str("version",
node.Version).Msg("started and ports forwarded")
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion tools/blocketa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ arrivalTime: 2024-08-28 17:24:23.483542677 +0000 UTC
```

> [!NOTE]
> The block time is currently hard-coded. If you're running this for a network with a different block time, you'll need to update the `blockTime` constant in the main.go file. You can use https://www.mintscan.io/celestia/block/ or the blocktime tool.
> The block time is currently hard-coded. If you're running this for a network with a different block time, you'll need to update the `blockTime` constant in the main.go file. You can use [https://www.mintscan.io/celestia/block](https://www.mintscan.io/celestia/block/) or the blocktime tool.

0 comments on commit 2c53ddb

Please sign in to comment.