-
Notifications
You must be signed in to change notification settings - Fork 73
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
feat: added max bytes size check when creating the batch #321
Conversation
…-batch-size-in-bytes
Codecov Report
@@ Coverage Diff @@
## main #321 +/- ##
==========================================
+ Coverage 52.22% 52.60% +0.38%
==========================================
Files 70 70
Lines 12566 12627 +61
==========================================
+ Hits 6563 6643 +80
+ Misses 5073 5057 -16
+ Partials 930 927 -3
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
bytes limit can be disable by setting 0 valiue added UT moved mocks to testutil package
Fixed and added UT |
block/manager.go
Outdated
totalSize = totalSize + block.ToProto().Size() + commit.ToProto().Size() | ||
if totalSize >= int(m.conf.BlockBatchSizeBytes) { | ||
totalSize := batch.ToProto().Size() | ||
if m.conf.BlockBatchSizeBytes > 0 && totalSize >= int(m.conf.BlockBatchSizeBytes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest adding single validation (vs checking every time) to conf.BlockBatchSizeBytes > 0
as a preliminary stage for starting the rollapp. Look at line 121 for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, It's not the same.
If the flag not provided, it gets the default value by the Viper
conf
If it's set explicitly to 0
- I thought it should mean no limit
. U say it should enforce the default as in line 121.
Fine, changing it.
PR Standards
Opening a pull request should be able to meet the following requirements:
For Author:
godoc
commentsFor Reviewer:
After reviewer approval: