-
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
Reuse rationalized sig meta #1541
Reuse rationalized sig meta #1541
Conversation
Signed-off-by: tinker-michaelj <[email protected]>
…g user transaction Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
…cessLogic change Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
…isable CI for now Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
…into 01499-01498-ExpandPtaInitFields
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
…eNonBlockingHandoff
Signed-off-by: tinker-michaelj <[email protected]>
…into 01500-M0150-CreateNonBlockingHandoff
Signed-off-by: tinker-michaelj <[email protected]>
…ReuseRationalizedSigMeta
Codecov Report
@@ Coverage Diff @@
## master-plus-sdk-0.15.0 #1541 +/- ##
=========================================================
Coverage 91.53% 91.53%
- Complexity 5896 5903 +7
=========================================================
Files 463 461 -2
Lines 17053 17058 +5
Branches 1780 1784 +4
=========================================================
+ Hits 15609 15614 +5
- Misses 987 988 +1
+ Partials 457 456 -1
Continue to review full report at Codecov.
|
Signed-off-by: tinker-michaelj <[email protected]>
…01-M0150-ReuseRationalizedSigMeta
Signed-off-by: tinker-michaelj <[email protected]>
* @param txnAccessor the accessor for the platform txn | ||
* @param syncVerifier facility for synchronously verifying a cryptographic signature | ||
* @param keyOrderer facility for listing Hedera keys required to sign the gRPC txn | ||
* @param pkToSigFnProvider source of crypto sigs for the simple keys in the Hedera key leaves |
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: @param...
for sigFactoryCreator
is missing
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!
Signed-off-by: tinker-michaelj <[email protected]>
@@ -0,0 +1,96 @@ | |||
package com.hedera.services.utils; | |||
|
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.
copyright missing
import java.util.function.Function; | ||
|
||
import static com.hedera.services.keys.HederaKeyActivation.pkToSigMapFrom; | ||
|
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.
javadoc for the class will be helpful
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!
@@ -0,0 +1,105 @@ | |||
package com.hedera.services.sigs; | |||
|
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.
copyright missing
@@ -0,0 +1,64 @@ | |||
package com.hedera.services.utils; | |||
|
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.
same 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.
Added :/
Signed-off-by: tinker-michaelj <[email protected]>
Signed-off-by: tinker-michaelj <[email protected]>
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 !!
Sonar passed with no non-license code smells here.
Related issue(s)
Summary of the change
Some minor code cleanup:
ScopedSigBytesProvider
type, which only existed to hide whether sig bytes were coming from aSignatureMap
or the now-unsupportedSignatureList
.SigFactoryCreator
type, which only existed to hide whether an outer txn or a scheduled txn was being signed (and the latter case was eliminated in the scheduled txn refactor).ByteString
wrapper fromTxnScopedPlatformSigFactory.create()
.And a big performance win that avoids two kinds of repeated work being done:
rationalizeWithPreConsensusSigs()
duringAwareProcessLogic.doProcess()
, and again inInHandleActivationHelper.areOtherPartiesActive()
.SwirldTransaction
list ofTransactionSignatures
was being accessed at least three times: Once to compare the expanded required signing keys during rationalization, once to construct theFunction<byte[], TransactionSignature>
pub-key-to-sig function for testing payer key activation, and yet again to construct the same pub-key-to-sig function for testing other-party key activation.The solution in this PR is to create a
RationalizedSigMeta
process object that captures the reusable by-products ofRationalization.execute()
; that is,TransactionSignature
s---no matter whether verified synchronously or asynchronously.So in
Rationalization.execute()
we set aRationalizedSigMeta
instance as a field of theTxnAccessor
inRationalization
. This makes reuse trivial, since every downstream component that needs any of the above can just get them from the accessor.