From 3c35d00906dabba504722aff130cc94015526e3c Mon Sep 17 00:00:00 2001 From: qiang Date: Sat, 16 Mar 2024 15:38:42 +0800 Subject: [PATCH 1/2] beacon url --- ethstorage/eth/beacon_client.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ethstorage/eth/beacon_client.go b/ethstorage/eth/beacon_client.go index 4605e863..2c221483 100644 --- a/ethstorage/eth/beacon_client.go +++ b/ethstorage/eth/beacon_client.go @@ -8,9 +8,11 @@ import ( "encoding/json" "fmt" "net/http" + "net/url" "github.com/crate-crypto/go-proto-danksharding-crypto/eth" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" ) type BeaconClient struct { @@ -58,8 +60,12 @@ func (c *BeaconClient) DownloadBlobs(slot uint64) (map[common.Hash]Blob, error) // TODO: @Qiang There will be a change to the URL schema and a new indices query parameter // We should do the corresponding change when it takes effect, maybe 4844-devnet-6? // The details here: https://github.com/sigp/lighthouse/issues/4317 - url := fmt.Sprintf("%s/eth/v1/beacon/blob_sidecars/%d", c.beaconURL, slot) - resp, err := http.Get(url) + beaconUrl, err := url.JoinPath(c.beaconURL, fmt.Sprintf("eth/v1/beacon/blob_sidecars/%d", slot)) + log.Info("DownloadBlobs", "beaconURL", beaconUrl) + if err != nil { + return nil, err + } + resp, err := http.Get(beaconUrl) if err != nil { return nil, err } From 22938ea671edf015b2ef2e105d9a1d38d4942d51 Mon Sep 17 00:00:00 2001 From: qiang Date: Sat, 16 Mar 2024 15:45:14 +0800 Subject: [PATCH 2/2] remove log --- ethstorage/eth/beacon_client.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/ethstorage/eth/beacon_client.go b/ethstorage/eth/beacon_client.go index 2c221483..79826110 100644 --- a/ethstorage/eth/beacon_client.go +++ b/ethstorage/eth/beacon_client.go @@ -12,7 +12,6 @@ import ( "github.com/crate-crypto/go-proto-danksharding-crypto/eth" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" ) type BeaconClient struct { @@ -61,7 +60,6 @@ func (c *BeaconClient) DownloadBlobs(slot uint64) (map[common.Hash]Blob, error) // We should do the corresponding change when it takes effect, maybe 4844-devnet-6? // The details here: https://github.com/sigp/lighthouse/issues/4317 beaconUrl, err := url.JoinPath(c.beaconURL, fmt.Sprintf("eth/v1/beacon/blob_sidecars/%d", slot)) - log.Info("DownloadBlobs", "beaconURL", beaconUrl) if err != nil { return nil, err }