-
Notifications
You must be signed in to change notification settings - Fork 143
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
Reused PlatformTxnAccessor with handleTransaction from expandSignatures #1474
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1474 +/- ##
============================================
+ Coverage 91.39% 91.41% +0.02%
- Complexity 5899 5903 +4
============================================
Files 461 462 +1
Lines 16932 16954 +22
Branches 1783 1783
============================================
+ Hits 15475 15499 +24
+ Misses 991 990 -1
+ Partials 466 465 -1
Continue to review full report at Codecov.
|
} catch (InvalidProtocolBufferException exception) { | ||
log.warn("Consensus platform txn was not gRPC!"); |
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.
Need coverage for these two lines.
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.
Added more tests.
setPlatformTxnAccessor(platformTxn); | ||
expandIn( | ||
accessor, | ||
txnAccessor, |
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 change here slightly changes original logic. Now line 333 may have txnAccessor
as null
if line 331setPlatformTxnAccessor(platformTxn);
throws exception. So it would be nice to add a test case for this scenario.
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.
Modified logic to use a separate component that would handle the conversion from Transaction
to PlatformTxnAccessor
.
Description says that PR includes fixed failing test cases of |
PlatformTxnAccessor accessor, | ||
Instant consensusTime, long submittingMember) throws InvalidProtocolBufferException{ |
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.
nit: the indentation seems to be way off here
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.
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.
It seems to me that the PR is not ready for review. Will re-review when it is ready.
A few tests used hedera-services/hedera-node/src/test/java/com/hedera/services/state/expiry/ExpiryManagerTest.java Line 160 in b14894b
hedera-services/hedera-node/src/test/java/com/hedera/services/state/expiry/ExpiryManagerTest.java Line 165 in b14894b
hedera-services/hedera-node/src/test/java/com/hedera/services/state/expiry/ExpiryManagerTest.java Line 187 in b14894b
|
After reviewing with @tinker-michaelj a few modifications needs to be added such as using Cache for |
c56e488
to
2596ae3
Compare
Signed-off-by: abhishek-hedera <[email protected]>
Signed-off-by: abhishek-hedera <[email protected]>
Signed-off-by: abhishek-hedera <[email protected]>
Signed-off-by: abhishek-hedera <[email protected]>
Signed-off-by: abhishek-hedera <[email protected]>
467b037
to
314d040
Compare
Signed-off-by: abhishek-hedera <[email protected]>
Signed-off-by: abhishek-hedera <[email protected]>
Signed-off-by: abhishek-hedera <[email protected]>
|
||
public class PlatformTxnRecord { | ||
|
||
private Cache<Transaction, PlatformTxnAccessor> cache; |
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 put some comments to explain what's the purpose of the PlatformTxnRecord
? and also why a map of <Transaction, PlatformTxnAccessor>
is needed here?
if (!ctx.invariants().holdFor(accessor, effectiveConsensusTime, submittingMember)) { | ||
return; |
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.
Seems like something unusual happened here, should we have a log message here before return?
effectiveConsensusTime = consensusTime.minusNanos(1); | ||
} | ||
public void incorporateConsensusTxn( | ||
Transaction platformTxn, |
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.
Is the parameter platformTxn
used anywhere in this method?
As per the discussion in service team slack channel, this PR will be closed in order to merge the below PRs with new SDK.
|
Signed-off-by: abhishek-hedera [email protected]
Related issue(s):
Closes #1421
Summary of the change:
Modified
ServicesState
,ServicesStateTest
,ProcessLogic
,AwareProcessLogic
to reusePlatformTxnAccessor
.Removed unused imports.
External impacts:
None.
Applicable documentation