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

Feat: Refactore IsPrecompileResult type #62

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

mrLSD
Copy link
Member

@mrLSD mrLSD commented Sep 12, 2024

Description

➡️ Refactored IsPrecompileResult type.

  • Removed error relations
  • Remove extra gas cost field

➡️ Refactored is_cold - return result without error

Motivation

Due to the fact that EVM Precompiles cannot contain additional information about gas calculation for a warm address, there is no need for redundant fields in the IsPrecompileResult type. This situation is unreachable.

As a result, this allows us to completely eliminate error returns in the is_cold function, since it cannot return an error. Currently, there are no Precompiles that support warm address logic in their functionality and, at the same time, charge additional gas.

Thus, it is possible to simplify the IsPrecompileResult type without any issues, while making the is_cold mechanism non-error-returning.

Important note: The IsPrecompileResult result is only used for the is_cold function.

@mrLSD mrLSD added the documentation Improvements or additions to documentation label Sep 12, 2024
@mrLSD mrLSD self-assigned this Sep 12, 2024
@mrLSD mrLSD changed the title Fear: Redactore IsPrecompile Fear: Redactore IsPrecompileResult type Sep 12, 2024
@mrLSD mrLSD changed the title Fear: Redactore IsPrecompileResult type Feat: Redactore IsPrecompileResult type Sep 12, 2024
@mrLSD mrLSD changed the title Feat: Redactore IsPrecompileResult type Feat: Refactore IsPrecompileResult type Sep 12, 2024
@mrLSD mrLSD added this to the v0.45.5-aurora milestone Sep 12, 2024
@mrLSD mrLSD added enhancement New feature or request and removed documentation Improvements or additions to documentation labels Sep 12, 2024
Copy link
Member

@aleksuss aleksuss left a comment

Choose a reason for hiding this comment

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

LGTM

@mrLSD mrLSD merged commit 530697e into master Oct 7, 2024
6 checks passed
@mrLSD mrLSD deleted the feat/refactore-is-precompile branch October 7, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants