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

HIP-329 CREATE2 opcode #3161

Closed
steven-sheehy opened this issue Jan 17, 2022 · 0 comments · Fixed by #3217
Closed

HIP-329 CREATE2 opcode #3161

steven-sheehy opened this issue Jan 17, 2022 · 0 comments · Fixed by #3217
Assignees
Labels
contract Area: Smart contracts enhancement Type: New feature P2
Milestone

Comments

@steven-sheehy
Copy link
Member

steven-sheehy commented Jan 17, 2022

Problem

HIP-329 CREATE2 opcode adds support for EIP-1014 generated contract addresses.

Solution

We need to centralize EntityId creation into a service that can do additional lookups. Since we need to also use this from transaction handlers and perhaps other places we should extract it to a separate service class.

  • Add evm_address bytea to contract and contract_history
  • Populate evm_address on contract create
  • Rename REST solidity_address to evm_address
  • Return contract.evm_address on REST API if populated. Else return calculated shard/realm/num format.
  • Add an EntityIdService with the following methods:
    • EntityId lookup(ContractID contractId);
    • void store(EntityId entityId, byte[] evmAddress);
  • Cache lookup method. Don't use cache annotations to avoid reflection penalty for highly used method.
  • Replace any uses of EntityId.of(ContractID) with EntityIdService.lookup(ContractID)
  • Deprecate EntityId.of(ContractID) as we want to ensure the service is used going forward and also because we want to remove protobuf dependencies from common module.

Alternatives

No response

@steven-sheehy steven-sheehy added enhancement Type: New feature P2 contract Area: Smart contracts labels Jan 17, 2022
@steven-sheehy steven-sheehy added this to the 0.50.0 milestone Jan 17, 2022
@xin-hedera xin-hedera self-assigned this Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contract Area: Smart contracts enhancement Type: New feature P2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants