Skip to content

Commit 201b86f

Browse files
authored
Merge pull request #56 from ethpandaops/remove-fastssz
replace fastssz with dynamic-ssz & bump go version
2 parents f1c55ab + 9e6afcb commit 201b86f

File tree

11 files changed

+53
-47
lines changed

11 files changed

+53
-47
lines changed

.github/workflows/_shared-build.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- name: Set up go
5555
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
5656
with:
57-
go-version: 1.24.x
57+
go-version: 1.25.x
5858

5959
# setup project dependencies
6060
- name: Get dependencies
@@ -87,7 +87,7 @@ jobs:
8787
- name: Set up go
8888
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
8989
with:
90-
go-version: 1.24.x
90+
go-version: 1.25.x
9191

9292
# setup cross build libs
9393
- name: Get cross build dependencies
@@ -126,7 +126,7 @@ jobs:
126126
- name: Set up go
127127
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
128128
with:
129-
go-version: 1.24.x
129+
go-version: 1.25.x
130130

131131
# setup project dependencies
132132
- name: Get dependencies
@@ -159,7 +159,7 @@ jobs:
159159
- name: Set up go
160160
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
161161
with:
162-
go-version: 1.24.x
162+
go-version: 1.25.x
163163

164164
# setup project dependencies
165165
- name: Get dependencies
@@ -192,7 +192,7 @@ jobs:
192192
- name: Set up go
193193
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
194194
with:
195-
go-version: 1.24.x
195+
go-version: 1.25.x
196196

197197
# setup project dependencies
198198
- name: Get dependencies

.github/workflows/_shared-check.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up go
1616
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
1717
with:
18-
go-version: 1.24.x
18+
go-version: 1.25.x
1919

2020
- name: Verify dependencies
2121
run: go mod verify
@@ -36,7 +36,7 @@ jobs:
3636
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
3737
with:
3838
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
39-
version: v2.3.1
39+
version: v2.7.2
4040

4141
# Optional: working directory, useful for monorepos
4242
# working-directory: somedir

.golangci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ linters:
2626
- unparam
2727
- unused
2828
- whitespace
29-
- wsl
29+
- wsl_v5
3030
settings:
3131
errcheck:
3232
check-type-assertions: true
@@ -43,6 +43,10 @@ linters:
4343
nolintlint:
4444
require-explanation: false
4545
require-specific: true
46+
wsl_v5:
47+
allow-first-in-block: true
48+
allow-whole-block: false
49+
branch-max-lines: 2
4650
exclusions:
4751
generated: lax
4852
presets:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# build env
2-
FROM golang:1.24 AS build-env
2+
FROM golang:1.25 AS build-env
33
COPY go.mod go.sum /src/
44
WORKDIR /src
55
RUN go mod download

beaconutils/depositroot.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package beaconutils
22

33
import (
44
"github.com/attestantio/go-eth2-client/spec/phase0"
5-
ssz "github.com/ferranbt/fastssz"
5+
"github.com/pk910/dynamic-ssz/sszutils"
66

77
"github.com/ethpandaops/eth-beacon-genesis/beaconconfig"
88
)
@@ -12,7 +12,7 @@ func ComputeDepositRoot(cfg *beaconconfig.Config) (phase0.Root, error) {
1212
// since that is what we put as eth1_data.deposit_root in the CL genesis state.
1313
maxDeposits := cfg.GetUintDefault("MAX_DEPOSITS_PER_PAYLOAD", 1<<cfg.GetUintDefault("DEPOSIT_CONTRACT_TREE_DEPTH", 32))
1414

15-
depositRoot, _ := HashWithFastSSZHasher(func(hh *ssz.Hasher) error {
15+
depositRoot, _ := HashWithFastSSZHasher(func(hh sszutils.HashWalker) error {
1616
hh.MerkleizeWithMixin(0, 0, maxDeposits)
1717
return nil
1818
})

beaconutils/fastssz.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
package beaconutils
22

3-
import ssz "github.com/ferranbt/fastssz"
3+
import (
4+
"github.com/pk910/dynamic-ssz/hasher"
5+
"github.com/pk910/dynamic-ssz/sszutils"
6+
)
47

58
// HashWithFastSSZHasher runs a callback with a Hasher from the default fastssz HasherPool
6-
func HashWithFastSSZHasher(cb func(hh *ssz.Hasher) error) ([32]byte, error) {
7-
hh := ssz.DefaultHasherPool.Get()
9+
func HashWithFastSSZHasher(cb func(hh sszutils.HashWalker) error) ([32]byte, error) {
10+
hh := hasher.DefaultHasherPool.Get()
811
if err := cb(hh); err != nil {
9-
ssz.DefaultHasherPool.Put(hh)
12+
hasher.DefaultHasherPool.Put(hh)
1013
return [32]byte{}, err
1114
}
1215

1316
root, err := hh.HashRoot()
14-
ssz.DefaultHasherPool.Put(hh)
17+
hasher.DefaultHasherPool.Put(hh)
1518

1619
return root, err
1720
}

beaconutils/transactions.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/attestantio/go-eth2-client/spec/bellatrix"
77
"github.com/attestantio/go-eth2-client/spec/phase0"
88
"github.com/ethereum/go-ethereum/core/types"
9-
ssz "github.com/ferranbt/fastssz"
9+
"github.com/pk910/dynamic-ssz/sszutils"
1010

1111
"github.com/ethpandaops/eth-beacon-genesis/beaconconfig"
1212
)
@@ -35,7 +35,7 @@ func ComputeTransactionsRoot(transactions types.Transactions, cfg *beaconconfig.
3535

3636
maxBytesPerTx := cfg.GetUintDefault("MAX_BYTES_PER_TRANSACTION", 1073741824)
3737

38-
transactionsRoot, err := HashWithFastSSZHasher(func(hh *ssz.Hasher) error {
38+
transactionsRoot, err := HashWithFastSSZHasher(func(hh sszutils.HashWalker) error {
3939
for i, elem := range clTransactions {
4040
elemIndx := hh.Index()
4141
byteLen := uint64(len(elem))

beaconutils/validators.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package beaconutils
22

33
import (
44
"github.com/attestantio/go-eth2-client/spec/phase0"
5-
ssz "github.com/ferranbt/fastssz"
5+
"github.com/pk910/dynamic-ssz/sszutils"
66

77
"github.com/ethpandaops/eth-beacon-genesis/beaconconfig"
88
"github.com/ethpandaops/eth-beacon-genesis/validators"
@@ -73,7 +73,8 @@ func GetGenesisValidators(cfg *beaconconfig.Config, vals []*validators.Validator
7373
}
7474

7575
maxValidators := cfg.GetUintDefault("VALIDATOR_REGISTRY_LIMIT", 1099511627776)
76-
validatorsRoot, err := HashWithFastSSZHasher(func(hh *ssz.Hasher) error {
76+
77+
validatorsRoot, err := HashWithFastSSZHasher(func(hh sszutils.HashWalker) error {
7778
for _, elem := range clValidators {
7879
if err := elem.HashTreeRootWith(hh); err != nil {
7980
return err
@@ -84,7 +85,6 @@ func GetGenesisValidators(cfg *beaconconfig.Config, vals []*validators.Validator
8485

8586
return nil
8687
})
87-
8888
if err != nil {
8989
return nil, phase0.Root{}
9090
}

beaconutils/withdrawals.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/attestantio/go-eth2-client/spec/capella"
88
"github.com/attestantio/go-eth2-client/spec/phase0"
99
"github.com/ethereum/go-ethereum/core/types"
10-
ssz "github.com/ferranbt/fastssz"
10+
"github.com/pk910/dynamic-ssz/sszutils"
1111

1212
"github.com/ethpandaops/eth-beacon-genesis/beaconconfig"
1313
)
@@ -38,7 +38,7 @@ func ComputeWithdrawalsRoot(withdrawals types.Withdrawals, cfg *beaconconfig.Con
3838
}
3939
}
4040

41-
withdrawalsRoot, _ := HashWithFastSSZHasher(func(hh *ssz.Hasher) error {
41+
withdrawalsRoot, _ := HashWithFastSSZHasher(func(hh sszutils.HashWalker) error {
4242
for _, elem := range clWithdrawals {
4343
elem.HashTreeRootWith(hh) //nolint:errcheck // no error possible
4444
}

go.mod

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
module github.com/ethpandaops/eth-beacon-genesis
22

3-
go 1.24.0
3+
go 1.25.0
44

55
require (
66
github.com/attestantio/go-eth2-client v0.26.0
7-
github.com/ethereum/go-ethereum v1.16.7
8-
github.com/ferranbt/fastssz v1.0.0
7+
github.com/ethereum/go-ethereum v1.16.8
98
github.com/herumi/bls-eth-go-binary v1.37.0
109
github.com/holiman/uint256 v1.3.2
11-
github.com/pk910/dynamic-ssz v1.1.1
10+
github.com/pk910/dynamic-ssz v1.2.0
1211
github.com/protolambda/bls12-381-util v0.1.0
13-
github.com/sirupsen/logrus v1.9.3
12+
github.com/sirupsen/logrus v1.9.4
1413
github.com/tyler-smith/go-bip39 v1.1.0
15-
github.com/urfave/cli/v3 v3.6.0
14+
github.com/urfave/cli/v3 v3.6.2
1615
github.com/wealdtech/go-eth2-util v1.8.2
17-
golang.org/x/sync v0.18.0
16+
golang.org/x/sync v0.19.0
1817
gopkg.in/yaml.v3 v3.0.1
1918
)
2019

2120
require (
2221
github.com/Microsoft/go-winio v0.6.2 // indirect
23-
github.com/OffchainLabs/hashtree v0.2.1-0.20250530191054-577f0b75c7f7 // indirect
2422
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 // indirect
2523
github.com/StackExchange/wmi v1.2.1 // indirect
2624
github.com/VictoriaMetrics/fastcache v1.13.0 // indirect
@@ -38,6 +36,7 @@ require (
3836
github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect
3937
github.com/ethereum/go-verkle v0.2.2 // indirect
4038
github.com/fatih/color v1.18.0 // indirect
39+
github.com/ferranbt/fastssz v1.0.0 // indirect
4140
github.com/go-logr/logr v1.2.4 // indirect
4241
github.com/go-logr/stdr v1.2.2 // indirect
4342
github.com/go-ole/go-ole v1.3.0 // indirect
@@ -49,14 +48,15 @@ require (
4948
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
5049
github.com/huandu/go-clone v1.6.0 // indirect
5150
github.com/kilic/bls12-381 v0.1.0 // indirect
52-
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
51+
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
5352
github.com/mattn/go-colorable v0.1.14 // indirect
5453
github.com/mattn/go-isatty v0.0.20 // indirect
5554
github.com/mattn/go-runewidth v0.0.13 // indirect
5655
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
5756
github.com/minio/sha256-simd v1.0.1 // indirect
5857
github.com/mitchellh/mapstructure v1.5.0 // indirect
5958
github.com/olekukonko/tablewriter v0.0.5 // indirect
59+
github.com/pk910/hashtree-bindings v0.0.1 // indirect
6060
github.com/pkg/errors v0.9.1 // indirect
6161
github.com/prometheus/client_golang v1.16.0 // indirect
6262
github.com/prometheus/client_model v0.3.0 // indirect

0 commit comments

Comments
 (0)