diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index ef3d3bffd..e5d2fedda 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -16,7 +16,7 @@ jobs: # Config options can be found in README here: https://github.com/golangci/golangci-lint-action - uses: actions/setup-go@v4 with: - go-version: '1.21.3' + go-version: '1.21.4' - uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml index 538c436bc..62a3ca54e 100644 --- a/.github/workflows/govulncheck.yml +++ b/.github/workflows/govulncheck.yml @@ -14,6 +14,6 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: '1.21.3' + go-version: '1.21.4' - run: go install golang.org/x/vuln/cmd/govulncheck@latest - run: govulncheck -show=stacks -test ./... diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml index f579f1b65..6dc3a1968 100644 --- a/.github/workflows/nightly-tests.yml +++ b/.github/workflows/nightly-tests.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: '1.21.3' + go-version: '1.21.4' - uses: actions/cache@v3 with: path: | diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 29ddb16aa..5d668e670 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/setup-python@v2 - uses: actions/setup-go@v4 with: - go-version: '1.21.3' + go-version: '1.21.4' - uses: pre-commit/action@v2.0.3 - name: notify failure diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2625013fc..3ade57421 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: fetch-depth: 0 # Disable shallow checkout - uses: actions/setup-go@v4 with: - go-version: '1.21.3' + go-version: '1.21.4' - run: go run . --help > cli-reference.txt - run: go run testutil/genchangelog/main.go - uses: softprops/action-gh-release@v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 807fcb602..9dfe5191e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: '1.21.3' + go-version: '1.21.4' - uses: actions/cache@v3 with: path: | @@ -33,7 +33,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: '1.21.3' + go-version: '1.21.4' - uses: actions/cache@v3 with: path: | @@ -51,7 +51,7 @@ jobs: - uses: docker/setup-buildx-action@v2 # For compose to build images - uses: actions/setup-go@v4 with: - go-version: '1.21.3' + go-version: '1.21.4' - uses: actions/cache@v3 with: path: | @@ -78,7 +78,7 @@ jobs: - uses: docker/setup-buildx-action@v2 # For compose to build images - uses: actions/setup-go@v4 with: - go-version: '1.21.3' + go-version: '1.21.4' - uses: actions/cache@v3 with: path: | diff --git a/.github/workflows/verify-pr.yml b/.github/workflows/verify-pr.yml index d1a317541..bf5d1c775 100644 --- a/.github/workflows/verify-pr.yml +++ b/.github/workflows/verify-pr.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: '1.21.3' + go-version: '1.21.4' - name: "Verify PR" run: go run github.com/obolnetwork/charon/testutil/verifypr diff --git a/.golangci.yml b/.golangci.yml index 0829aabc7..579ab883c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,6 @@ run: timeout: 5m - go: "1.21.3" + go: "1.21.4" linters-settings: cyclop: max-complexity: 15 @@ -99,7 +99,7 @@ linters-settings: - "github.com/gogo/protobuf/proto" # Prefer google.golang.org/protobuf - "github.com/prometheus/client_golang/prometheus/promauto" # Prefer ./app/promauto staticcheck: - go: "1.21.3" + go: "1.21.4" checks: - "all" - "-SA1019" # Ignoring since github.com/drand/kyber/sign/bls uses Proof Of Possession as does Ethereum. diff --git a/Dockerfile b/Dockerfile index 80e7c5f69..b9f3a6b84 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Container for building Go binary. -FROM golang:1.21.3-bullseye AS builder +FROM golang:1.21.4-bullseye AS builder # Install dependencies RUN apt-get update && apt-get install -y build-essential git # Prep and copy source diff --git a/app/eth2wrap/synthproposer.go b/app/eth2wrap/synthproposer.go index 184b270c8..b049d5520 100644 --- a/app/eth2wrap/synthproposer.go +++ b/app/eth2wrap/synthproposer.go @@ -7,6 +7,7 @@ import ( "crypto/sha256" "encoding/binary" "fmt" + "net/http" "sync" eth2client "github.com/attestantio/go-eth2-client" @@ -141,16 +142,20 @@ func (h *synthWrapper) BlindedProposal(ctx context.Context, opts *eth2api.Blinde func (h *synthWrapper) syntheticProposal(ctx context.Context, slot eth2p0.Slot, vIdx eth2p0.ValidatorIndex) (*eth2api.VersionedProposal, error) { var signedBlock *eth2spec.VersionedSignedBeaconBlock - // Work our way back from previous slot to find a proposal to base the synthetic proposal on. + // Work our way back from previous slot to find a block to base the synthetic proposal on. for prev := slot - 1; prev > 0; prev-- { opts := ð2api.SignedBeaconBlockOpts{ Block: fmt.Sprint(prev), } signed, err := h.Client.SignedBeaconBlock(ctx, opts) if err != nil { + if apiErr := new(eth2api.Error); errors.As(err, apiErr) { // Continue if block is not found in the given slot. + if apiErr.StatusCode == http.StatusNotFound { + continue + } + } + return nil, err - } else if signed == nil { // go-eth2-client returns nil if proposal is not found. - continue } signedBlock = signed.Data diff --git a/app/obolapi/api.go b/app/obolapi/api.go index 02ef3d18e..95767c354 100644 --- a/app/obolapi/api.go +++ b/app/obolapi/api.go @@ -49,9 +49,10 @@ func (c Client) url() *url.URL { return baseURL } -// PublishLock posts the lockfile to obol-api. +// PublishLock posts the lockfile to obol-api. It has a 30s timeout. func (c Client) PublishLock(ctx context.Context, lock cluster.Lock) error { - ctx, cancel := context.WithTimeout(ctx, 5*time.Second) + // TODO(xenowits): Reduce the timeout once the obol-api is optimised for publishing large lock files. + ctx, cancel := context.WithTimeout(ctx, 30*time.Second) defer cancel() addr := c.url() diff --git a/testutil/compose/static/lighthouse/run.sh b/testutil/compose/static/lighthouse/run.sh index 46b07fbe0..67a23d686 100755 --- a/testutil/compose/static/lighthouse/run.sh +++ b/testutil/compose/static/lighthouse/run.sh @@ -23,5 +23,5 @@ done echo "Starting lighthouse validator client for ${NODE}" exec lighthouse validator \ --testnet-dir "/tmp/testnet" \ - --beacon-node "http://${NODE}:3600" \ + --beacon-nodes "http://${NODE}:3600" \ --suggested-fee-recipient "0x0000000000000000000000000000000000000000" diff --git a/testutil/promrated/Dockerfile b/testutil/promrated/Dockerfile index de1b49ee2..60fe44f05 100644 --- a/testutil/promrated/Dockerfile +++ b/testutil/promrated/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.3-alpine AS builder +FROM golang:1.21.4-alpine AS builder # Install dependencies RUN apk add --no-cache build-base git