From 1e16ebe01cf435b1e9a229d9d819df1adf64cf14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Tue, 27 Oct 2026 16:04:29 +0100 Subject: [PATCH] chore: remove test harness, docker/docker and reflect2 from production binaries --- common/cmd/cmd.go | 2 +- common/go.mod | 3 ++- common/go.sum | 2 ++ common/utils/simulation.go | 2 +- common/utils/utils.go | 6 ------ common/version/version.go | 2 +- coordinator/cmd/{api/app => }/mock_app.go | 2 +- tests/integration-test/integration_test.go | 3 ++- 8 files changed, 10 insertions(+), 12 deletions(-) rename coordinator/cmd/{api/app => }/mock_app.go (99%) diff --git a/common/cmd/cmd.go b/common/cmd/cmd.go index 6d10945235..25a683b270 100644 --- a/common/cmd/cmd.go +++ b/common/cmd/cmd.go @@ -7,7 +7,7 @@ import ( "strings" "sync/atomic" - "github.com/docker/docker/pkg/reexec" + "github.com/moby/sys/reexec" cmap "github.com/orcaman/concurrent-map" ) diff --git a/common/go.mod b/common/go.mod index 0badd2c10b..5672bc3017 100644 --- a/common/go.mod +++ b/common/go.mod @@ -17,7 +17,7 @@ require ( github.com/mattn/go-colorable v0.1.13 github.com/mattn/go-isatty v0.0.20 github.com/mitchellh/mapstructure v1.5.0 - github.com/modern-go/reflect2 v1.0.2 + github.com/moby/sys/reexec v0.1.0 github.com/orcaman/concurrent-map v1.0.0 github.com/prometheus/client_golang v1.19.0 github.com/scroll-tech/go-ethereum v1.10.14-0.20261022073043-e8c9fb7297ca @@ -161,6 +161,7 @@ require ( github.com/moby/sys/user v0.1.0 // indirect github.com/moby/term v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect diff --git a/common/go.sum b/common/go.sum index afd041388a..6c6f964f45 100644 --- a/common/go.sum +++ b/common/go.sum @@ -515,6 +515,8 @@ github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8 github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g= github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= +github.com/moby/sys/reexec v0.1.0 h1:RrBi8e0EBTLEgfruBOFcxtElzRGTEUkeIFaVXgU7wok= +github.com/moby/sys/reexec v0.1.0/go.mod h1:EqjBg8F3X7iZe5pU6nRZnYCMUTXoxsjiIfHup5wYIN8= github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= github.com/moby/sys/signal v0.7.0 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI= diff --git a/common/utils/simulation.go b/common/utils/simulation.go index 9116b69943..0dfe108bd1 100644 --- a/common/utils/simulation.go +++ b/common/utils/simulation.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/docker/docker/pkg/reexec" + "github.com/moby/sys/reexec" "github.com/urfave/cli/v2" ) diff --git a/common/utils/utils.go b/common/utils/utils.go index 101d94fd51..0360af3b70 100644 --- a/common/utils/utils.go +++ b/common/utils/utils.go @@ -14,7 +14,6 @@ import ( "strings" "time" - "github.com/modern-go/reflect2" "github.com/scroll-tech/go-ethereum/core" "github.com/scroll-tech/go-ethereum/log" ) @@ -58,11 +57,6 @@ func Loop(ctx context.Context, period time.Duration, f func()) { } } -// IsNil Check if the interface is empty. -func IsNil(i interface{}) bool { - return i == nil || reflect2.IsNil(i) -} - // RandomURL return a random port endpoint. func RandomURL() string { id, _ := rand.Int(rand.Reader, big.NewInt(5000-1)) diff --git a/common/version/version.go b/common/version/version.go index d98a161abf..3800664461 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.8.8" +var tag = "v4.8.9" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok { diff --git a/coordinator/cmd/api/app/mock_app.go b/coordinator/cmd/mock_app.go similarity index 99% rename from coordinator/cmd/api/app/mock_app.go rename to coordinator/cmd/mock_app.go index 4b14c54f12..e4359bcba2 100644 --- a/coordinator/cmd/api/app/mock_app.go +++ b/coordinator/cmd/mock_app.go @@ -69,7 +69,7 @@ func (c *CoordinatorApp) RunApp(t *testing.T, args ...string) { // Free stop and release coordinator-test. func (c *CoordinatorApp) Free() { - if !utils.IsNil(c.Cmd) { + if c.Cmd != nil { c.Cmd.WaitExit() } _ = os.Remove(c.coordinatorFile) diff --git a/tests/integration-test/integration_test.go b/tests/integration-test/integration_test.go index 28527e0247..51430e86e5 100644 --- a/tests/integration-test/integration_test.go +++ b/tests/integration-test/integration_test.go @@ -20,7 +20,8 @@ import ( "scroll-tech/common/utils" "scroll-tech/common/version" - capp "scroll-tech/coordinator/cmd/api/app" + capp "scroll-tech/coordinator/cmd" + _ "scroll-tech/coordinator/cmd/api/app" bcmd "scroll-tech/rollup/cmd" )