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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Remove GasPrice and GasMultiplier from DA interface and configuration to use celestia-node's native fee estimation. ([#2822](https://github.com/evstack/ev-node/pull/2822))
- Use cache instead of in memory store for reaper. Persist cache on reload. Autoclean after 24 hours. ([#2811](https://github.com/evstack/ev-node/pull/2811))

### Removed
Expand Down
2 changes: 1 addition & 1 deletion apps/evm/single/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,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, rollcmd.DefaultMaxBlobSize)
daJrpc, err := jsonrpc.NewClient(context.Background(), logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, rollcmd.DefaultMaxBlobSize)
if err != nil {
return err
}
Expand Down
4 changes: 4 additions & 0 deletions apps/evm/single/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,7 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.4.1 // indirect
)

replace github.com/evstack/ev-node/core => ../../../core

replace github.com/evstack/ev-node/da => ../../../da
4 changes: 0 additions & 4 deletions apps/evm/single/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@ github.com/ethereum/go-ethereum v1.16.5 h1:GZI995PZkzP7ySCxEFaOPzS8+bd8NldE//1qv
github.com/ethereum/go-ethereum v1.16.5/go.mod h1:kId9vOtlYg3PZk9VwKbGlQmSACB5ESPTBGT+M9zjmok=
github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8=
github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk=
github.com/evstack/ev-node/core v1.0.0-beta.4 h1:F/rqHCrZ+ViUY4I6RuoBVvkhYfosD68yo/6gCdGRdmo=
github.com/evstack/ev-node/core v1.0.0-beta.4/go.mod h1:n2w/LhYQTPsi48m6lMj16YiIqsaQw6gxwjyJvR+B3sY=
github.com/evstack/ev-node/da v1.0.0-beta.5 h1:rWs/H0Nkj9uwTqD7Tzu+PpaNHGFE71B1ZVKCFLx0yVI=
github.com/evstack/ev-node/da v1.0.0-beta.5/go.mod h1:lJ7vGlczBwiqTaTE9C4zV9tEsQO+oi0sqyUyYzj3zpo=
github.com/evstack/ev-node/execution/evm v1.0.0-beta.3 h1:xo0mZz3CJtntP1RPLFDBubBKpNkqStImt9H9N0xysj8=
github.com/evstack/ev-node/execution/evm v1.0.0-beta.3/go.mod h1:yazCKZaVczYwizfHYSQ4KIYqW0d42M7q7e9AxuSXV3s=
github.com/evstack/ev-node/sequencers/single v1.0.0-beta.3 h1:BT/UeH7Tf8z0btzomCzTbbDDZGAT8/yHcd6xY6P/aaw=
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, rollcmd.DefaultMaxBlobSize)
daJrpc, err := jsonrpc.NewClient(cmd.Context(), logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, rollcmd.DefaultMaxBlobSize)
if err != nil {
return err
}
Expand Down
4 changes: 4 additions & 0 deletions apps/grpc/single/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,7 @@ replace (
github.com/evstack/ev-node => ../../../
github.com/evstack/ev-node/execution/grpc => ../../../execution/grpc
)

replace github.com/evstack/ev-node/core => ../../../core

replace github.com/evstack/ev-node/da => ../../../da
4 changes: 0 additions & 4 deletions apps/grpc/single/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evstack/ev-node/core v1.0.0-beta.4 h1:F/rqHCrZ+ViUY4I6RuoBVvkhYfosD68yo/6gCdGRdmo=
github.com/evstack/ev-node/core v1.0.0-beta.4/go.mod h1:n2w/LhYQTPsi48m6lMj16YiIqsaQw6gxwjyJvR+B3sY=
github.com/evstack/ev-node/da v1.0.0-beta.5 h1:rWs/H0Nkj9uwTqD7Tzu+PpaNHGFE71B1ZVKCFLx0yVI=
github.com/evstack/ev-node/da v1.0.0-beta.5/go.mod h1:lJ7vGlczBwiqTaTE9C4zV9tEsQO+oi0sqyUyYzj3zpo=
github.com/evstack/ev-node/sequencers/single v1.0.0-beta.3 h1:BT/UeH7Tf8z0btzomCzTbbDDZGAT8/yHcd6xY6P/aaw=
github.com/evstack/ev-node/sequencers/single v1.0.0-beta.3/go.mod h1:eCkDecdJ3s7TB3R5nFdPDyz7jjRmwYen6lGe9D2sSH4=
github.com/filecoin-project/go-clock v0.1.0 h1:SFbYIM75M8NnFm1yMHhN9Ahy3W5bEZV9gd6MPfXbKVU=
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, rollcmd.DefaultMaxBlobSize)
daJrpc, err := jsonrpc.NewClient(ctx, logger, nodeConfig.DA.Address, nodeConfig.DA.AuthToken, rollcmd.DefaultMaxBlobSize)
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions block/components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestNewSyncComponents_Creation(t *testing.T) {
}

mockExec := testmocks.NewMockExecutor(t)
dummyDA := coreda.NewDummyDA(10_000_000, 0, 0, 10*time.Millisecond)
dummyDA := coreda.NewDummyDA(10_000_000, 10*time.Millisecond)

// Just test that the constructor doesn't panic - don't start the components
// to avoid P2P store dependencies
Expand Down Expand Up @@ -143,7 +143,7 @@ func TestNewAggregatorComponents_Creation(t *testing.T) {

mockExec := testmocks.NewMockExecutor(t)
mockSeq := testmocks.NewMockSequencer(t)
dummyDA := coreda.NewDummyDA(10_000_000, 0, 0, 10*time.Millisecond)
dummyDA := coreda.NewDummyDA(10_000_000, 10*time.Millisecond)

components, err := NewAggregatorComponents(
cfg,
Expand Down Expand Up @@ -197,7 +197,7 @@ func TestExecutor_RealExecutionClientFailure_StopsNode(t *testing.T) {
// Create mock executor that will fail on ExecuteTxs
mockExec := testmocks.NewMockExecutor(t)
mockSeq := testmocks.NewMockSequencer(t)
dummyDA := coreda.NewDummyDA(10_000_000, 0, 0, 10*time.Millisecond)
dummyDA := coreda.NewDummyDA(10_000_000, 10*time.Millisecond)

// Mock InitChain to succeed initially
mockExec.On("InitChain", mock.Anything, mock.Anything, mock.Anything, mock.Anything).
Expand Down
75 changes: 12 additions & 63 deletions block/internal/submitting/da_retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,104 +9,53 @@ import (

func TestRetryStateNext_Table(t *testing.T) {
pol := retryPolicy{
MaxAttempts: 10,
MinBackoff: 100 * time.Millisecond,
MaxBackoff: 1 * time.Second,
MinGasPrice: 0.0,
MaxGasPrice: 10.0,
MaxBlobBytes: 2 * 1024 * 1024,
MaxGasMultiplier: 3.0,
MaxAttempts: 10,
MinBackoff: 100 * time.Millisecond,
MaxBackoff: 1 * time.Second,
MaxBlobBytes: 2 * 1024 * 1024,
}

tests := map[string]struct {
startGas float64
startBackoff time.Duration
reason retryReason
gasMult float64
sentinelNoGas bool
wantGas float64
wantBackoff time.Duration
startBackoff time.Duration
reason retryReason
wantBackoff time.Duration
}{
"success reduces gas and resets backoff": {
startGas: 9.0,
"success resets backoff": {
startBackoff: 500 * time.Millisecond,
reason: reasonSuccess,
gasMult: 3.0,
wantGas: 3.0, // 9 / 3
wantBackoff: pol.MinBackoff,
},
"success clamps very small gasMult to 1/Max, possibly increasing gas": {
startGas: 3.0,
startBackoff: 250 * time.Millisecond,
reason: reasonSuccess,
gasMult: 0.01, // clamped to 1/MaxGasMultiplier = 1/3
wantGas: 9.0, // 3 / (1/3)
wantBackoff: pol.MinBackoff,
},
"mempool increases gas and sets max backoff": {
startGas: 2.0,
startBackoff: 0,
reason: reasonMempool,
gasMult: 2.0,
wantGas: 4.0, // 2 * 2
wantBackoff: pol.MaxBackoff,
},
"mempool clamps gas to max": {
startGas: 9.5,
"mempool sets max backoff": {
startBackoff: 0,
reason: reasonMempool,
gasMult: 3.0,
wantGas: 10.0, // 9.5 * 3 = 28.5 -> clamp 10
wantBackoff: pol.MaxBackoff,
},
"failure sets initial backoff": {
startGas: 1.0,
startBackoff: 0,
reason: reasonFailure,
gasMult: 2.0,
wantGas: 1.0, // unchanged
wantBackoff: pol.MinBackoff,
},
"failure doubles backoff capped at max": {
startGas: 1.0,
startBackoff: 700 * time.Millisecond,
reason: reasonFailure,
gasMult: 2.0,
wantGas: 1.0, // unchanged
wantBackoff: 1 * time.Second, // 700ms*2=1400ms -> clamp 1s
},
"tooBig doubles backoff like failure": {
startGas: 1.0,
startBackoff: 100 * time.Millisecond,
reason: reasonTooBig,
gasMult: 2.0,
wantGas: 1.0,
wantBackoff: 200 * time.Millisecond,
},
"sentinel no gas keeps gas unchanged on success": {
startGas: 5.0,
startBackoff: 0,
reason: reasonSuccess,
gasMult: 2.0,
sentinelNoGas: true,
wantGas: 5.0,
wantBackoff: pol.MinBackoff,
},
"undefined reason keeps gas unchanged and uses min backoff": {
startGas: 3.0,
"undefined reason uses zero backoff": {
startBackoff: 500 * time.Millisecond,
reason: reasonUndefined,
gasMult: 2.0,
wantGas: 3.0,
wantBackoff: 0,
},
}
for name, tc := range tests {
t.Run(name, func(t *testing.T) {
rs := retryState{Attempt: 0, Backoff: tc.startBackoff, GasPrice: tc.startGas}
rs.Next(tc.reason, pol, tc.gasMult, tc.sentinelNoGas)
rs := retryState{Attempt: 0, Backoff: tc.startBackoff}
rs.Next(tc.reason, pol)

assert.Equal(t, tc.wantGas, rs.GasPrice, "gas price")
assert.Equal(t, tc.wantBackoff, rs.Backoff, "backoff")
assert.Equal(t, 1, rs.Attempt, "attempt")
})
Expand Down
Loading
Loading