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

System accounts disambiguation #8119

Closed
6 tasks done
stoqnkpL opened this issue Aug 21, 2023 · 0 comments
Closed
6 tasks done

System accounts disambiguation #8119

stoqnkpL opened this issue Aug 21, 2023 · 0 comments
Assignees
Labels
Blocker Further development work cannot be done. Epic A body of work that can be broken down into specific tasks. Limechain Work planned for the LimeChain team Work Package Limechain Work package

Comments

@stoqnkpL
Copy link
Collaborator

stoqnkpL commented Aug 21, 2023

Definition

Create a design document describing the expected behavior of the EVM when operating on Hedera system accounts and push it to the repository as an .md file.

Create a test plan and implement individual test cases asserting the current behavior is aligned with the design.

Observe the current version of the Operations classes (e.g. HederaSelfDestructOperationV038), the modularized version of the operation classes (e.g. CustomSelfDestructOperation) and assert that they provide a similar behavior inline with the definition in the Specification section of this document.

Abstract

Hedera’s EVM implementation will diverge from the Ethereum specification in order to handle operations on system accounts differently. EVM operations that work in any way with addresses include all Call operations, the SelfDestruct operation, Balance operation, and all ExtCode operations. The expected behavior for each is described in the Specification section of this document.

Motivation

Ethereum addresses 0x0 → 0x3E8 map to Hedera IDs 0.0.0 → 0.0.1000.

When a call is made to an address, the EVM loads the corresponding code belonging to the contract with Hedera ID mapping to the EVM address that was called.

Ethereum addresses 0x1 → 0x9 are special addresses on which precompiled contracts exist. For example, the Solidity language keyword ecrecover is “sugar syntax” which compiles to a call to address 0x1. More information here.
Hedera IDs in the range 0.0.1 → 0.0.1000 are reserved for “system” accounts. Some of them exist today - for example the genesis account, the fee collecting account, etc - and more can be created in the future.

Rationale

Described in Hedera/Ethereum precompiles equivalence

Backwards Compatibility

This is a breaking change fixing incorrect behavior from the past. We do not expect to be backwards compatible.

Security Implications

The changes described here should improve overal security when related to Hedera system accounts and EVM operations.

References & Dependencies

PR5962 EVM version update and optimisations - this PR provides version 38 of the operation classes that are affected by the specification in this document.

PR7000 Refactor operations to eliminate duplicate code between EVM versions -
PR6985 Blocking transfers through HTSPrecompile for system account receivers 0.0.1-750.

@stoqnkpL stoqnkpL added Epic A body of work that can be broken down into specific tasks. Limechain Work planned for the LimeChain team Work Package Limechain Work package labels Aug 21, 2023
@bibitibooo1 bibitibooo1 added the Blocker Further development work cannot be done. label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocker Further development work cannot be done. Epic A body of work that can be broken down into specific tasks. Limechain Work planned for the LimeChain team Work Package Limechain Work package
Projects
Status: Done
Development

No branches or pull requests

5 participants