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

EVM: Native precompile address fe prefix #981

Merged
merged 4 commits into from
Dec 22, 2022

Conversation

mriise
Copy link
Contributor

@mriise mriise commented Dec 21, 2022

@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2022

Codecov Report

Merging #981 (4f1b218) into next (393d7da) will increase coverage by 0.06%.
The diff coverage is 70.76%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             next     #981      +/-   ##
==========================================
+ Coverage   88.08%   88.15%   +0.06%     
==========================================
  Files         128      128              
  Lines       23414    23442      +28     
==========================================
+ Hits        20625    20665      +40     
+ Misses       2789     2777      -12     
Impacted Files Coverage Δ
actors/evm/src/interpreter/precompiles/mod.rs 66.66% <70.76%> (+37.85%) ⬆️
state/src/check.rs 86.08% <0.00%> (-0.27%) ⬇️
test_vm/src/lib.rs 80.12% <0.00%> (-0.19%) ⬇️
actors/power/src/lib.rs 83.62% <0.00%> (+0.21%) ⬆️
runtime/src/dispatch.rs 98.86% <0.00%> (+1.13%) ⬆️

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

This looks correct but has more math than I'd like.

actors/evm/src/interpreter/precompiles/mod.rs Outdated Show resolved Hide resolved
actors/evm/src/interpreter/precompiles/mod.rs Outdated Show resolved Hide resolved
@mriise mriise force-pushed the mriise/native-precompile-prefix branch from f4d4e26 to d22b73c Compare December 22, 2022 09:43
#[inline]
pub fn is_precompile(addr: &U256) -> bool {
!addr.is_zero() && addr <= &Self::MAX_PRECOMPILE
!addr.is_zero() && Self::lookup_precompile(&addr.to_bytes()).is_some()
Copy link
Member

Choose a reason for hiding this comment

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

We can probably drop the "is zero" check (or we can just leave it, doesn't really matter).

@mriise mriise merged commit e1ef665 into next Dec 22, 2022
@mriise mriise deleted the mriise/native-precompile-prefix branch December 22, 2022 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants