-
Notifications
You must be signed in to change notification settings - Fork 138
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
feat: Remove TssEncryptionKeyTransaction
's from state
#16772
base: develop
Are you sure you want to change the base?
Conversation
Signed-off-by: Derek Riley <[email protected]>
Signed-off-by: Derek Riley <[email protected]>
Signed-off-by: Derek Riley <[email protected]>
Signed-off-by: Derek Riley <[email protected]>
Signed-off-by: Derek Riley <[email protected]>
Signed-off-by: Derek Riley <[email protected]>
…ice-EncryptionKeyState
Signed-off-by: Derek Riley <[email protected]>
Signed-off-by: Derek Riley <[email protected]>
Signed-off-by: Derek Riley <[email protected]>
Signed-off-by: Derek Riley <[email protected]>
# Conflicts: # hedera-node/hedera-app/src/main/java/com/hedera/node/app/Hedera.java # hedera-node/hedera-app/src/main/java/com/hedera/node/app/HederaInjectionComponent.java # hedera-node/hedera-app/src/main/java/com/hedera/node/app/ServicesMain.java # hedera-node/hedera-app/src/main/java/com/hedera/node/app/tss/TssBaseService.java # hedera-node/hedera-app/src/main/java/com/hedera/node/app/tss/stores/ReadableTssStore.java # hedera-node/hedera-app/src/main/java/com/hedera/node/app/tss/stores/ReadableTssStoreImpl.java # hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/handle/HandleWorkflow.java # hedera-node/hedera-app/src/test/java/com/hedera/node/app/components/IngestComponentTest.java # hedera-node/hedera-app/src/testFixtures/java/com/hedera/node/app/fixtures/state/FakePlatform.java # hedera-node/hedera-config/src/main/java/com/hedera/node/config/data/NetworkAdminConfig.java # hedera-node/test-clients/src/main/java/com/hedera/services/bdd/junit/hedera/embedded/fakes/FakeTssBaseService.java # platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/system/Platform.java # platform-sdk/swirlds-platform-core/src/main/java/module-info.java
Signed-off-by: Petar Tonev <[email protected]>
Signed-off-by: Petar Tonev <[email protected]>
# Conflicts: # platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/crypto/CryptoStatic.java
Signed-off-by: Petar Tonev <[email protected]>
Signed-off-by: Petar Tonev <[email protected]>
# Conflicts: # hapi/hedera-protobufs/block/stream/output/state_changes.proto # hedera-node/hedera-app/src/main/java/com/hedera/node/app/blocks/impl/KVStateChangeListener.java # hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/handle/HandleWorkflow.java # hedera-node/hedera-app/src/test/java/com/hedera/node/app/components/IngestComponentTest.java # hedera-node/test-clients/src/main/java/com/hedera/services/bdd/junit/support/validators/block/StateChangesValidator.java
…rate-tssEncryptionKey
Signed-off-by: Derek Riley <[email protected]>
Signed-off-by: Derek Riley <[email protected]>
Signed-off-by: Derek Riley <[email protected]>
Signed-off-by: Derek Riley <[email protected]>
Signed-off-by: Derek Riley <[email protected]>
…ice-EncryptionKeyState
Signed-off-by: Derek Riley <[email protected]>
Signed-off-by: Derek Riley <[email protected]>
Signed-off-by: Petar Tonev <[email protected]>
Signed-off-by: Derek Riley <[email protected]>
… into local-test # Conflicts: # hedera-node/hedera-app/src/main/java/module-info.java
This reverts commit b5d989b.
This reverts commit 2355cc0.
This reverts commit b1b42f1.
This reverts commit d78b884.
Signed-off-by: Petar Tonev <[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.
The use of a transaction body as a state value seems a bit odd and slightly concerning; perhaps we can simplify that?
Also a few small documentation items.
@@ -384,6 +385,11 @@ enum StateIdentifier { | |||
*/ | |||
STATE_ID_SCHEDULED_USAGES = 34; | |||
|
|||
/** | |||
* A state identifier for TSS Encryption Key |
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: Indentation is off.
/** | ||
* A TSS Encryption Key Transaction Body value. | ||
*/ | ||
com.hedera.hapi.services.auxiliary.tss.TssEncryptionKeyTransactionBody tss_encryption_key_value = 20; |
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.
This seems very odd and concerning. Are we truly storing full transaction bodies in state? If we are, I would recommend changing that, particularly as this message only has one field (of bytes
).
We could more clearly store the bytes
as a value in state with the same "key" used (is it Node ID?) to avoid the added wrapper message and also reduce potential confusion.
*/ | ||
message TssEncryptionKeyTransactionBody { | ||
/** | ||
* The raw bytes of the public TSS encryption key of the node sending the transaction. |
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 raw bytes of the public TSS encryption key of the node sending the transaction. | |
* An array of public TSS key bytes.<br/> | |
* This is the raw bytes of the public TSS encryption key for | |
* the node sending the transaction. |
option java_multiple_files = true; | ||
|
||
/** | ||
* A transaction body for sending the public TSS encryption key. |
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.
This is missing requirements, detail, and block stream effects.
final var tssStore = context.storeFactory().writableStore(WritableTssStore.class); | ||
final var nodeEntityNumber = | ||
EntityNumber.newBuilder().number(context.creatorInfo().nodeId()).build(); | ||
tssStore.put(nodeEntityNumber, op); |
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.
Instead of storing the entire transaction body, could we just store the bytes
of the encryption key (which is the only field in the body)?
That would reduce state size and also make the block stream a little smaller.
I want to note that the serialization mechanism for the keys is being reworked based on a decision to be compatible with Ethereum's format. While we work on the necessary modifications, the |
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.
Thanks for the notice Maxi, I will put that on hold and mark it as a draft until finished. There are also other things for clarification until ready for a review
Description:
This PR aims to clear any
TssEncryptionKeyTransactionBody
from state if the node id mapped to the transaction body is not present in any of the active rosters or a candidate roster. This cleanup is added onrestart()
of RostersSchema, so that the state changes are present in the block stream.Related issue(s):
Fixes #16570
Notes for reviewer:
Checklist