-
Notifications
You must be signed in to change notification settings - Fork 839
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
Memoize transaction size and hash at the same time #4812
Conversation
if (TransactionType.FRONTIER.equals(transactionType)) { | ||
encodeFrontier(transaction, rlpOutput); | ||
rlpOutput.writeRaw(opaqueBytes); | ||
} else { | ||
rlpOutput.writeBytes(encodeOpaqueBytes(transaction)); | ||
rlpOutput.writeBytes(opaqueBytes); |
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 scrutinized this to be sure we are not creating a regression for non-frontier transactions. LGTM
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.
🚢
looks like there is a build failure for NewPooledTransactionHashesMessageProcessorTest since cacluateSize() is gone now. |
78aeefd
to
0455575
Compare
Fixed |
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.
LGTM
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
0b1deb3
to
fd5f0e6
Compare
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> Signed-off-by: Justin Florentine <justin+github@florentine.us>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net> Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: Fabio Di Fabio fabio.difabio@consensys.net
PR description
Since to calculate the transaction hash and size, the transaction needs to be encoded to bytes, we can cache both values at the same time, in order to avoid extra expensive encoding tasks.
Fixed Issue(s)
relates to #4724
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog