Skip to content

Commit

Permalink
Use go-*-client@electra
Browse files Browse the repository at this point in the history
  • Loading branch information
jtraglia committed May 9, 2024
1 parent 8e76952 commit 9442e53
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
10 changes: 2 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ require (

require (
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/attestantio/go-builder-client v0.4.2
github.com/attestantio/go-eth2-client v0.21.1
github.com/attestantio/go-builder-client v0.4.6-0.20240508205504-2210689d2f24
github.com/attestantio/go-eth2-client v0.21.4-0.20240508205406-66fbb02e3c16
github.com/btcsuite/btcd v0.22.0-beta // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
Expand All @@ -87,9 +87,3 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

// git clone [email protected]:jtraglia/go-eth2-client.git -b electra
replace github.com/attestantio/go-eth2-client => ../../jtraglia/go-eth2-client

// git clone [email protected]:jtraglia/go-builder-client.git -b electra
replace github.com/attestantio/go-builder-client => ../../jtraglia/go-builder-client
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWk
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/attestantio/go-builder-client v0.4.6-0.20240508205504-2210689d2f24 h1:KXWQwsxrrJD1G7rp+18uESZ0BSPmUdady46iAfCgwDY=
github.com/attestantio/go-builder-client v0.4.6-0.20240508205504-2210689d2f24/go.mod h1:bs7HF4beRWCjcvKsHH8nEl3aDzrTqeUjXOfqpfrYTJQ=
github.com/attestantio/go-eth2-client v0.21.4-0.20240508205406-66fbb02e3c16 h1:gwMEOhFdbmCJy5olyRtGPmM4RoIXo6v2HkbKt7YpPr4=
github.com/attestantio/go-eth2-client v0.21.4-0.20240508205406-66fbb02e3c16/go.mod h1:Ht9tN0WlhpgIWWO7Hqfi3/nq2rUGQv/zCd/BMI93a84=
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
Expand Down
6 changes: 3 additions & 3 deletions server/mock/mock_relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,15 @@ func (m *Relay) MakeGetHeaderResponse(value uint64, blockHash, parentHash, publi
case spec.DataVersionElectra:
message := &builderApiElectra.BuilderBid{
Header: &electra.ExecutionPayloadHeader{
BlockHash: _HexToHash(blockHash),
ParentHash: _HexToHash(parentHash),
BlockHash: HexToHash(blockHash),
ParentHash: HexToHash(parentHash),
WithdrawalsRoot: phase0.Root{},
BaseFeePerGas: uint256.NewInt(0),
WithdrawalRequestsRoot: phase0.Root{},
},
BlobKZGCommitments: make([]deneb.KZGCommitment, 0),
Value: uint256.NewInt(value),
Pubkey: _HexToPubkey(publicKey),
Pubkey: HexToPubkey(publicKey),
}

// Sign the message.
Expand Down
6 changes: 3 additions & 3 deletions server/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,9 +822,9 @@ func (m *BoostService) processElectraPayload(w http.ResponseWriter, req *http.Re

for _, relay := range m.relays {
wg.Add(1)
go func(relay RelayEntry) {
go func(relay types.RelayEntry) {
defer wg.Done()
url := relay.GetURI(pathGetPayload)
url := relay.GetURI(params.PathGetPayload)
log := log.WithField("url", url)
log.Debug("calling getPayload")

Expand Down Expand Up @@ -898,7 +898,7 @@ func (m *BoostService) processElectraPayload(w http.ResponseWriter, req *http.Re

// If no payload has been received from relay, log loudly about withholding!
if getPayloadResponseIsEmpty(result) {
originRelays := RelayEntriesToStrings(originalBid.relays)
originRelays := types.RelayEntriesToStrings(originalBid.relays)
log.WithField("relaysWithBid", strings.Join(originRelays, ", ")).Error("no payload received from relay!")
m.respondError(w, http.StatusBadGateway, errNoSuccessfulRelayResponse.Error())
return
Expand Down

0 comments on commit 9442e53

Please sign in to comment.