Skip to content

Commit d67a8e3

Browse files
authored
Merge branch 'main' into bound-cached-states
2 parents 49bdb54 + 7ed55d1 commit d67a8e3

File tree

17 files changed

+238
-35
lines changed

17 files changed

+238
-35
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
-----BEGIN PGP PUBLIC KEY BLOCK-----
22

33
mDMEaIky1hYJKwYBBAHaRw8BAQdAnxP3mNWC+miF0OKvOg4+BzzswbrTWLbluSJU
4-
+NBib3q0H2NhbGJlcmEgPGNhbGJlcmFAYmVyYWNoYWluLmNvbT6ImQQTFgoAQRYh
5-
BPzFjSePGuMIYGS4P/GUiPGD4kvxBQJoiTLWAhsDBQkAdqcABQsJCAcCAiICBhUK
6-
CQgLAgQWAgMBAh4HAheAAAoJEPGUiPGD4kvxA9oBANZQa+Q6UlhDPLOOhchdPSi7
7-
lmBE+za+5u5Q3bA7ZO8rAP46R+a1AxHqeLrShhkTvJwTG+qGvfS/LtHfNYLHqOQw
8-
Bbg4BGiJMtYSCisGAQQBl1UBBQEBB0A6onCspxjhXI7X13LHlUYQxYVyzUDamgVP
4+
+NBib3q0H2NhbGJlcmEgPGNhbGJlcmFAYmVyYWNoYWluLmNvbT6ImQQTFgoAQQIb
5+
AwULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIXgBYhBPzFjSePGuMIYGS4P/GUiPGD
6+
4kvxBQJpCMZdBQkA9jqHAAoJEPGUiPGD4kvxkpkA/0uwFK4PSHs+exgROaFBOMEd
7+
39DWEizFfQQIbdCc/z//AQCgk/rLrY9LGOc3MLOKJAA8VxVskdZlYzAQ/6HgO+bD
8+
ALg4BGiJMtYSCisGAQQBl1UBBQEBB0A6onCspxjhXI7X13LHlUYQxYVyzUDamgVP
99
hXYTLZ1QEAMBCAeIfgQYFgoAJhYhBPzFjSePGuMIYGS4P/GUiPGD4kvxBQJoiTLW
1010
AhsMBQkAdqcAAAoJEPGUiPGD4kvxWOAA/0IedfbPuCJU/IWo+gxCZMl9Fb7oVA4L
1111
v9lMBtnspGsxAQDRX3fFP/Bv96wHlUWQHg01TSaWNyTQa5dTpjEcLxnXCQ==
12-
=L8oL
12+
=Xha4
1313
-----END PGP PUBLIC KEY BLOCK-----

.github/workflows/pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
- name: Setup Golang
9191
uses: actions/setup-go@v5
9292
with:
93-
go-version: "1.25.3"
93+
go-version: "1.25.5"
9494
check-latest: true
9595
cache-dependency-path: "**/*.sum"
9696
if: ${{ !(matrix.args == 'test-forge-cover' || matrix.args == 'test-forge-fuzz') }}
@@ -154,7 +154,7 @@ jobs:
154154
- name: Setup Golang
155155
uses: actions/setup-go@v5
156156
with:
157-
go-version: "1.25.3"
157+
go-version: "1.25.5"
158158
check-latest: true
159159
cache-dependency-path: "**/*.sum"
160160
- name: Set up QEMU

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
- uses: actions/checkout@v3
7373
- uses: actions/setup-go@v3
7474
with:
75-
go-version: "1.25.3"
75+
go-version: "1.25.5"
7676
env:
7777
GOOS: ${{ matrix.configs.target-os }}
7878
GOARCH: ${{ matrix.configs.arch }}

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ func ProvideBlockchainService(
722722
## Build Requirements
723723

724724
### Dependencies
725-
- Go 1.25.3+
725+
- Go 1.25.5+
726726
- Docker (for running EL clients)
727727
- Foundry (for Solidity contracts)
728728
- Make (GNU Make)

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
### Stage 0 - Build Arguments ###
1919
#######################################################
2020

21-
ARG GO_VERSION=1.25.3
21+
ARG GO_VERSION=1.25.5
2222
ARG RUNNER_IMAGE=alpine:3.20
2323
ARG BUILD_TAGS="netgo,muslc,blst,bls12381,pebbledb"
2424
ARG NAME=beacond

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ BeaconKit supports the following execution clients:
4040
**Prerequisites:**
4141

4242
- [Docker](https://docs.docker.com/engine/install/)
43-
- [Golang 1.25.3+](https://go.dev/doc/install)
43+
- [Golang 1.25.5+](https://go.dev/doc/install)
4444
- [Foundry](https://book.getfoundry.sh/)
4545

4646
Start by opening two terminals side-by-side:

cli/commands/genesis/deposit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func AddGenesisDeposit(
158158

159159
func makeOutputFilepath(rootDir, pubkey string) (string, error) {
160160
writePath := filepath.Join(rootDir, "config", "premined-deposits")
161-
if err := afero.NewOsFs().MkdirAll(writePath, os.ModePerm); err != nil {
161+
if err := afero.NewOsFs().MkdirAll(writePath, 0o700); err != nil { //nolint:mnd // dir permissions.
162162
return "", errors.Wrapf(
163163
errors.New("could not create directory"), "%q: %w",
164164
writePath,

cli/commands/initialize/initialize.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func InitCmd(creator clitypes.ChainSpecCreator, mm interface {
187187

188188
chainSpec, err := creator(context.GetViperFromCmd(cmd))
189189
if err != nil {
190-
return fmt.Errorf("faile to create chain spec: %w", err)
190+
return fmt.Errorf("failed to create chain spec: %w", err)
191191
}
192192
appGenState := mm.DefaultGenesis(chainSpec)
193193

cli/commands/jwt/jwt.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ const (
3636
FlagOutputPath = "output-path"
3737
FlagInputPath = "input-path"
3838
ConfigFolder = "config"
39+
40+
secretDirPerms os.FileMode = 0o700
41+
secretFilePerms os.FileMode = 0o600
3942
)
4043

4144
// Commands creates a new command for managing JWT secrets.
@@ -143,7 +146,7 @@ func generateAuthSecretInFile(cmd *cobra.Command, fileName string) error {
143146
}
144147

145148
if !exists {
146-
if err = fs.MkdirAll(fileDir, os.ModePerm); err != nil {
149+
if err = fs.MkdirAll(fileDir, secretDirPerms); err != nil {
147150
return err
148151
}
149152
}
@@ -153,12 +156,24 @@ func generateAuthSecretInFile(cmd *cobra.Command, fileName string) error {
153156
return err
154157
}
155158

159+
fileExists, err := afero.Exists(fs, fileName)
160+
if err != nil {
161+
return err
162+
}
163+
156164
if err = afero.WriteFile(
157-
fs, fileName, []byte(secret.Hex()), os.ModePerm,
165+
fs, fileName, []byte(secret.Hex()), secretFilePerms,
158166
); err != nil {
159167
return err
160168
}
161169

170+
// WriteFile only sets permissions on file creation, so explicitly chmod if the file already existed.
171+
if fileExists {
172+
if err = fs.Chmod(fileName, secretFilePerms); err != nil {
173+
return err
174+
}
175+
}
176+
162177
cmd.Printf(
163178
"Successfully wrote new JSON-RPC authentication secret to: %s",
164179
fileName,

cli/commands/jwt/jwt_test.go

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,52 @@ func Test_NewGenerateJWTCommand(t *testing.T) {
106106
})
107107
}
108108

109+
func Test_GenerateJWTCommand_FilePermissions(t *testing.T) {
110+
t.Parallel()
111+
112+
t.Run("new file should have 0600 permissions", func(t *testing.T) {
113+
tempDir := t.TempDir()
114+
outputPath := filepath.Join(tempDir, "jwt.hex")
115+
116+
cmd := jwt.NewGenerateJWTCommand()
117+
cmd.SetArgs([]string{"--output-path", outputPath})
118+
require.NoError(t, cmd.Execute())
119+
120+
info, err := os.Stat(outputPath)
121+
require.NoError(t, err)
122+
require.Equal(t, os.FileMode(0600), info.Mode().Perm(),
123+
"new JWT file should have 0600 permissions")
124+
})
125+
126+
t.Run("pre-existing file with permissive permissions should be fixed", func(t *testing.T) {
127+
tempDir := t.TempDir()
128+
outputPath := filepath.Join(tempDir, "jwt.hex")
129+
130+
// Create file with world-readable permissions
131+
err := os.WriteFile(outputPath, []byte("old_content"), 0755)
132+
require.NoError(t, err)
133+
134+
// Verify it has permissive permissions
135+
info, err := os.Stat(outputPath)
136+
require.NoError(t, err)
137+
require.Equal(t, os.FileMode(0755), info.Mode().Perm())
138+
139+
// Run the generate command
140+
cmd := jwt.NewGenerateJWTCommand()
141+
cmd.SetArgs([]string{"--output-path", outputPath})
142+
require.NoError(t, cmd.Execute())
143+
144+
// Verify permissions are now restricted
145+
info, err = os.Stat(outputPath)
146+
require.NoError(t, err)
147+
require.Equal(t, os.FileMode(0600), info.Mode().Perm(),
148+
"pre-existing JWT file should have permissions fixed to 0600")
149+
150+
// Also verify the content is valid
151+
checkAuthFileIntegrity(t, outputPath)
152+
})
153+
}
154+
109155
func checkAuthFileIntegrity(tb testing.TB, fPath string) {
110156
tb.Helper()
111157
fs := afero.NewOsFs()

0 commit comments

Comments
 (0)