diff --git a/beaconclient/prod_beacon_instance.go b/beaconclient/prod_beacon_instance.go index 15e0695e..24dd1b97 100644 --- a/beaconclient/prod_beacon_instance.go +++ b/beaconclient/prod_beacon_instance.go @@ -5,6 +5,7 @@ import ( "fmt" "net/http" "os" + "strings" "time" "github.com/attestantio/go-eth2-client/spec/capella" @@ -244,12 +245,12 @@ func (c *ProdBeaconInstance) GetURI() string { func (c *ProdBeaconInstance) PublishBlock(block *common.VersionedSignedProposal, broadcastMode BroadcastMode) (code int, err error) { var uri string if c.ffUseV1PublishBlockEndpoint { - uri = fmt.Sprintf("%s/eth/v2/beacon/blocks?broadcast_validation=%s", c.beaconURI, broadcastMode) - } else { uri = fmt.Sprintf("%s/eth/v1/beacon/blocks", c.beaconURI) + } else { + uri = fmt.Sprintf("%s/eth/v2/beacon/blocks?broadcast_validation=%s", c.beaconURI, broadcastMode) } headers := http.Header{} - headers.Add("Eth-Consensus-Version", common.ForkVersionStringCapella) // optional in v1, required in v2 + headers.Add("Eth-Consensus-Version", strings.ToLower(block.Version.String())) // optional in v1, required in v2 return fetchBeacon(http.MethodPost, uri, block, nil, nil, headers, false) }