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

test(taiko-client): introduce multi nodes hive test #17981

Merged
merged 4 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0
github.com/ethereum-optimism/optimism v1.7.4
github.com/ethereum/go-ethereum v1.13.15
github.com/ethereum/hive v0.0.0-20240819211657-cf4f55c5d80c
github.com/ethereum/hive v0.0.0-20240822135954-91829ccfb2c5
github.com/go-git/go-git/v5 v5.12.0
github.com/go-resty/resty/v2 v2.7.0
github.com/gomarkdown/markdown v0.0.0-20231222211730-1d6d20845b47
Expand Down Expand Up @@ -338,4 +338,4 @@ replace github.com/ethereum-optimism/optimism v1.7.4 => github.com/taikoxyz/opti

replace github.com/uber/jaeger-client-go => github.com/uber/jaeger-client-go v2.25.0+incompatible

replace github.com/ethereum/hive v0.0.0-20240819211657-cf4f55c5d80c => github.com/taikoxyz/hive v0.0.0-20240820085424-18828a3c52ee
replace github.com/ethereum/hive v0.0.0-20240822135954-91829ccfb2c5 => github.com/taikoxyz/hive v0.0.0-20240827015317-405b241dd082
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1175,8 +1175,8 @@ github.com/swaggo/swag v1.16.3/go.mod h1:DImHIuOFXKpMFAQjcC7FG4m3Dg4+QuUgUzJmKjI
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs=
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48=
github.com/taikoxyz/hive v0.0.0-20240820085424-18828a3c52ee h1:/TbK2Ui8YJveJDQexkvchBOL4uX8HILThARQNZ9aEtU=
github.com/taikoxyz/hive v0.0.0-20240820085424-18828a3c52ee/go.mod h1:SRnVApayESg4JOlUIojO1nKNG8BLxdpZSkewWrj6rYU=
github.com/taikoxyz/hive v0.0.0-20240827015317-405b241dd082 h1:ymZR+Y88LOnA8i3KeuJXK7hff2n7bpMIhONPJwpcA5w=
github.com/taikoxyz/hive v0.0.0-20240827015317-405b241dd082/go.mod h1:RHnIu3EFehrWX3JhFAMQSXD5uz7l0xaNroTzXrap7EQ=
github.com/taikoxyz/optimism v0.0.0-20240627102435-4845247ff00c h1:Hfhh/icxShwpLdX7RqYzZN1EU40MGWhvSXc2V+ZzTxw=
github.com/taikoxyz/optimism v0.0.0-20240627102435-4845247ff00c/go.mod h1:jKn73pLX8eDIG0Y3XeuUSetepecM8OvRflyPHbi05B4=
github.com/taikoxyz/taiko-geth v1.5.1-0.20240808041410-882a6cd3294c h1:XQDnwQfisAlFAGKqabDcLdg9B+pRwS3nxS+03yP1g9o=
Expand Down
1 change: 0 additions & 1 deletion packages/eventindexer/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ linters:
- gocritic
- gofmt
# - revive
- gosec
- gosimple
- lll
- unused
Expand Down
54 changes: 36 additions & 18 deletions packages/taiko-client/integration_test/hive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package integration_test

import (
"context"
"fmt"
"os"
"testing"

Expand All @@ -14,24 +15,47 @@ func TestHiveHandler(t *testing.T) {
if baseDir == "" {
t.SkipNow()
}
t.Run("taiko-deneb-testnet/test-deneb-genesis", testDenebGenesis)
t.Run("taiko-deneb-reorg/test-deneb-reorg", testDenebReorg)

clientGroups := [][]string{
{
"taiko/anvil",
"taiko/taiko-geth",
"taiko/driver",
"taiko/proposer",
"taiko/prover",
},
{
"taiko/taiko-geth",
"taiko/driver",
},
{
"taiko/taiko-geth",
"taiko/driver",
},
}

// Single cluster test.
t.Run("taiko-deneb-testnet/test-deneb-genesis/clusters(1)", func(t *testing.T) {
testDenebGenesis(t, [][]string{clientGroups[0]})
})
t.Run("taiko-deneb-reorg/test-deneb-reorg/clusters(1)", func(t *testing.T) {
testDenebReorg(t, [][]string{clientGroups[0]})
})

// Multi clusters test.
t.Run(fmt.Sprintf("taiko-deneb-testnet/test-deneb-genesis/clusters(%d)", len(clientGroups)), func(t *testing.T) {
testDenebGenesis(t, clientGroups)
})
}

func testDenebGenesis(t *testing.T) {
func testDenebGenesis(t *testing.T, clientGroups [][]string) {
handler, err := hivesim.NewHiveFramework(&hivesim.HiveConfig{
BuildOutput: false,
ContainerOutput: true,
BaseDir: os.Getenv("HIVE_DIR"),
SimPattern: "taiko",
SimTestPattern: "taiko-deneb-testnet/test-deneb-genesis",
Clients: []string{
"taiko/anvil",
"taiko/taiko-geth",
"taiko/driver",
"taiko/proposer",
"taiko/prover",
},
ClientGroups: clientGroups,
})
assert.NoError(t, err)

Expand All @@ -40,20 +64,14 @@ func testDenebGenesis(t *testing.T) {
assert.Equal(t, 0, failedCount)
}

func testDenebReorg(t *testing.T) {
func testDenebReorg(t *testing.T, clientGroups [][]string) {
handler, err := hivesim.NewHiveFramework(&hivesim.HiveConfig{
BuildOutput: false,
ContainerOutput: true,
BaseDir: os.Getenv("HIVE_DIR"),
SimPattern: "taiko",
SimTestPattern: "taiko-deneb-reorg/test-deneb-reorg",
Clients: []string{
"taiko/anvil",
"taiko/taiko-geth",
"taiko/driver",
"taiko/proposer",
"taiko/prover",
},
ClientGroups: clientGroups,
})
assert.NoError(t, err)

Expand Down
Loading