This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Implement max message size rather than limiting with fixed number of transactions #1271
Merged
AbdelStark
merged 30 commits into
PegaSysEng:master
from
AbdelStark:feature/pan-1005-tx-limit-size-send-peers
Apr 17, 2019
Merged
Implement max message size rather than limiting with fixed number of transactions #1271
AbdelStark
merged 30 commits into
PegaSysEng:master
from
AbdelStark:feature/pan-1005-tx-limit-size-send-peers
Apr 17, 2019
Conversation
This file contains 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
…actions Adding transactions to the RLP until the message size exceeds the limit and then send that.
mbaxter
reviewed
Apr 12, 2019
ethereum/rlp/src/main/java/tech/pegasys/pantheon/ethereum/rlp/AbstractRLPOutput.java
Outdated
Show resolved
Hide resolved
ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/messages/TransactionsMessage.java
Outdated
Show resolved
Hide resolved
ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/messages/TransactionsMessage.java
Outdated
Show resolved
Hide resolved
ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/messages/TransactionsMessage.java
Outdated
Show resolved
Hide resolved
add javadoc
put this factory method on LimitedTransactionsMessages rather than TransactionsMessage since it returns a LimitedTransactionsMessages.
mbaxter
reviewed
Apr 12, 2019
...th/src/main/java/tech/pegasys/pantheon/ethereum/eth/messages/TransactionsMessageLimiter.java
Outdated
Show resolved
Hide resolved
…tx-limit-size-send-peers
- simplify design - remove useless code
…tx-limit-size-send-peers
mbaxter
reviewed
Apr 15, 2019
...h/src/main/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessages.java
Outdated
Show resolved
Hide resolved
...h/src/main/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessages.java
Show resolved
Hide resolved
...h/src/main/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessages.java
Outdated
Show resolved
Hide resolved
ethereum/rlp/src/main/java/tech/pegasys/pantheon/ethereum/rlp/AbstractRLPOutput.java
Outdated
Show resolved
Hide resolved
...h/src/main/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessages.java
Show resolved
Hide resolved
- simplify logic - add tests
…tx-limit-size-send-peers
…tx-limit-size-send-peers
mbaxter
reviewed
Apr 15, 2019
ethereum/rlp/src/main/java/tech/pegasys/pantheon/ethereum/rlp/AbstractRLPOutput.java
Outdated
Show resolved
Hide resolved
…ithub.com/abdelhamidbakhta/pantheon into feature/pan-1005-tx-limit-size-send-peers
mbaxter
reviewed
Apr 15, 2019
ethereum/core/src/main/java/tech/pegasys/pantheon/ethereum/core/Transaction.java
Outdated
Show resolved
Hide resolved
...h/src/main/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessages.java
Outdated
Show resolved
Hide resolved
allTxToSend.removeAll(subsetToSend); | ||
final LimitedTransactionsMessages limitedTransactionsMessages = | ||
LimitedTransactionsMessages.createLimited(allTxToSend); | ||
allTxToSend.removeAll(limitedTransactionsMessages.getIncludedTransactions()); |
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.
(optional) You could also have LimitedTransactionsMessages.createLimited return a stream of TransactionMessages
, then you don't need the extra removeAll
bookkeeping and the extra memory for the included tx's list.
...c/test/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessagesTest.java
Show resolved
Hide resolved
...c/test/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessagesTest.java
Show resolved
Hide resolved
...c/test/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessagesTest.java
Show resolved
Hide resolved
…messages/LimitedTransactionsMessages.java Co-Authored-By: abdelhamidbakhta <45264458+abdelhamidbakhta@users.noreply.github.com>
…ithub.com/abdelhamidbakhta/pantheon into feature/pan-1005-tx-limit-size-send-peers
mbaxter
reviewed
Apr 15, 2019
...c/test/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessagesTest.java
Show resolved
Hide resolved
...c/test/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessagesTest.java
Show resolved
Hide resolved
fix PR unit test
Use LinkedHashSet to preserve order.
mbaxter
approved these changes
Apr 17, 2019
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.
Left a few more small comments that would be good to address.
...c/test/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessagesTest.java
Show resolved
Hide resolved
assertEquals(781, secondMessage.getIncludedTransactions().size()); | ||
txs.removeAll(secondMessage.getIncludedTransactions()); | ||
assertEquals(0, txs.size()); | ||
assertTrue( |
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.
Can you cut this assertion? I think it just ends up being confusing.
...c/test/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessagesTest.java
Show resolved
Hide resolved
...c/test/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessagesTest.java
Show resolved
Hide resolved
...c/test/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessagesTest.java
Show resolved
Hide resolved
notlesh
pushed a commit
to notlesh/pantheon
that referenced
this pull request
Apr 24, 2019
…transactions (PegaSysEng#1271) * Implement max message size rather then cap with fixed number of transactions Adding transactions to the RLP until the message size exceeds the limit and then send that. * fix final variables * Update AbstractRLPOutput.java add javadoc * pr discussion put this factory method on LimitedTransactionsMessages rather than TransactionsMessage since it returns a LimitedTransactionsMessages. * SpotlessApply * fix PR discussion - simplify design - remove useless code * Update LimitedTransactionsMessages.java * fix PR discussion - simplify logic - add tests * Update AbstractRLPOutput.java * Update ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessages.java Co-Authored-By: abdelhamidbakhta <45264458+abdelhamidbakhta@users.noreply.github.com> * Update Transaction.java * fix PR discussion * fix PR discussion - add tests * Update BlockDataGenerator.java * Update LimitedTransactionsMessagesTest.java fix PR unit test * Update LimitedTransactionsMessagesTest.java * Update LimitedTransactionsMessagesTest.java Use LinkedHashSet to preserve order. * Update LimitedTransactionsMessagesTest.java
notlesh
pushed a commit
to notlesh/pantheon
that referenced
this pull request
May 4, 2019
…transactions (PegaSysEng#1271) * Implement max message size rather then cap with fixed number of transactions Adding transactions to the RLP until the message size exceeds the limit and then send that. * fix final variables * Update AbstractRLPOutput.java add javadoc * pr discussion put this factory method on LimitedTransactionsMessages rather than TransactionsMessage since it returns a LimitedTransactionsMessages. * SpotlessApply * fix PR discussion - simplify design - remove useless code * Update LimitedTransactionsMessages.java * fix PR discussion - simplify logic - add tests * Update AbstractRLPOutput.java * Update ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/messages/LimitedTransactionsMessages.java Co-Authored-By: abdelhamidbakhta <45264458+abdelhamidbakhta@users.noreply.github.com> * Update Transaction.java * fix PR discussion * fix PR discussion - add tests * Update BlockDataGenerator.java * Update LimitedTransactionsMessagesTest.java fix PR unit test * Update LimitedTransactionsMessagesTest.java * Update LimitedTransactionsMessagesTest.java Use LinkedHashSet to preserve order. * Update LimitedTransactionsMessagesTest.java
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
PR description
Adding transactions to the RLP until the message size exceeds the limit and then send that.
Fixed Issue(s)
fixes #PAN-1005