Skip to content

Commit

Permalink
add header version
Browse files Browse the repository at this point in the history
  • Loading branch information
avalonche committed Feb 13, 2024
1 parent e505092 commit 78b0c1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion beaconclient/prod_beacon_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"net/http"
"os"
"strings"
"time"

"github.com/attestantio/go-eth2-client/spec/capella"
Expand Down Expand Up @@ -249,7 +250,7 @@ func (c *ProdBeaconInstance) PublishBlock(block *common.VersionedSignedProposal,
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)
}

Expand Down

0 comments on commit 78b0c1b

Please sign in to comment.