Skip to content

Commit 32ce96b

Browse files
authored
*: v1.6.0-rc4 cherry-picking (#3928)
Cherry-picking for v1.6.0-rc4. category: misc ticket: none
1 parent 1624952 commit 32ce96b

File tree

21 files changed

+37
-50
lines changed

21 files changed

+37
-50
lines changed

.github/workflows/build-release-binaries.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ jobs:
2020
id: setup-go
2121

2222
- name: Set version from git tag
23-
if: github.ref_type == 'tag'
2423
run: |
25-
echo "APP_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
24+
echo "VCS_REVISION=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV
25+
echo "VCS_TIME=$(git log -1 --format="%cd" --date=iso-strict $GITHUB_SHA)" >> $GITHUB_ENV
2626
echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
27-
echo "LDFLAGS_VALUE=-X github.com/obolnetwork/charon/app/version.version=${{ github.ref_name }}" >> $GITHUB_ENV
27+
28+
- name: Construct LDFLAGS_VALUE
29+
run: |
30+
LDFLAGS_VALUE=$'-X github.com/obolnetwork/charon/app/version.version=${{ github.ref_name }} -X github.com/obolnetwork/charon/app/version.vcsRevision=${{ env.VCS_REVISION }} -X github.com/obolnetwork/charon/app/version.vcsTime=${{ env.VCS_TIME }}'
31+
echo "LDFLAGS_VALUE=${LDFLAGS_VALUE}" >> $GITHUB_ENV
2832
2933
- name: Build x86_64 binary
3034
env:

.github/workflows/govulncheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v5
1515
- uses: ./.github/actions/setup-go
16-
- run: go install golang.org/x/vuln/cmd/[email protected].3
16+
- run: go install golang.org/x/vuln/cmd/[email protected].4
1717
- run: govulncheck -show=traces -test ./...

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
${{ runner.os }}-go-
2626
- run: go test -coverprofile=coverage.out -covermode=atomic -timeout=5m -race ./...
2727
- name: Upload coverage to Codecov
28-
uses: codecov/codecov-action@v5.4.3
28+
uses: codecov/codecov-action@v5.5.0
2929
with:
3030
token: ${{ secrets.CODECOV_TOKEN }}
3131
files: coverage.out

app/eth2wrap/synthproposer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func IsSyntheticProposal(block *eth2api.VersionedSignedProposal) bool {
270270
return graffiti == GetSyntheticGraffiti()
271271
}
272272

273-
// synthProposerCache returns a new cache for synthetic proposer duties.
273+
// newSynthProposerCache returns a new cache for synthetic proposer duties.
274274
func newSynthProposerCache() *synthProposerCache {
275275
return &synthProposerCache{
276276
duties: make(map[eth2p0.Epoch][]*eth2v1.ProposerDuty),

app/log/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ var level4Map = map[zapcore.Level]string{
508508
zapcore.FatalLevel: "FATL",
509509
}
510510

511-
// level4CharEncoder adapts zapcore CapitalColorLevelEncoder but trims level strings to 4 characters.
511+
// newLevel4CharEncoder adapts zapcore CapitalColorLevelEncoder but trims level strings to 4 characters.
512512
func newLevel4CharEncoder(color bool) zapcore.LevelEncoder {
513513
return func(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder) {
514514
replace, ok := level4Map[l]

app/log/loki/lokipb/v1/loki.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/peerinfo/peerinfopb/v1/peerinfo.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/protonil/testdata/v1/test.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/version/version.go

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"context"
77
"fmt"
88
"regexp"
9-
"runtime/debug"
109
"strconv"
1110

1211
"github.com/obolnetwork/charon/app/errors"
@@ -22,6 +21,12 @@ var version = "v1.6-rc"
2221
// - Release branch: v0.Y-rc
2322
var Version, _ = Parse(version) // Error is caught in tests.
2423

24+
var (
25+
// These variables are populated with build information via -ldflags.
26+
vcsRevision = "unknown"
27+
vcsTime = "unknown"
28+
)
29+
2530
// Supported returns the supported minor versions in order of precedence.
2631
func Supported() []SemVer {
2732
return []SemVer{
@@ -37,29 +42,7 @@ func Supported() []SemVer {
3742

3843
// GitCommit returns the git commit hash and timestamp from build info.
3944
func GitCommit() (hash string, timestamp string) {
40-
hash, timestamp = "unknown", "unknown"
41-
hashLen := 7
42-
43-
info, ok := debug.ReadBuildInfo()
44-
if !ok {
45-
return hash, timestamp
46-
}
47-
48-
for _, s := range info.Settings {
49-
switch s.Key {
50-
case "vcs.revision":
51-
if len(s.Value) < hashLen {
52-
hashLen = len(s.Value)
53-
}
54-
55-
hash = s.Value[:hashLen]
56-
case "vcs.time":
57-
timestamp = s.Value
58-
default:
59-
}
60-
}
61-
62-
return hash, timestamp
45+
return vcsRevision, vcsTime
6346
}
6447

6548
// LogInfo logs charon version information along-with the provided message.

cluster/manifestpb/v1/manifest.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)