Skip to content

Commit aa69f8a

Browse files
fix: Modify Max DA blob size slightly (#2558)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. NOTE: PR titles should follow semantic commits: https://www.conventionalcommits.org/en/v1.0.0/ --> ## Overview The DA Max Blob size in Celestia according to https://docs.celestia.org/how-to-guides/submit-data#maximum-blob-size is 1,973,786 bytes which is equal to 1973786/(1024*1024) = 1.882 MB. This is a bit lower than 64*64*482 = 1974272 which is what was set in Evolve Node, so this PR modifies this value in Evolve Node to be 64*64*481 = 1970176 instead so it's a bit lower than the DA Max Blob size instead. Also, modified the logs to be more debug based instead of error and info to reduce the noise in logs for users. <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. Ex: Closes #<issue number> -->
1 parent e8d4eab commit aa69f8a

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

block/submitter.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ func handleTooBigError[T any](
381381
attempt int,
382382
namespace []byte,
383383
) submissionOutcome[T] {
384-
m.logger.Warn().Str("error", "blob too big").Int("attempt", attempt).Int("batchSize", len(remaining)).Msg("DA layer submission failed due to blob size limit")
384+
m.logger.Debug().Str("error", "blob too big").Int("attempt", attempt).Int("batchSize", len(remaining)).Msg("DA layer submission failed due to blob size limit")
385385

386386
m.recordDAMetrics("submission", DAModeFail)
387387

@@ -511,7 +511,7 @@ func submitWithRecursiveSplitting[T any](
511511
}
512512

513513
// Split and submit recursively - we know the batch is too big
514-
m.logger.Info().Int("batchSize", len(items)).Msg("splitting batch for recursive submission")
514+
m.logger.Debug().Int("batchSize", len(items)).Msg("splitting batch for recursive submission")
515515

516516
splitPoint := len(items) / 2
517517
// Ensure we actually split (avoid infinite recursion)
@@ -523,7 +523,7 @@ func submitWithRecursiveSplitting[T any](
523523
firstHalfMarshaled := marshaled[:splitPoint]
524524
secondHalfMarshaled := marshaled[splitPoint:]
525525

526-
m.logger.Info().Int("originalSize", len(items)).Int("firstHalf", len(firstHalf)).Int("secondHalf", len(secondHalf)).Msg("splitting batch for recursion")
526+
m.logger.Debug().Int("originalSize", len(items)).Int("firstHalf", len(firstHalf)).Int("secondHalf", len(secondHalf)).Msg("splitting batch for recursion")
527527

528528
// Recursively submit both halves using processBatch directly
529529
firstSubmitted, err := submitHalfBatch[T](m, ctx, firstHalf, firstHalfMarshaled, gasPrice, postSubmit, itemType, namespace)
@@ -645,7 +645,7 @@ func processBatch[T any](
645645

646646
if batchRes.Code == coreda.StatusTooBig && len(batch.Items) > 1 {
647647
// Batch is too big - let the caller handle splitting
648-
m.logger.Info().Int("batchSize", len(batch.Items)).Msg("batch too big, returning to caller for splitting")
648+
m.logger.Debug().Int("batchSize", len(batch.Items)).Msg("batch too big, returning to caller for splitting")
649649
return batchResult[T]{action: batchActionTooBig}
650650
}
651651

da/cmd/local-da/local.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
)
1818

1919
// DefaultMaxBlobSize is the default max blob size
20-
const DefaultMaxBlobSize = 64 * 64 * 482
20+
const DefaultMaxBlobSize uint64 = 64 * 64 * 481 // 1970176
2121

2222
// LocalDA is a simple implementation of in-memory DA. Not production ready! Intended only for testing!
2323
//

da/jsonrpc/internal/consts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const (
1414
DefaultGovMaxSquareSize = 64
1515

1616
// DefaultMaxBytes is the default value for the governance modifiable
17-
// maximum number of bytes allowed in a valid block.
18-
DefaultMaxBytes = DefaultGovMaxSquareSize * DefaultGovMaxSquareSize * share.ContinuationSparseShareContentSize
17+
// maximum number of bytes allowed in a valid block. We subtract 1 to have some extra buffer.
18+
DefaultMaxBytes = DefaultGovMaxSquareSize * DefaultGovMaxSquareSize * (share.ContinuationSparseShareContentSize - 1)
1919

2020
// DefaultMinGasPrice is the default min gas price that gets set in the app.toml file.
2121
// The min gas price acts as a filter. Transactions below that limit will not pass

types/da.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,13 @@ func SubmitWithHelpers(
5151
case errors.Is(err, coreda.ErrContextDeadline):
5252
status = coreda.StatusContextDeadline
5353
}
54-
logger.Error().Err(err).Uint64("status", uint64(status)).Msg("DA submission failed via helper")
54+
55+
// Use debug level for StatusTooBig as it gets handled later in submitToDA through recursive splitting
56+
if status == coreda.StatusTooBig {
57+
logger.Debug().Err(err).Uint64("status", uint64(status)).Msg("DA submission failed via helper")
58+
} else {
59+
logger.Error().Err(err).Uint64("status", uint64(status)).Msg("DA submission failed via helper")
60+
}
5561
return coreda.ResultSubmit{
5662
BaseResult: coreda.BaseResult{
5763
Code: status,

0 commit comments

Comments
 (0)