Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
const (
VersionMajor = 5 // Major version component of the current release
VersionMinor = 8 // Minor version component of the current release
VersionPatch = 49 // Patch version component of the current release
VersionPatch = 50 // Patch version component of the current release
VersionMeta = "mainnet" // Version metadata to append to the version string
)

Expand Down
15 changes: 12 additions & 3 deletions rollup/da_syncer/blob_client/beacon_node_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ import (
"net/http"
"net/url"
"strconv"
"time"

"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/crypto/kzg4844"
)

const (
BeaconNodeDefaultTimeout = 15 * time.Second
)

type BeaconNodeClient struct {
client *http.Client
apiEndpoint string
genesisTime uint64
secondsPerSlot uint64
Expand All @@ -27,12 +33,14 @@ var (
)

func NewBeaconNodeClient(apiEndpoint string) (*BeaconNodeClient, error) {
client := &http.Client{Timeout: BeaconNodeDefaultTimeout}

// get genesis time
genesisPath, err := url.JoinPath(apiEndpoint, beaconNodeGenesisEndpoint)
if err != nil {
return nil, fmt.Errorf("failed to join path, err: %w", err)
}
resp, err := http.Get(genesisPath)
resp, err := client.Get(genesisPath)
if err != nil {
return nil, fmt.Errorf("cannot do request, err: %w", err)
}
Expand Down Expand Up @@ -62,7 +70,7 @@ func NewBeaconNodeClient(apiEndpoint string) (*BeaconNodeClient, error) {
if err != nil {
return nil, fmt.Errorf("failed to join path, err: %w", err)
}
resp, err = http.Get(specPath)
resp, err = client.Get(specPath)
if err != nil {
return nil, fmt.Errorf("cannot do request, err: %w", err)
}
Expand Down Expand Up @@ -91,6 +99,7 @@ func NewBeaconNodeClient(apiEndpoint string) (*BeaconNodeClient, error) {
}

return &BeaconNodeClient{
client: client,
apiEndpoint: apiEndpoint,
genesisTime: genesisTime,
secondsPerSlot: secondsPerSlot,
Expand All @@ -105,7 +114,7 @@ func (c *BeaconNodeClient) GetBlobByVersionedHashAndBlockTime(ctx context.Contex
if err != nil {
return nil, fmt.Errorf("failed to join path, err: %w", err)
}
resp, err := http.Get(blobSidecarPath)
resp, err := c.client.Get(blobSidecarPath)
if err != nil {
return nil, fmt.Errorf("cannot do request, err: %w", err)
}
Expand Down
7 changes: 6 additions & 1 deletion rollup/da_syncer/blob_client/blob_scan_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,25 @@ import (
"fmt"
"net/http"
"net/url"
"time"

"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/common/hexutil"
"github.com/scroll-tech/go-ethereum/crypto/kzg4844"
)

const (
BlobScanDefaultTimeout = 15 * time.Second
)

type BlobScanClient struct {
client *http.Client
apiEndpoint string
}

func NewBlobScanClient(apiEndpoint string) *BlobScanClient {
return &BlobScanClient{
client: http.DefaultClient,
client: &http.Client{Timeout: BlobScanDefaultTimeout},
apiEndpoint: apiEndpoint,
}
}
Expand Down
9 changes: 8 additions & 1 deletion rollup/da_syncer/blob_client/block_native_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,25 @@ import (
"fmt"
"net/http"
"net/url"
"time"

"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/common/hexutil"
"github.com/scroll-tech/go-ethereum/crypto/kzg4844"
)

const (
BlockNativeDefaultTimeout = 15 * time.Second
)

type BlockNativeClient struct {
client *http.Client
apiEndpoint string
}

func NewBlockNativeClient(apiEndpoint string) *BlockNativeClient {
return &BlockNativeClient{
client: &http.Client{Timeout: BlockNativeDefaultTimeout},
apiEndpoint: apiEndpoint,
}
}
Expand All @@ -34,7 +41,7 @@ func (c *BlockNativeClient) GetBlobByVersionedHashAndBlockTime(ctx context.Conte
if err != nil {
return nil, fmt.Errorf("cannot create request, err: %w", err)
}
resp, err := http.DefaultClient.Do(req)
resp, err := c.client.Do(req)
if err != nil {
return nil, fmt.Errorf("cannot do request, err: %w", err)
}
Expand Down
Loading