diff --git a/Makefile b/Makefile index 50e746c6f47..30751ab1ff1 100644 --- a/Makefile +++ b/Makefile @@ -23,10 +23,21 @@ CGO_CFLAGS += -DMDBX_DISABLE_VALIDATION=0 # Can disable it on CI by separated PR #CGO_CFLAGS += -DMDBX_ENABLE_PROFGC=0 # Disabled by default, but may be useful for performance debugging #CGO_CFLAGS += -DMDBX_ENABLE_PGOP_STAT=0 # Disabled by default, but may be useful for performance debugging CGO_CFLAGS += -DMDBX_ENV_CHECKPID=0 # Erigon doesn't do fork() syscall -CGO_CFLAGS += -D__BLST_PORTABLE__ -CGO_CFLAGS += -Wno-unknown-warning-option -Wno-enum-int-mismatch -Wno-strict-prototypes -Wno-unused-but-set-variable + +# If it is arm64 or aarch64, then we need to use portable version of blst. use or with stringw "arm64" and "aarch64" to support both +ifeq ($(shell uname -m), arm64) + CGO_CFLAGS += -D__BLST_PORTABLE__ +endif +ifeq ($(shell uname -m), aarch64) + CGO_CFLAGS += -D__BLST_PORTABLE__ +endif + + +CGO_CFLAGS += -Wno-unknown-warning-option -Wno-enum-int-mismatch -Wno-strict-prototypes -Wno-unused-but-set-variable -O3 CGO_LDFLAGS := $(shell $(GO) env CGO_LDFLAGS 2> /dev/null) +CGO_LDFLAGS += -O3 -g + ifeq ($(shell uname -s), Darwin) ifeq ($(filter-out 13.%,$(shell sw_vers --productVersion)),) CGO_LDFLAGS += -mmacosx-version-min=13.3 @@ -44,7 +55,7 @@ GOPRIVATE = github.com/erigontech/silkworm-go PACKAGE = github.com/ledgerwatch/erigon -GO_FLAGS += -trimpath -tags $(BUILD_TAGS) -buildvcs=false +GO_FLAGS += -trimpath -tags $(BUILD_TAGS) -buildvcs=false GO_FLAGS += -ldflags "-X ${PACKAGE}/params.GitCommit=${GIT_COMMIT} -X ${PACKAGE}/params.GitBranch=${GIT_BRANCH} -X ${PACKAGE}/params.GitTag=${GIT_TAG}" GOBUILD = CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOPRIVATE="$(GOPRIVATE)" $(GO) build $(GO_FLAGS) diff --git a/cl/antiquary/antiquary.go b/cl/antiquary/antiquary.go index 45a46d03174..7fc345834d0 100644 --- a/cl/antiquary/antiquary.go +++ b/cl/antiquary/antiquary.go @@ -133,7 +133,9 @@ func (a *Antiquary) Loop() error { return err } defer logInterval.Stop() - log.Info("[Antiquary] Stopping Caplin to process historical indicies", "from", from, "to", a.sn.BlocksAvailable()) + if from != a.sn.BlocksAvailable() { + log.Info("[Antiquary] Stopping Caplin to process historical indicies", "from", from, "to", a.sn.BlocksAvailable()) + } // Now write the snapshots as indicies for i := from; i < a.sn.BlocksAvailable(); i++ { diff --git a/cmd/capcli/cli.go b/cmd/capcli/cli.go index 91460e897fd..29ba3794048 100644 --- a/cmd/capcli/cli.go +++ b/cmd/capcli/cli.go @@ -210,7 +210,7 @@ func (c *ChainEndpoint) Run(ctx *Context) error { // Let's fetch the head first currentBlock, err := core.RetrieveBlock(ctx, beaconConfig, fmt.Sprintf("%s/head", baseUri), nil) if err != nil { - return err + return fmt.Errorf("failed to retrieve head: %w, uri: %s", err, fmt.Sprintf("%s/head", baseUri)) } currentRoot, err := currentBlock.Block.HashSSZ() if err != nil { @@ -246,7 +246,7 @@ func (c *ChainEndpoint) Run(ctx *Context) error { // Let's fetch the head first currentBlock, err := core.RetrieveBlock(ctx, beaconConfig, fmt.Sprintf("%s/0x%s", baseUri, stringifiedRoot), (*libcommon.Hash)(¤tRoot)) if err != nil { - return false, err + return false, fmt.Errorf("failed to retrieve block: %w, uri: %s", err, fmt.Sprintf("%s/0x%s", baseUri, stringifiedRoot)) } currentRoot, err = currentBlock.Block.HashSSZ() if err != nil {