Skip to content

Commit 876c490

Browse files
authored
Add support for Fulu (#805)
1 parent fe8d4c5 commit 876c490

File tree

12 files changed

+660
-144
lines changed

12 files changed

+660
-144
lines changed

common/common.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ import (
1010

1111
const (
1212
SlotTimeSecMainnet = 12
13+
// FieldElementsPerBlob is the number of field elements needed to represent a blob.
14+
FieldElementsPerBlob = 4096
15+
// BlobExpansionFactor is the factor by which we extend a blob for PeerDAS.
16+
BlobExpansionFactor = 2
17+
// FieldElementsPerCell is the number of field elements in a cell.
18+
FieldElementsPerCell = 64
19+
BytesPerFieldElement = 32
20+
// FieldElementsPerExtBlob is the number of field elements needed to represent an extended blob.
21+
FieldElementsPerExtBlob = FieldElementsPerBlob * BlobExpansionFactor
22+
// CellsPerExtBlob is the number of cells in an extended blob.
23+
CellsPerExtBlob = FieldElementsPerExtBlob / FieldElementsPerCell
1324
)
1425

1526
func GetEnv(key, defaultValue string) string {

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ require (
3737

3838
require (
3939
github.com/attestantio/go-builder-client v0.6.1
40-
github.com/attestantio/go-eth2-client v0.25.0
40+
github.com/attestantio/go-eth2-client v0.25.1-0.20250603135601-6ac0bfda7fda
4141
github.com/davecgh/go-spew v1.1.1 // indirect
4242
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
4343
github.com/ferranbt/fastssz v0.1.4 // indirect
@@ -60,3 +60,5 @@ require (
6060
gopkg.in/yaml.v2 v2.4.0 // indirect
6161
gopkg.in/yaml.v3 v3.0.1 // indirect
6262
)
63+
64+
replace github.com/attestantio/go-builder-client => github.com/jtraglia/go-builder-client v0.4.6-0.20250410195459-42a3ff7f1546

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI=
22
github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI=
3-
github.com/attestantio/go-builder-client v0.6.1 h1:fn6PC8aDWx2YbptstR1JKP8NyakiNJJTiOE5f9N0z5Q=
4-
github.com/attestantio/go-builder-client v0.6.1/go.mod h1:f8wi3HzuPxfJoi2PirpJK3yZhte4SavDgKJbRrKoB1Q=
5-
github.com/attestantio/go-eth2-client v0.25.0 h1:wLQxoteGCbTE/vKCMASx1ze+Zm9rcqtltRnblaLJup4=
6-
github.com/attestantio/go-eth2-client v0.25.0/go.mod h1:fvULSL9WtNskkOB4i+Yyr6BKpNHXvmpGZj9969fCrfY=
3+
github.com/attestantio/go-eth2-client v0.25.1-0.20250603135601-6ac0bfda7fda h1:Wc7YGICtTWKNZvMjpIN/l6HKTj9POEU9N67NIWWWOk0=
4+
github.com/attestantio/go-eth2-client v0.25.1-0.20250603135601-6ac0bfda7fda/go.mod h1:fvULSL9WtNskkOB4i+Yyr6BKpNHXvmpGZj9969fCrfY=
75
github.com/bits-and-blooms/bitset v1.22.0 h1:Tquv9S8+SGaS3EhyA+up3FXzmkhxPGjQQCkcs2uw7w4=
86
github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
97
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
@@ -59,6 +57,8 @@ github.com/huandu/go-clone v1.7.2 h1:3+Aq0Ed8XK+zKkLjE2dfHg0XrpIfcohBE1K+c8Usxoo
5957
github.com/huandu/go-clone v1.7.2/go.mod h1:ReGivhG6op3GYr+UY3lS6mxjKp7MIGTknuU5TbTVaXE=
6058
github.com/huandu/go-clone/generic v1.6.0 h1:Wgmt/fUZ28r16F2Y3APotFD59sHk1p78K0XLdbUYN5U=
6159
github.com/huandu/go-clone/generic v1.6.0/go.mod h1:xgd9ZebcMsBWWcBx5mVMCoqMX24gLWr5lQicr+nVXNs=
60+
github.com/jtraglia/go-builder-client v0.4.6-0.20250410195459-42a3ff7f1546 h1:UnMUnbUz6fiJ1Ox7hNMkAS6T+Vcdy2qjo9q2D3q8zqg=
61+
github.com/jtraglia/go-builder-client v0.4.6-0.20250410195459-42a3ff7f1546/go.mod h1:3Z2KfjbuX2EmJajEmDb3I/JdDqzlm4WsojnCugO0oM0=
6262
github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
6363
github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
6464
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=

server/constants.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ const (
1717
EthConsensusVersionCapella = "capella"
1818
EthConsensusVersionDeneb = "deneb"
1919
EthConsensusVersionElectra = "electra"
20+
EthConsensusVersionFulu = "fulu"
2021
)

server/get_header.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ func decodeBid(respBytes []byte, respContentType, ethConsensusVersion string, bi
279279
bid.Version = spec.DataVersionElectra
280280
bid.Electra = new(builderApiElectra.SignedBuilderBid)
281281
return bid.Electra.UnmarshalSSZ(respBytes)
282+
case EthConsensusVersionFulu:
283+
bid.Version = spec.DataVersionFulu
284+
bid.Fulu = new(builderApiElectra.SignedBuilderBid)
285+
return bid.Fulu.UnmarshalSSZ(respBytes)
282286
default:
283287
return errInvalidForkVersion
284288
}
@@ -322,6 +326,9 @@ func (m *BoostService) respondGetHeaderSSZ(w http.ResponseWriter, result *bidRes
322326
case spec.DataVersionElectra:
323327
w.Header().Set(HeaderEthConsensusVersion, EthConsensusVersionElectra)
324328
sszData, err = result.response.Electra.MarshalSSZ()
329+
case spec.DataVersionFulu:
330+
w.Header().Set(HeaderEthConsensusVersion, EthConsensusVersionFulu)
331+
sszData, err = result.response.Fulu.MarshalSSZ()
325332
case spec.DataVersionUnknown, spec.DataVersionPhase0, spec.DataVersionAltair:
326333
err = errInvalidForkVersion
327334
}

0 commit comments

Comments
 (0)