-
Notifications
You must be signed in to change notification settings - Fork 645
Max byte check #1384
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
Merged
Merged
Max byte check #1384
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9d53787
Update go version
alijnmerchant21 7685e79
Update go.mod to reflect go version and module
alijnmerchant21 46049a4
Update to 0.38
alijnmerchant21 7e786e7
Update formatting
alijnmerchant21 21c6cb2
Update to 0.38
alijnmerchant21 fef32e0
Update formatting
alijnmerchant21 9ad4558
Refactor PrepareProposal to handle transaction size limit
alijnmerchant21 917908e
Update go version
alijnmerchant21 c4fc4bb
Update go.mod to reflect go version and module
alijnmerchant21 fbd4e2b
Update to 0.38
alijnmerchant21 617f95d
Update formatting
alijnmerchant21 14811b1
Refactor PrepareProposal to handle transaction size limit
8000
alijnmerchant21 d78184b
Fix passage sequence
alijnmerchant21 fc597c0
Fix passage sequence
alijnmerchant21 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The use of totalBytes is redundant and could instead just use len(txs) but the even better check would be to firstly check if the final added value is greater than proposal.MaxTxBytes
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.
Indeed, @odeke-em Thanks for pointing it out.
Given that this PR is now merged, would you mind opening a new PR with your suggestions?
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.
Isn't the problem here that the
txs
array is not of the right type? (is[]byte
, should be[][]byte
)Then we are "coalescing" all transactions into a byte array... but that's not what we should be doing, is it?
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.
You are right, @sergio-mena, but @odeke-em has a point in that the overflow check should be done before the last transaction has been added, otherwise it is too late to break the loop.