Skip to content
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
30 changes: 22 additions & 8 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,30 +207,32 @@ func main() {

func doInstall(cmdline []string) {
var (
dlgo = flag.Bool("dlgo", false, "Download Go and build with it")
arch = flag.String("arch", "", "Architecture to cross build for")
cc = flag.String("cc", "", "C compiler to cross build with")
dlgo = flag.Bool("dlgo", false, "Download Go and build with it")
arch = flag.String("arch", "", "Architecture to cross build for")
cc = flag.String("cc", "", "C compiler to cross build with")
staticlink = flag.Bool("static", false, "Create statically-linked executable")
)
flag.CommandLine.Parse(cmdline)
env := build.Env()

// Configure the toolchain.
tc := build.GoToolchain{GOARCH: *arch, CC: *cc}
if *dlgo {
csdb := build.MustLoadChecksums("build/checksums.txt")
tc.Root = build.DownloadGo(csdb, dlgoVersion)
}
// Disable CLI markdown doc generation in release builds.
buildTags := []string{"urfave_cli_no_docs"}

// Configure the build.
env := build.Env()
gobuild := tc.Go("build", buildFlags(env)...)
gobuild := tc.Go("build", buildFlags(env, *staticlink, buildTags)...)

// arm64 CI builders are memory-constrained and can't handle concurrent builds,
// better disable it. This check isn't the best, it should probably
// check for something in env instead.
if env.CI && runtime.GOARCH == "arm64" {
gobuild.Args = append(gobuild.Args, "-p", "1")
}

// We use -trimpath to avoid leaking local paths into the built executables.
gobuild.Args = append(gobuild.Args, "-trimpath")

Expand All @@ -255,7 +257,7 @@ func doInstall(cmdline []string) {
}

// buildFlags returns the go tool flags for building.
func buildFlags(env build.Environment) (flags []string) {
func buildFlags(env build.Environment, staticLinking bool, buildTags []string) (flags []string) {
var ld []string
if env.Commit != "" {
ld = append(ld, "-X", "main.gitCommit="+env.Commit)
Expand All @@ -269,11 +271,23 @@ func buildFlags(env build.Environment) (flags []string) {
// Enforce the stacksize to 8M, which is the case on most platforms apart from
// alpine Linux.
if runtime.GOOS == "linux" {
ld = append(ld, "-extldflags", "-Wl,-z,stack-size=0x800000")
// Enforce the stacksize to 8M, which is the case on most platforms apart from
// alpine Linux.
extld := []string{"-Wl,-z,stack-size=0x800000"}
if staticLinking {
extld = append(extld, "-static")
// Under static linking, use of certain glibc features must be
// disabled to avoid shared library dependencies.
buildTags = append(buildTags, "osusergo", "netgo")
}
ld = append(ld, "-extldflags", "'"+strings.Join(extld, " ")+"'")
}
if len(ld) > 0 {
flags = append(flags, "-ldflags", strings.Join(ld, " "))
}
if len(buildTags) > 0 {
flags = append(flags, "-tags", strings.Join(buildTags, ","))
}
return flags
}

Expand Down
1 change: 1 addition & 0 deletions ctxc/downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, td *big.I
if err := d.blockchain.SetHead(origin); err != nil {
return err
}
log.Info("Truncated excess ancient chain segment", "oldhead", frozen-1, "newhead", origin)
}
}
// Initiate the sync using a concurrent header and content retrieval algorithm
Expand Down
23 changes: 12 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1
github.com/CortexFoundation/inference v1.0.2-0.20230307032835-9197d586a4e8
github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66
github.com/CortexFoundation/torrentfs v1.0.59-0.20240129113837-7f5c3c53b617
github.com/CortexFoundation/torrentfs v1.0.59-0.20240202155446-7354cfa88cb3
github.com/VictoriaMetrics/fastcache v1.12.2
github.com/arsham/figurine v1.3.0
github.com/aws/aws-sdk-go-v2 v1.24.1
github.com/aws/aws-sdk-go-v2/config v1.26.6
github.com/aws/aws-sdk-go-v2/credentials v1.16.16
github.com/aws/aws-sdk-go-v2/service/route53 v1.37.0
github.com/aws/aws-sdk-go-v2/service/route53 v1.37.1
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/cespare/cp v1.1.1
github.com/charmbracelet/bubbletea v0.25.0
github.com/cloudflare/cloudflare-go v0.86.0
github.com/cockroachdb/pebble v0.0.0-20240123194302-5b280af78f31
github.com/cloudflare/cloudflare-go v0.87.0
github.com/cockroachdb/pebble v0.0.0-20240202151741-904a6c99689c
github.com/consensys/gnark-crypto v0.12.1
github.com/crate-crypto/go-kzg-4844 v0.7.0
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
Expand Down Expand Up @@ -83,7 +83,7 @@ require (
github.com/CortexFoundation/robot v1.0.7-0.20240101144533-02756bceae73 // indirect
github.com/CortexFoundation/wormhole v0.0.2-0.20231221155549-5c938553b5fc // indirect
github.com/DataDog/zstd v1.5.6-0.20230622172052-ea68dcab66c0 // indirect
github.com/RoaringBitmap/roaring v1.8.0 // indirect
github.com/RoaringBitmap/roaring v1.9.0 // indirect
github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 // indirect
github.com/alecthomas/atomic v0.1.0-alpha2 // indirect
github.com/anacrolix/chansync v0.4.0 // indirect
Expand All @@ -102,8 +102,8 @@ require (
github.com/anacrolix/torrent v1.53.3 // indirect
github.com/anacrolix/upnp v0.1.3 // indirect
github.com/anacrolix/utp v0.2.0 // indirect
github.com/antlabs/stl v0.0.1 // indirect
github.com/antlabs/timer v0.0.12 // indirect
github.com/antlabs/stl v0.0.2 // indirect
github.com/antlabs/timer v0.1.1 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/arsham/rainbow v1.2.1 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 // indirect
Expand Down Expand Up @@ -158,13 +158,13 @@ require (
github.com/google/btree v1.1.2 // indirect
github.com/google/flatbuffers v23.5.26+incompatible // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/pprof v0.0.0-20240125082051-42cd04596328 // indirect
github.com/google/pprof v0.0.0-20240130152714-0ed6a68c8d9e // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.5 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf // indirect
github.com/jedib0t/go-pretty/v6 v6.5.3 // indirect
github.com/jedib0t/go-pretty/v6 v6.5.4 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/compress v1.17.5 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
Expand All @@ -177,6 +177,7 @@ require (
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/naoina/go-stringutil v0.1.0 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/nutsdb/nutsdb v1.0.4-0.20240108030426-a4ca1b95b3d6 // indirect
github.com/nxadm/tail v1.4.11 // indirect
github.com/oapi-codegen/runtime v1.1.1 // indirect
Expand Down Expand Up @@ -217,7 +218,7 @@ require (
github.com/tklauser/numcpus v0.7.0 // indirect
github.com/ucwong/filecache v1.0.6-0.20230405163841-810d53ced4bd // indirect
github.com/ucwong/go-ttlmap v1.0.2-0.20221020173635-331e7ddde2bb // indirect
github.com/ucwong/golang-kv v1.0.24-0.20240123222739-ef750e9bde39 // indirect
github.com/ucwong/golang-kv v1.0.24-0.20240202153641-e1b6e9221f93 // indirect
github.com/ucwong/shard v1.0.1-0.20231225143310-3022d14f9c3e // indirect
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e // indirect
github.com/xujiajun/mmap-go v1.0.1 // indirect
Expand All @@ -233,7 +234,7 @@ require (
golang.org/x/net v0.20.0 // indirect
golang.org/x/term v0.16.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/libc v1.40.8 // indirect
modernc.org/libc v1.40.13 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.7.2 // indirect
modernc.org/sqlite v1.28.0 // indirect
Expand Down
Loading