From 0e8d5d41fc0ae5928fc194a5d9324e7be0cea5e9 Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Sat, 17 Sep 2022 18:55:38 +0700 Subject: [PATCH] remove libmdbx git-submodule, make db-tools work on vendored to mdbx-go .c code (after "make dist") (#5392) * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save * save --- .dockerignore | 2 +- .gitmodules | 3 --- Makefile | 22 +++++++--------------- go.mod | 4 ++-- go.sum | 8 ++++---- libmdbx | 1 - tools.go | 2 ++ 7 files changed, 16 insertions(+), 26 deletions(-) delete mode 160000 libmdbx diff --git a/.dockerignore b/.dockerignore index 14c2f5a8bf5..314dadf0a10 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,5 +5,5 @@ **/*.dSYM build -tests +tests/testdata cmd/prometheus diff --git a/.gitmodules b/.gitmodules index ae94b08f852..32bdb3b6e5a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [submodule "tests"] path = tests/testdata url = https://github.com/ethereum/tests -[submodule "libmdbx"] - path = libmdbx - url = https://github.com/torquem-ch/libmdbx.git diff --git a/Makefile b/Makefile index cfa1b974505..0256b28fbf1 100644 --- a/Makefile +++ b/Makefile @@ -105,12 +105,12 @@ COMMANDS += integration COMMANDS += observer COMMANDS += pics COMMANDS += rpcdaemon -COMMANDS += rpcdaemon22 COMMANDS += rpctest COMMANDS += sentry COMMANDS += state COMMANDS += txpool COMMANDS += verkle +COMMANDS += evm # build each command using %.cmd rule $(COMMANDS): %: %.cmd @@ -119,20 +119,13 @@ $(COMMANDS): %: %.cmd all: erigon $(COMMANDS) ## db-tools: build db tools -db-tools: git-submodules +db-tools: @echo "Building db-tools" - @# hub.docker.com setup incorrect gitpath for git modules. Just remove it and re-init submodule. - rm -rf libmdbx - git submodule update --init --recursive --force libmdbx - - cd libmdbx && MDBX_BUILD_TIMESTAMP=unknown make tools - cp libmdbx/mdbx_chk $(GOBIN) - cp libmdbx/mdbx_copy $(GOBIN) - cp libmdbx/mdbx_dump $(GOBIN) - cp libmdbx/mdbx_drop $(GOBIN) - cp libmdbx/mdbx_load $(GOBIN) - cp libmdbx/mdbx_stat $(GOBIN) + go mod vendor + cd vendor/github.com/torquem-ch/mdbx-go && MDBX_BUILD_TIMESTAMP=unknown make tools + cd vendor/github.com/torquem-ch/mdbx-go/mdbxdist && cp mdbx_chk $(GOBIN) && cp mdbx_copy $(GOBIN) && cp mdbx_dump $(GOBIN) && cp mdbx_drop $(GOBIN) && cp mdbx_load $(GOBIN) && cp mdbx_stat $(GOBIN) + rm -rf vendor @echo "Run \"$(GOBIN)/mdbx_stat -h\" to get info about mdbx db file." ## test: run unit tests with a 50s timeout @@ -155,13 +148,12 @@ lintci: ## lintci-deps: (re)installs golangci-lint to build/bin/golangci-lint lintci-deps: rm -f ./build/bin/golangci-lint - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.48.0 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.49.0 ## clean: cleans the go cache, build dir, libmdbx db dir clean: go clean -cache rm -fr build/* - cd libmdbx/ && make clean # The devtools target installs tools required for 'go generate'. # You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'. diff --git a/go.mod b/go.mod index ed0b729df9b..b11e404f179 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/ledgerwatch/erigon go 1.18 require ( - github.com/ledgerwatch/erigon-lib v0.0.0-20220916073411-10a15edebc2e + github.com/ledgerwatch/erigon-lib v0.0.0-20220916084227-b7b3ea1544fe github.com/ledgerwatch/erigon-snapshot v1.0.1-0.20220809023834-6309df4da4b1 github.com/ledgerwatch/log/v3 v3.4.1 github.com/ledgerwatch/secp256k1 v1.0.0 @@ -57,7 +57,7 @@ require ( github.com/stretchr/testify v1.8.0 github.com/tendermint/go-amino v0.14.1 github.com/tendermint/tendermint v0.31.11 - github.com/torquem-ch/mdbx-go v0.25.3 + github.com/torquem-ch/mdbx-go v0.26.0 github.com/ugorji/go/codec v1.1.13 github.com/ugorji/go/codec/codecgen v1.1.13 github.com/urfave/cli v1.22.9 diff --git a/go.sum b/go.sum index b1fd7155359..5f14540558f 100644 --- a/go.sum +++ b/go.sum @@ -394,8 +394,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758 h1:0D5M2HQSGD3PYPwICLl+/9oulQauOuETfgFvhBDffs0= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/ledgerwatch/erigon-lib v0.0.0-20220916073411-10a15edebc2e h1:B5h48sxHuWEJptsdBlC/wLlTwG5Kd9K5e5MFZXl0uIg= -github.com/ledgerwatch/erigon-lib v0.0.0-20220916073411-10a15edebc2e/go.mod h1:SRpLIrl+gTW8068Vw4cMSr2Q7Fncpw9KgiWNmmtv+sc= +github.com/ledgerwatch/erigon-lib v0.0.0-20220916084227-b7b3ea1544fe h1:HEchu2DFX7dhuYNHt2+oARGMZJN4ZY6AQrZ4YacY8J0= +github.com/ledgerwatch/erigon-lib v0.0.0-20220916084227-b7b3ea1544fe/go.mod h1:S8/VVAjaE7cVGeI1i58Zb4nUnEy4YtUJDiGDosapbWo= github.com/ledgerwatch/erigon-snapshot v1.0.1-0.20220809023834-6309df4da4b1 h1:qRIJu6cs6fbI8L52DSdPF27j3sOrEriXz1zQSuQvYpA= github.com/ledgerwatch/erigon-snapshot v1.0.1-0.20220809023834-6309df4da4b1/go.mod h1:3AuPxZc85jkehh/HA9h8gabv5MSi3kb/ddtzBsTVJFo= github.com/ledgerwatch/log/v3 v3.4.1 h1:/xGwlVulXnsO9Uq+tzaExc8OWmXXHU0dnLalpbnY5Bc= @@ -625,8 +625,8 @@ github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDW github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/torquem-ch/mdbx-go v0.25.3 h1:Moz3A/KERndd2aeLGygeD6zC6ZedyuFdw1pdBQRf6N8= -github.com/torquem-ch/mdbx-go v0.25.3/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E= +github.com/torquem-ch/mdbx-go v0.26.0 h1:d8ph2MsVZoBZr0eFWHRiSYjoCXggED6XzcspUX/HsZM= +github.com/torquem-ch/mdbx-go v0.26.0/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E= github.com/ugorji/go v1.1.13/go.mod h1:jxau1n+/wyTGLQoCkjok9r5zFa/FxT6eI5HiHKQszjc= github.com/ugorji/go/codec v1.1.13 h1:013LbFhocBoIqgHeIHKlV4JWYhqogATYWZhIcH0WHn4= github.com/ugorji/go/codec v1.1.13/go.mod h1:oNVt3Dq+FO91WNQ/9JnHKQP2QJxTzoN7wCBFCq1OeuU= diff --git a/libmdbx b/libmdbx deleted file mode 160000 index 1cac6536376..00000000000 --- a/libmdbx +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1cac65363763e7523ed3b52eed8f2c617cead973 diff --git a/tools.go b/tools.go index 7a7ba16ab0c..eab76e96267 100644 --- a/tools.go +++ b/tools.go @@ -19,6 +19,8 @@ package tools import ( _ "github.com/fjl/gencodec" _ "github.com/kevinburke/go-bindata" + _ "github.com/torquem-ch/mdbx-go" + _ "github.com/torquem-ch/mdbx-go/mdbxdist" _ "github.com/ugorji/go/codec/codecgen" _ "google.golang.org/grpc/cmd/protoc-gen-go-grpc" )