Skip to content
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

Remove the idea of virtual addresses and replace with alias(es) #259

Merged
merged 3 commits into from
Feb 10, 2023

Conversation

lukelee-sl
Copy link
Member

Signed-off-by: lukelee-sl [email protected]

Description:
HIP 583 and HIP 631 introduce the idea of virtual addresses. Upon discussion, it was decided
to try to replace virtual addresses by extending the existing alias(es).

Related issue(s):

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@lukelee-sl lukelee-sl requested review from a team as code owners February 7, 2023 19:44
@lukelee-sl lukelee-sl self-assigned this Feb 7, 2023
@lukelee-sl lukelee-sl marked this pull request as draft February 7, 2023 19:44
@lukelee-sl lukelee-sl changed the title Remove the notion of virtual addresses and replace with alias(es) Remove the idea of virtual addresses and replace with alias(es) Feb 7, 2023
Copy link
Contributor

@MiroslavGatsanoga MiroslavGatsanoga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One additional thing to consider: since this PR is dealing with the changes introduced in #242, one of the changes previously introduced was to add evm_address field to transaction_record.proto.
I am not sure if we want to remove that as well, just mentioning it so that it is not accidentally left out.

@@ -104,15 +104,6 @@ message AccountID {
* in that account, without creating anything, and with no creation fee being charged.
*/
bytes alias = 4;

/**
* The ethereum account 20-byte EVM address to be used initially in place of the public key bytes. This EVM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description was taken from the description of the alias field above, we should move it back there since we will be expecting EVM address values in the alias field.

@@ -167,9 +167,4 @@ message CryptoCreateTransactionBody {
* simply be deposited in that account, without creating anything, and with no creation fee being charged.
*/
bytes alias = 18;

/**
* EOA 20-byte address to create that is derived from the keccak-256 hash of a ECDSA_SECP256K1 primitive key.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the comment in basic_types.proto the description of the alias field above could be updated if we decide that we are going to support CryptoCreate with EVM address values in the alias field i.e. CryptoCreates for hollow accounts (still in discussion).

@lukelee-sl
Copy link
Member Author

One additional thing to consider: since this PR is dealing with the changes introduced in #242, one of the changes previously introduced was to add evm_address field to transaction_record.proto. I am not sure if we want to remove that as well, just mentioning it so that it is not accidentally left out.

@Nana-EC This is a good question. Should we update the name of the field to alias? evm_address I think seems more accurate in this context but what do you think?

bytes alias = 1;

/**
* Flag if this alias should now be set or is the default alias on the account.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one alias per account is allowed. We should not add this flag to the protobufs

From the HIP:

As with `HIP-32`, there can only
be a single `alias` per account (except for the `long-zero alias` which all accounts have), and it is immutable, and
therefore an account that has an `alias` cannot have it updated. 

Copy link
Contributor

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

583 focused suggestion

services/crypto_get_info.proto Outdated Show resolved Hide resolved
services/crypto_update.proto Outdated Show resolved Hide resolved
services/get_account_details.proto Outdated Show resolved Hide resolved
Copy link
Contributor

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG, also remove VirtualAddress from basic_types.proto

services/crypto_update.proto Show resolved Hide resolved
Copy link
Member

@steven-sheehy steven-sheehy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need TransactionRecord.evm_address from #242?

@stoqnkpL
Copy link
Contributor

stoqnkpL commented Feb 9, 2023

Do we still need TransactionRecord.evm_address from #242?

We populate evm_address when we execute a CryptoCreate that has as input args an ECDSA key and we want to externalize the calculated EVM address assigned to the account too. I think the Mirror Node requested this, so maybe we should discuss this before deleting it.

@Nana-EC
Copy link
Contributor

Nana-EC commented Feb 9, 2023

Do we still need TransactionRecord.evm_address from #242?

We populate evm_address when we execute a CryptoCreate that has as input args an ECDSA key and we want to externalize the calculated EVM address assigned to the account too. I think the Mirror Node requested this, so maybe we should discuss this before deleting it.

Yeah Mirror Node requested this so it explicitly had the value. This will now only be applicable when an ECDS key alias is set. I believe this prevented mirror node from having to duplicate the calculation logic in the services

@lukelee-sl lukelee-sl marked this pull request as ready for review February 9, 2023 22:22
Copy link
Contributor

@tinker-michaelj tinker-michaelj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lukelee-sl lukelee-sl merged commit 3fa0f5e into main Feb 10, 2023
@lukelee-sl lukelee-sl deleted the use-aliases-instead-of-virtual-addresses branch February 10, 2023 16:02
@jsync-swirlds
Copy link
Member

For future reference, as claimed by steven-sheehy in another PR, 2024-05-16, the versions of these messages with the now-removed fields were never deployed to any version of any software, so there is no reason to reserve the removed field numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

9 participants