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

sys deps up #8695

Merged
merged 12 commits into from
Nov 11, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
if: runner.os == 'Linux'
uses: golangci/golangci-lint-action@v3
with:
version: v1.54.2
version: v1.55.2
skip-build-cache: true
args: --help

Expand Down
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ linters:
- errorlint #TODO: enable me
- errchkjson #TODO: enable me
- unused #TODO: enable me
- testifylint #TODO: enable me
- perfsprint #TODO: enable me
- gocheckcompilerdirectives
- protogetter
enable:
- unconvert
# - predeclared #TODO: enable me
Expand Down Expand Up @@ -124,6 +127,7 @@ issues:
- unused
- deadcode
- gocritic
- perfsprint
- path: hack\.go
linters:
- gosec
Expand Down
9 changes: 5 additions & 4 deletions cmd/devnet/args/node_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import (
"crypto/ecdsa"
"encoding/hex"
"fmt"
"github.com/ledgerwatch/erigon/core"
"github.com/ledgerwatch/erigon/crypto"
"github.com/ledgerwatch/erigon/p2p/enode"
"github.com/ledgerwatch/erigon/params"
"math/big"
"net"
"path/filepath"
"strconv"

"github.com/ledgerwatch/erigon/core"
"github.com/ledgerwatch/erigon/crypto"
"github.com/ledgerwatch/erigon/p2p/enode"
"github.com/ledgerwatch/erigon/params"

"github.com/ledgerwatch/erigon-lib/chain/networkname"
"github.com/ledgerwatch/erigon/cmd/devnet/accounts"
"github.com/ledgerwatch/erigon/cmd/devnet/requests"
Expand Down
2 changes: 1 addition & 1 deletion cmd/devnet/contracts/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package contracts
import (
"context"
"fmt"
"github.com/ledgerwatch/erigon-lib/common/hexutil"
"math/big"

ethereum "github.com/ledgerwatch/erigon"
libcommon "github.com/ledgerwatch/erigon-lib/common"
"github.com/ledgerwatch/erigon-lib/common/hexutil"
"github.com/ledgerwatch/erigon-lib/common/hexutility"
"github.com/ledgerwatch/erigon/accounts/abi/bind"
"github.com/ledgerwatch/erigon/cmd/devnet/devnet"
Expand Down
3 changes: 2 additions & 1 deletion cmd/devnet/contracts/steps/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package contracts_steps
import (
"context"
"fmt"
"github.com/ledgerwatch/erigon-lib/common/hexutil"
"math/big"

"github.com/ledgerwatch/erigon-lib/common/hexutil"

ethereum "github.com/ledgerwatch/erigon"
libcommon "github.com/ledgerwatch/erigon-lib/common"
"github.com/ledgerwatch/erigon-lib/common/hexutility"
Expand Down
2 changes: 1 addition & 1 deletion cmd/devnet/devnet/devnet.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package devnet

import (
context "context"
"context"
"math/big"
"regexp"
"sync"
Expand Down
3 changes: 2 additions & 1 deletion cmd/devnet/devnet/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package devnet
import (
"context"
"fmt"
"github.com/ledgerwatch/erigon/cmd/utils"
"math/big"
"os"
"reflect"
"strings"
"sync"
"time"

"github.com/ledgerwatch/erigon/cmd/utils"

"github.com/ledgerwatch/erigon-lib/common/dbg"
devnet_args "github.com/ledgerwatch/erigon/cmd/devnet/args"
"github.com/ledgerwatch/erigon/cmd/devnet/requests"
Expand Down
2 changes: 1 addition & 1 deletion cmd/devnet/devnet/service.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package devnet

import context "context"
import "context"

type Service interface {
Start(context context.Context) error
Expand Down
2 changes: 1 addition & 1 deletion cmd/devnet/requests/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package requests

import (
"fmt"
"github.com/ledgerwatch/erigon-lib/common/hexutil"
"math/big"

libcommon "github.com/ledgerwatch/erigon-lib/common"
"github.com/ledgerwatch/erigon-lib/common/hexutil"
"github.com/ledgerwatch/erigon-lib/common/hexutility"
"github.com/ledgerwatch/erigon/rpc"
)
Expand Down
3 changes: 2 additions & 1 deletion cmd/devnet/requests/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package requests

import (
"encoding/json"
hexutil2 "github.com/ledgerwatch/erigon-lib/common/hexutil"
"math/big"

hexutil2 "github.com/ledgerwatch/erigon-lib/common/hexutil"

libcommon "github.com/ledgerwatch/erigon-lib/common"

"github.com/ledgerwatch/erigon/common/math"
Expand Down
1 change: 1 addition & 0 deletions cmd/devnet/requests/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"

"github.com/ledgerwatch/erigon-lib/common/hexutil"

ethereum "github.com/ledgerwatch/erigon"
Expand Down
1 change: 1 addition & 0 deletions cmd/devnet/requests/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package requests
import (
"encoding/json"
"fmt"

"github.com/ledgerwatch/erigon-lib/common/hexutil"

libcommon "github.com/ledgerwatch/erigon-lib/common"
Expand Down
3 changes: 2 additions & 1 deletion cmd/devnet/requests/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/ledgerwatch/erigon-lib/common/hexutil"
"math/big"

"github.com/ledgerwatch/erigon-lib/common/hexutil"

ethereum "github.com/ledgerwatch/erigon"
libcommon "github.com/ledgerwatch/erigon-lib/common"
"github.com/ledgerwatch/erigon-lib/common/hexutility"
Expand Down
3 changes: 2 additions & 1 deletion cmd/devnet/services/polygon/proofgenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (
"context"
"errors"
"fmt"
"github.com/ledgerwatch/erigon/cl/merkle_tree"
"math"
"math/big"
"strings"
"sync"

"github.com/ledgerwatch/erigon/cl/merkle_tree"

"github.com/ledgerwatch/erigon-lib/chain/networkname"
libcommon "github.com/ledgerwatch/erigon-lib/common"
"github.com/ledgerwatch/erigon-lib/common/hexutility"
Expand Down
3 changes: 2 additions & 1 deletion cmd/devnet/tests/bor/devnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ package bor

import (
"context"
"testing"

"github.com/ledgerwatch/erigon-lib/chain/networkname"
accounts_steps "github.com/ledgerwatch/erigon/cmd/devnet/accounts/steps"
contracts_steps "github.com/ledgerwatch/erigon/cmd/devnet/contracts/steps"
"github.com/ledgerwatch/erigon/cmd/devnet/requests"
"github.com/ledgerwatch/erigon/cmd/devnet/services"
"github.com/ledgerwatch/erigon/cmd/devnet/tests"
"github.com/stretchr/testify/require"
"testing"
)

func TestStateSync(t *testing.T) {
Expand Down
7 changes: 4 additions & 3 deletions cmd/devnet/tests/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ package tests

import (
"fmt"
"os"
"runtime"
"testing"

"github.com/ledgerwatch/erigon-lib/chain/networkname"
"github.com/ledgerwatch/erigon/cmd/devnet/devnet"
"github.com/ledgerwatch/erigon/cmd/devnet/services"
"github.com/ledgerwatch/erigon/cmd/devnet/services/polygon"
"github.com/ledgerwatch/erigon/turbo/debug"
"github.com/ledgerwatch/log/v3"
"os"
"runtime"
"testing"
)

func initDevnet(chainName string, dataDir string, logger log.Logger) (devnet.Devnet, error) {
Expand Down
3 changes: 2 additions & 1 deletion cmd/devnet/tests/devnet_bor.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package tests

import (
"time"

"github.com/ledgerwatch/erigon-lib/chain/networkname"
"github.com/ledgerwatch/erigon/cmd/devnet/accounts"
"github.com/ledgerwatch/erigon/cmd/devnet/args"
Expand All @@ -11,7 +13,6 @@ import (
"github.com/ledgerwatch/erigon/core/types"
"github.com/ledgerwatch/erigon/params"
"github.com/ledgerwatch/log/v3"
"time"
)

func NewBorDevnetWithoutHeimdall(
Expand Down
5 changes: 3 additions & 2 deletions cmd/devnet/tests/generic/devnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ package generic

import (
"context"
"testing"
"time"

"github.com/ledgerwatch/erigon/cmd/devnet/accounts"
"github.com/ledgerwatch/erigon/cmd/devnet/admin"
"github.com/ledgerwatch/erigon/cmd/devnet/contracts/steps"
Expand All @@ -12,8 +15,6 @@ import (
"github.com/ledgerwatch/erigon/cmd/devnet/tests"
"github.com/ledgerwatch/erigon/cmd/devnet/transactions"
"github.com/stretchr/testify/require"
"testing"
"time"
)

func testDynamicTx(t *testing.T, ctx context.Context) {
Expand Down
3 changes: 2 additions & 1 deletion cmd/devnet/transactions/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package transactions
import (
"context"
"fmt"
"github.com/ledgerwatch/erigon-lib/common/hexutil"
"time"

"github.com/ledgerwatch/erigon-lib/common/hexutil"

libcommon "github.com/ledgerwatch/erigon-lib/common"
"github.com/ledgerwatch/log/v3"

Expand Down
2 changes: 1 addition & 1 deletion cmd/downloader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func Downloader(ctx context.Context, logger log.Logger) error {
return err
}

cfg.ClientConfig.PieceHashersPerTorrent = 4 * runtime.NumCPU()
cfg.ClientConfig.PieceHashersPerTorrent = 32 * runtime.NumCPU()
cfg.ClientConfig.DisableIPv6 = disableIPV6
cfg.ClientConfig.DisableIPv4 = disableIPV4

Expand Down
3 changes: 3 additions & 0 deletions erigon-lib/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ linters:
- goerr113
- unparam
- makezero
- testifylint #TODO: enable me
- protogetter
enable:
- unconvert
- predeclared
Expand Down Expand Up @@ -114,6 +116,7 @@ issues:
- unused
- deadcode
- gocritic
- perfsprint
- path: hack\.go
linters:
- gosec
Expand Down
3 changes: 2 additions & 1 deletion erigon-lib/compress/parallel_compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"fmt"
"io"
"os"
"strconv"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -529,7 +530,7 @@ func reducedict(ctx context.Context, trace bool, logPrefix, segmentFilePath stri
if n == 0 {
continue
}
logCtx = append(logCtx, fmt.Sprintf("%d", i), fmt.Sprintf("%d", n))
logCtx = append(logCtx, strconv.Itoa(i), strconv.Itoa(n))
}
if lvl < log.LvlTrace {
logger.Log(lvl, fmt.Sprintf("[%s] Effective dictionary", logPrefix), logCtx...)
Expand Down
10 changes: 5 additions & 5 deletions erigon-lib/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ require (
github.com/spaolacci/murmur3 v1.1.0
github.com/stretchr/testify v1.8.4
github.com/tidwall/btree v1.6.0
golang.org/x/crypto v0.14.0
golang.org/x/crypto v0.15.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
golang.org/x/sync v0.4.0
golang.org/x/sys v0.13.0
golang.org/x/time v0.3.0
golang.org/x/sync v0.5.0
golang.org/x/sys v0.14.0
golang.org/x/time v0.4.0
google.golang.org/grpc v1.59.0
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0
google.golang.org/protobuf v1.31.0
Expand Down Expand Up @@ -140,7 +140,7 @@ require (
go.opentelemetry.io/otel/trace v1.8.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
20 changes: 10 additions & 10 deletions erigon-lib/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,8 @@ golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0
golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
Expand Down Expand Up @@ -549,8 +549,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -586,8 +586,8 @@ golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
Expand All @@ -601,10 +601,10 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.4.0 h1:Z81tqI5ddIoXDPvVQ7/7CC9TnLM7ubaFG2qXYd5BbYY=
golang.org/x/time v0.4.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
5 changes: 3 additions & 2 deletions erigon-lib/kv/membatch/mapmutation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package membatch

import (
"context"
"os"
"testing"

"github.com/ledgerwatch/erigon-lib/kv"
"github.com/ledgerwatch/erigon-lib/kv/memdb"
"github.com/ledgerwatch/log/v3"
"github.com/stretchr/testify/require"
"os"
"testing"
)

func TestMapmutation_Flush_Close(t *testing.T) {
Expand Down
Loading
Loading