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
91 changes: 0 additions & 91 deletions .github/workflows/check_consts_drift.yml

This file was deleted.

2 changes: 1 addition & 1 deletion apps/evm/single/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var RunCmd = &cobra.Command{

logger.Info().Str("headerNamespace", headerNamespace.HexString()).Str("dataNamespace", dataNamespace.HexString()).Msg("namespaces")

daJrpc, err := jsonrpc.NewClient(context.Background(), logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, nodeConfig.DA.GasPrice, nodeConfig.DA.GasMultiplier)
daJrpc, err := jsonrpc.NewClient(context.Background(), logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, nodeConfig.DA.GasPrice, nodeConfig.DA.GasMultiplier, rollcmd.DefaultMaxBlobSize)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion apps/grpc/single/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The execution client must implement the Evolve execution gRPC interface.`,
logger.Info().Str("headerNamespace", headerNamespace.HexString()).Str("dataNamespace", dataNamespace.HexString()).Msg("namespaces")

// Create DA client
daJrpc, err := jsonrpc.NewClient(cmd.Context(), logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, nodeConfig.DA.GasPrice, nodeConfig.DA.GasMultiplier)
daJrpc, err := jsonrpc.NewClient(cmd.Context(), logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, nodeConfig.DA.GasPrice, nodeConfig.DA.GasMultiplier, rollcmd.DefaultMaxBlobSize)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion apps/testapp/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var RunCmd = &cobra.Command{

logger.Info().Str("headerNamespace", headerNamespace.HexString()).Str("dataNamespace", dataNamespace.HexString()).Msg("namespaces")

daJrpc, err := jsonrpc.NewClient(ctx, logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, nodeConfig.DA.GasPrice, nodeConfig.DA.GasMultiplier)
daJrpc, err := jsonrpc.NewClient(ctx, logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, nodeConfig.DA.GasPrice, nodeConfig.DA.GasMultiplier, rollcmd.DefaultMaxBlobSize)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion block/internal/submitting/da_submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (
initialBackoff = 100 * time.Millisecond
defaultGasPrice = 0.0
defaultGasMultiplier = 1.0
defaultMaxBlobSize = 2 * 1024 * 1024 // 2MB fallback blob size limit
defaultMaxBlobSize = 1.5 * 1024 * 1024 // 1.5MB fallback blob size limit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we merge this, we need to decrease it here too: https://github.com/evstack/ev-node/blob/main/da/jsonrpc/internal/consts.go#L20

defaultMaxGasPriceClamp = 1000.0
defaultMaxGasMultiplierClamp = 3.0 // must always > 0 to avoid division by zero
)
Expand Down
9 changes: 4 additions & 5 deletions da/jsonrpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/rs/zerolog"

"github.com/evstack/ev-node/core/da"
internal "github.com/evstack/ev-node/da/jsonrpc/internal"
)

//go:generate mockgen -destination=mocks/api.go -package=mocks . Module
Expand Down Expand Up @@ -223,16 +222,16 @@ func (c *Client) Close() {

// NewClient creates a new Client with one connection per namespace with the
// given token as the authorization token.
func NewClient(ctx context.Context, logger zerolog.Logger, addr, token string, gasPrice, gasMultiplier float64) (*Client, error) {
func NewClient(ctx context.Context, logger zerolog.Logger, addr, token string, gasPrice, gasMultiplier float64, maxBlobSize uint64) (*Client, error) {
authHeader := http.Header{"Authorization": []string{fmt.Sprintf("Bearer %s", token)}}
return newClient(ctx, logger, addr, authHeader, gasPrice, gasMultiplier)
return newClient(ctx, logger, addr, authHeader, gasPrice, gasMultiplier, maxBlobSize)
}

func newClient(ctx context.Context, logger zerolog.Logger, addr string, authHeader http.Header, gasPrice, gasMultiplier float64) (*Client, error) {
func newClient(ctx context.Context, logger zerolog.Logger, addr string, authHeader http.Header, gasPrice, gasMultiplier float64, maxBlobSize uint64) (*Client, error) {
var multiCloser multiClientCloser
var client Client
client.DA.Logger = logger
client.DA.MaxBlobSize = uint64(internal.MaxTxSize)
client.DA.MaxBlobSize = maxBlobSize
client.DA.gasPrice = gasPrice
client.DA.gasMultiplier = gasMultiplier

Expand Down
41 changes: 0 additions & 41 deletions da/jsonrpc/internal/consts.go

This file was deleted.

4 changes: 3 additions & 1 deletion da/jsonrpc/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const (
ClientURL = "http://localhost:3450"

testMaxBlobSize = 100

DefaultMaxBlobSize = 1.5 * 1024 * 1024 // 1.5MB
)

// testNamespace is a 15-byte namespace that will be hex encoded to 30 chars and truncated to 29
Expand All @@ -55,7 +57,7 @@ func TestProxy(t *testing.T) {
}
}()

client, err := proxy.NewClient(context.Background(), logger, ClientURL, "74657374", 0, 1)
client, err := proxy.NewClient(context.Background(), logger, ClientURL, "74657374", 0, 1, DefaultMaxBlobSize)
require.NoError(t, err)

t.Run("Basic DA test", func(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions pkg/cmd/run_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
"github.com/evstack/ev-node/pkg/signer/file"
)

const DefaultMaxBlobSize = 1.5 * 1024 * 1024 // 1.5MB

// ParseConfig is an helpers that loads the node configuration and validates it.
func ParseConfig(cmd *cobra.Command) (rollconf.Config, error) {
nodeConfig, err := rollconf.Load(cmd)
Expand Down
Loading