diff --git a/.github/workflows/_build-binaries.yaml b/.github/workflows/_build-binaries.yaml index 89fb73dd..61a8074c 100644 --- a/.github/workflows/_build-binaries.yaml +++ b/.github/workflows/_build-binaries.yaml @@ -117,6 +117,8 @@ jobs: - name: Set up Go uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 + with: + go-version-file: go.mod - name: Cache geth binary uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3.4.3 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 560ad890..77c555f6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,6 +27,8 @@ jobs: - name: Set up Go uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 + with: + go-version-file: go.mod - name: Install project dependencies run: | @@ -35,7 +37,7 @@ jobs: - name: Lint Go uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0 with: - version: v2.0 + version: v2.13.2 go-test: outputs: @@ -53,6 +55,8 @@ jobs: - name: Set up Go uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 + with: + go-version-file: go.mod - name: Install project dependencies run: | @@ -89,6 +93,8 @@ jobs: - name: Set up Go uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 + with: + go-version-file: go.mod - name: Install project dependencies run: | diff --git a/.github/workflows/examples.yaml b/.github/workflows/examples.yaml index 21823488..dc7702dd 100644 --- a/.github/workflows/examples.yaml +++ b/.github/workflows/examples.yaml @@ -37,6 +37,8 @@ jobs: - name: Set up Go uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 + with: + go-version-file: go.mod - name: Install project dependencies run: | diff --git a/.github/workflows/public-benchmarks.yaml b/.github/workflows/public-benchmarks.yaml index 4038cfc3..7333f8ca 100644 --- a/.github/workflows/public-benchmarks.yaml +++ b/.github/workflows/public-benchmarks.yaml @@ -38,6 +38,8 @@ jobs: - name: Set up Go uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 + with: + go-version-file: go.mod - name: Install project dependencies run: | diff --git a/go.mod b/go.mod index c5dd0a7b..652a9268 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/base/base-bench -go 1.24.6 - -toolchain go1.24.11 +go 1.27.1 require ( github.com/charmbracelet/huh v0.8.0 diff --git a/runner/payload/loadtest/load_test_worker.go b/runner/payload/loadtest/load_test_worker.go index 54d94e9b..49413c97 100644 --- a/runner/payload/loadtest/load_test_worker.go +++ b/runner/payload/loadtest/load_test_worker.go @@ -17,6 +17,7 @@ import ( "github.com/base/base-bench/runner/network/mempool" "github.com/base/base-bench/runner/network/types" "github.com/base/base-bench/runner/payload/worker" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/pkg/errors" "gopkg.in/yaml.v3" @@ -76,7 +77,7 @@ func NewLoadTestPayloadWorker( w := &loadTestPayloadWorker{ log: log, - prefundSK: hex.EncodeToString(prefundedPrivateKey.D.Bytes()), + prefundSK: hex.EncodeToString(crypto.FromECDSA(&prefundedPrivateKey)), loadTestBin: cfg.LoadTestBinary(), elRPCURL: elRPCURL, flashblocksURL: flashblocksURL, diff --git a/runner/payload/simulator/simulatorstats/types.go b/runner/payload/simulator/simulatorstats/types.go index 0285b908..8ba1ed5b 100644 --- a/runner/payload/simulator/simulatorstats/types.go +++ b/runner/payload/simulator/simulatorstats/types.go @@ -69,7 +69,7 @@ func (o OpcodeStats) String() string { }) opcodes = opcodes[:min(10, len(opcodes))] for _, opcode := range opcodes { - result.WriteString(fmt.Sprintf("\n - %20s: %.2f", opcode, o[opcode])) + fmt.Fprintf(&result, "\n - %20s: %.2f", opcode, o[opcode]) } return result.String() } diff --git a/runner/payload/simulator/worker.go b/runner/payload/simulator/worker.go index 1a228c7a..3dc4b084 100644 --- a/runner/payload/simulator/worker.go +++ b/runner/payload/simulator/worker.go @@ -3,6 +3,7 @@ package simulator import ( "context" "crypto/ecdsa" + "encoding/binary" "fmt" "math" "math/big" @@ -217,7 +218,8 @@ func generateCallerAccounts(prefundedKey *ecdsa.PrivateKey, numCallers int) ([]* } // Use deterministic random source seeded from prefunded key - seed := int64(prefundedKey.D.Uint64()) + keyBytes := crypto.FromECDSA(prefundedKey) + seed := int64(binary.BigEndian.Uint64(keyBytes[len(keyBytes)-8:])) src := rand.New(rand.NewSource(seed)) keys := make([]*ecdsa.PrivateKey, numCallers) diff --git a/runner/payload/txfuzz/tx_fuzz_worker.go b/runner/payload/txfuzz/tx_fuzz_worker.go index 87fd5010..6274c0af 100644 --- a/runner/payload/txfuzz/tx_fuzz_worker.go +++ b/runner/payload/txfuzz/tx_fuzz_worker.go @@ -13,6 +13,7 @@ import ( "github.com/base/base-bench/runner/network/mempool" "github.com/base/base-bench/runner/network/types" "github.com/base/base-bench/runner/payload/worker" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/pkg/errors" ) @@ -43,7 +44,7 @@ func NewTxFuzzPayloadWorker( t := &txFuzzPayloadWorker{ log: log, - prefundSK: hex.EncodeToString(prefundedPrivateKey.D.Bytes()), + prefundSK: hex.EncodeToString(crypto.FromECDSA(&prefundedPrivateKey)), txFuzzBin: cfg.TxFuzzBinary(), elRPCURL: elRPCURL, mempool: mempool,