-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add new fields for externalizing account alias #242
Conversation
Signed-off-by: Miroslav Gatsanoga <[email protected]>
Signed-off-by: Miroslav Gatsanoga <[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.
Initial thoughts reflecting so recent updates
Co-authored-by: Nana Essilfie-Conduah <[email protected]> Signed-off-by: Miroslav Gatsanoga <[email protected]>
0f22707
to
6988e26
Compare
Signed-off-by: Miroslav Gatsanoga <[email protected]> Co-authored-by: Nana Essilfie-Conduah <[email protected]>
Signed-off-by: Miroslav Gatsanoga <[email protected]>
services/basic_types.proto
Outdated
@@ -110,6 +110,7 @@ message AccountID { | |||
*/ | |||
bytes alias = 4; | |||
|
|||
bytes evmAddress = 5; |
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.
We've been using "snake-case" now---so evm_address
, is_default_address
, etc.
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.
Renamed
services/transaction_record.proto
Outdated
@@ -31,6 +31,7 @@ import "custom_fees.proto"; | |||
import "transaction_receipt.proto"; | |||
import "crypto_transfer.proto"; | |||
import "contract_call_local.proto"; | |||
import "crypto_get_info.proto"; |
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.
Unneeded import.
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.
Removed
services/crypto_update.proto
Outdated
@@ -29,6 +29,7 @@ import "basic_types.proto"; | |||
import "duration.proto"; | |||
import "timestamp.proto"; | |||
import "google/protobuf/wrappers.proto"; | |||
import "transaction_record.proto"; |
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.
[ERROR] /Users/michaeltinker/Dev/hedera-protobufs-java/src/main/proto/freeze_service.proto [0:0]: query_header.proto:28:1: File recursively imports itself: query_header.proto -> transaction.proto -> transaction_body.proto -> crypto_update.proto -> transaction_record.proto -> contract_call_local.proto -> query_header.proto
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.
Removed
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.
Just realized there are some unneeded imports causing circular imports.
Signed-off-by: Dimitar Dinev <[email protected]>
services/transaction_record.proto
Outdated
|
||
/** | ||
* Virtual address update info, if virtual address is specified in the CryptoUpdate transaction. At most one update can be performed at a time. | ||
*/ | ||
VirtualAddressUpdate virtual_address_update = 21; |
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.
Won't VirtualAddress
be sufficient here?'
Оnly CryptoUpdate
can remove virtual addresses, and it has the intended VirtualAddressUpdate
in the transaction body. Therefore, if the CryptoUpdate
is successful, mirror node can get the needed virtual address update info from the transaction body, and we won't have to duplicate it in the record, correct?
And in all other transactions with virtual address info in the record, we won't be removing the address, but adding it/updating nonce, so the remove
field of VirtualAddressUpdate
won't be needed -> we can directly use VirtualAddress
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.
Good point.
I like the simplification
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 VirtualAddressUpdate
field can be used in a couple of situations:
- When we're initially creating an account. In a couple of use cases, we need to externalize the
evmAddress
that is calculated on the consensus node side, but a simplebytes calculated_evm_address
field will be sufficient. The nonce value is always 0. - When we're updating an account and adding/removing virtual addresses from this account. In this case, the mirror nodes can extract this information from the transaction body and we don't need to write it in the records.
Conclusion: it looks like we can remove the VirtualAddressUpdate
field and add bytes calculated_evm_address
instead. @steven-sheehy @Nana-EC wdyt?
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.
If we maintain the nonce exposure for the account then simplifying to VirtualAddress
would be right.
If we say we don't care and aren't concerned with capturing nonce for ContractCall/ContractCreate cases then sure just capturing the evmAddress is fine as calculated_evm_address
.
Btw, why calculated_evm_address
vs just evm_address
or account_evm_address
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.
Just evm_address
is fine
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.
Updated.
services/basic_types.proto
Outdated
/** | ||
* Flag if this address is being removed. If false, the virtual address is being added. | ||
*/ | ||
google.protobuf.BoolValue removed = 2; |
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.
what if removed
is not set?
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.
Currently this is for the case where the accounts nonce was incremented and is being exposed in the record stream for mirror node consumption
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.
Outside of the comments other reviewers have requested LGTM, so I'll defer my approvals to them.
Signed-off-by: Miroslav Gatsanoga <[email protected]>
Signed-off-by: Miroslav Gatsanoga <[email protected]>
Signed-off-by: Miroslav Gatsanoga <[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.
Looks good. Just had some comment suggestions to make it explicit where the evm address had to be the keccak-256 hash of a ECDSA_SECP256K1 primitive 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.
Makes sense to me! 👍
Signed-off-by: Miroslav Gatsanoga <[email protected]>
e676c94
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
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: Miroslav Gatsanoga [email protected]
Description:
Creating accounts with EC keys can result in an EVM public address alias being tracked by the consensus nodes. This account identifier should be externalized so that mirror nodes have that information.
AccountID.evm_address
VirtualAddress
message object to capture anevm_address
and its default statusCryptoCreateTransactionBody.evm_address
CryptoGetInfoResponse.virtual_addresses
listCryptoUpdateTransactionBody.virtual_address_update
TransactionRecord.evm_address
Related issue(s):