Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 276
feat: solo sequencer, testapp max blob size ldflags#3235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
dab3be31fc86a53d84f8177b58a6cbfacbdc26c090a1c2f874d1b53157cd3ef076f094989f43db4445176a984b91220b20File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,21 @@ | ||
| package common | ||
| const DefaultMaxBlobSize = 5 * 1024 * 1024 // 5MB fallback blob size limit | ||
| import "strconv" | ||
| // defaultMaxBlobSizeStr holds the string representation of the default blob | ||
| // size limit. Override at link time via: | ||
| // | ||
| // go build -ldflags "-X github.com/evstack/ev-node/block/internal/common.defaultMaxBlobSizeStr=125829120" | ||
| var defaultMaxBlobSizeStr = "5242880" // 5 MB | ||
| // DefaultMaxBlobSize is the max blob size limit used for blob submission. | ||
| var DefaultMaxBlobSize uint64 | ||
| func init() { | ||
| v, err := strconv.ParseUint(defaultMaxBlobSizeStr, 10, 64) | ||
| if err != nil || v == 0 { | ||
| DefaultMaxBlobSize = 5 * 1024 * 1024 // 5 MB fallback | ||
| return | ||
| } | ||
| DefaultMaxBlobSize = v | ||
julienrbrt marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -12,7 +12,7 @@ import ( | ||
| type BatchingStrategy interface { | ||
| // ShouldSubmit determines if a batch should be submitted based on the strategy | ||
| // Returns true if submission should happen now | ||
| ShouldSubmit(pendingCount uint64, totalSizeBeforeSig int, maxBlobSize int, timeSinceLastSubmit time.Duration) bool | ||
| ShouldSubmit(pendingCount uint64, totalSizeBeforeSig uint64, maxBlobSize uint64, timeSinceLastSubmit time.Duration) bool | ||
| } | ||
| // NewBatchingStrategy creates a batching strategy based on configuration | ||
| @@ -34,7 +34,7 @@ func NewBatchingStrategy(cfg config.DAConfig) (BatchingStrategy, error) { | ||
| // ImmediateStrategy submits as soon as any items are available | ||
| type ImmediateStrategy struct{} | ||
| func (s *ImmediateStrategy) ShouldSubmit(pendingCount uint64, totalSize int, maxBlobSize int, timeSinceLastSubmit time.Duration) bool { | ||
| func (s *ImmediateStrategy) ShouldSubmit(pendingCount uint64, totalSize uint64, maxBlobSize uint64, timeSinceLastSubmit time.Duration) bool { | ||
| return pendingCount > 0 | ||
| } | ||
| @@ -57,12 +57,12 @@ func NewSizeBasedStrategy(sizeThreshold float64, minItems uint64) *SizeBasedStra | ||
| } | ||
| } | ||
| func (s *SizeBasedStrategy) ShouldSubmit(pendingCount uint64, totalSize int, maxBlobSize int, timeSinceLastSubmit time.Duration) bool { | ||
| func (s *SizeBasedStrategy) ShouldSubmit(pendingCount uint64, totalSize uint64, maxBlobSize uint64, timeSinceLastSubmit time.Duration) bool { | ||
| if pendingCount < s.minItems { | ||
| return false | ||
| } | ||
| threshold := int(float64(maxBlobSize) * s.sizeThreshold) | ||
| threshold := uint64(float64(maxBlobSize) * s.sizeThreshold) | ||
| return totalSize >= threshold | ||
| } | ||
| @@ -85,7 +85,7 @@ func NewTimeBasedStrategy(daBlockTime time.Duration, maxDelay time.Duration, min | ||
| } | ||
| } | ||
| func (s *TimeBasedStrategy) ShouldSubmit(pendingCount uint64, totalSize int, maxBlobSize int, timeSinceLastSubmit time.Duration) bool { | ||
| func (s *TimeBasedStrategy) ShouldSubmit(pendingCount uint64, totalSize uint64, maxBlobSize uint64, timeSinceLastSubmit time.Duration) bool { | ||
| if pendingCount < s.minItems { | ||
| return false | ||
| } | ||
| @@ -120,18 +120,16 @@ func NewAdaptiveStrategy(daBlockTime time.Duration, sizeThreshold float64, maxDe | ||
| } | ||
| } | ||
| func (s *AdaptiveStrategy) ShouldSubmit(pendingCount uint64, totalSize int, maxBlobSize int, timeSinceLastSubmit time.Duration) bool { | ||
| func (s *AdaptiveStrategy) ShouldSubmit(pendingCount uint64, totalSize uint64, maxBlobSize uint64, timeSinceLastSubmit time.Duration) bool { | ||
julienrbrt marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| if pendingCount < s.minItems { | ||
| return false | ||
| } | ||
| // Submit if we've reached the size threshold | ||
| threshold := int(float64(maxBlobSize) * s.sizeThreshold) | ||
| threshold := uint64(float64(maxBlobSize) * s.sizeThreshold) | ||
| if totalSize >= threshold { | ||
| return true | ||
| } | ||
| // Submit if max delay has been reached | ||
| if timeSinceLastSubmit >= s.maxDelay { | ||
| return true | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.