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

chore: bump k8s to 0.30.3 and go to 1.23 #37

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.61.0
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ linters:
enable:
- asciicheck
- bidichk
# - depguard
- copyloopvar
- dogsled
- durationcheck
- errcheck
- errname
- errorlint
- exportloopref
- forbidigo
- gochecknoinits
- goconst
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GO ?= go
GOBIN ?= $$($(GO) env GOPATH)/bin
GOLANGCI_LINT ?= $(GOBIN)/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.51.0
GOLANGCI_LINT_VERSION ?= v1.61.0

.PHONY: get-golangcilint
get-golangcilint:
Expand Down
32 changes: 20 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/ethersphere/node-funder

go 1.22

toolchain go1.22.0
go 1.23

require (
github.com/btcsuite/btcd v0.22.3
Expand All @@ -12,9 +10,9 @@ require (
github.com/ethersphere/go-sw3-abi v0.6.5
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.8.4
k8s.io/apimachinery v0.22.16
k8s.io/client-go v0.22.16
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed
k8s.io/apimachinery v0.30.3
k8s.io/client-go v0.30.3
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
)

require (
Expand All @@ -30,21 +28,29 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.19.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
Expand All @@ -71,9 +77,11 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.22.16 // indirect
k8s.io/klog/v2 v2.70.1 // indirect
k8s.io/api v0.30.3 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
419 changes: 51 additions & 368 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/funder/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ package funder

import "math/big"

func CalcTopUpAmount(min float64, currAmount *big.Int, decimals int) *big.Int {
return calcTopUpAmount(min, currAmount, decimals)
func CalcTopUpAmount(minValue float64, currAmount *big.Int, decimals int) *big.Int {
return calcTopUpAmount(minValue, currAmount, decimals)
}

func FormatAmount(amount *big.Int, decimals int) string {
Expand Down
4 changes: 2 additions & 2 deletions pkg/funder/funder.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,10 @@ func topUpWallet(
return topUpAmount, nil
}

func calcTopUpAmount(min float64, currAmount *big.Int, decimals int) *big.Int {
func calcTopUpAmount(minValue float64, currAmount *big.Int, decimals int) *big.Int {
exp := big.NewInt(0).Exp(big.NewInt(10), big.NewInt(int64(decimals)), nil)

minAmount := big.NewFloat(min)
minAmount := big.NewFloat(minValue)
minAmount = minAmount.Mul(
minAmount,
big.NewFloat(0).SetInt(exp),
Expand Down
4 changes: 2 additions & 2 deletions pkg/funder/staker.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func Stake(ctx context.Context, cfg Config, nl NodeLister, options ...FunderOpti
return nil
}

func stakeAllNodes(ctx context.Context, nodes []NodeInfo, min float64, log logging.Logger) {
func stakeAllNodes(ctx context.Context, nodes []NodeInfo, minValue float64, log logging.Logger) {
wg := sync.WaitGroup{}
wg.Add(len(nodes))

Expand All @@ -70,7 +70,7 @@ func stakeAllNodes(ctx context.Context, nodes []NodeInfo, min float64, log loggi
return
}

amount := calcTopUpAmount(min, si.StakedAmount, wallet.SwarmTokenDecimals)
amount := calcTopUpAmount(minValue, si.StakedAmount, wallet.SwarmTokenDecimals)
if amount.Cmp(big.NewInt(0)) <= 0 {
skipped.Add(1)
log.Infof("node[%s] - already staked", node.Name)
Expand Down
Loading