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

Add delegatecall flag to properly detect delegatecalls #1856

Merged
merged 12 commits into from
Sep 23, 2024

Conversation

jewei1997
Copy link
Contributor

@jewei1997 jewei1997 commented Sep 15, 2024

Describe your changes and provide context

Use an explicit flag in the precompile to detect a delegatecall which is set by the delegatecall opcode in go-ethereum.

Testing performed to validate your change

existing unit tests

Copy link

codecov bot commented Sep 15, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.

Project coverage is 61.07%. Comparing base (cfd8cec) to head (b232be0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
precompiles/bank/bank.go 0.00% 0 Missing and 1 partial ⚠️
precompiles/gov/gov.go 0.00% 0 Missing and 1 partial ⚠️
precompiles/pointer/pointer.go 0.00% 0 Missing and 1 partial ⚠️
precompiles/wasmd/wasmd.go 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1856      +/-   ##
==========================================
- Coverage   61.11%   61.07%   -0.04%     
==========================================
  Files         261      261              
  Lines       23098    23100       +2     
==========================================
- Hits        14116    14108       -8     
- Misses       7986     7999      +13     
+ Partials      996      993       -3     
Flag Coverage Δ
61.07% <71.42%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
precompiles/common/precompiles.go 51.82% <100.00%> (+0.59%) ⬆️
precompiles/distribution/distribution.go 83.25% <100.00%> (ø)
precompiles/ibc/ibc.go 46.77% <100.00%> (ø)
precompiles/staking/staking.go 70.62% <100.00%> (ø)
precompiles/bank/bank.go 55.60% <0.00%> (ø)
precompiles/gov/gov.go 61.84% <0.00%> (ø)
precompiles/pointer/pointer.go 36.00% <0.00%> (ø)
precompiles/wasmd/wasmd.go 60.62% <75.00%> (ø)

... and 2 files with indirect coverage changes

@jewei1997 jewei1997 requested a review from codchen September 16, 2024 03:11
Copy link
Collaborator

@codchen codchen left a comment

Choose a reason for hiding this comment

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

In wasmd precompile can we also change for ExecuteBatch and Instantiate? also can we change to use this flag for these precompiles?

  • bank
  • distribution
  • gov
  • ibc
  • pointer
  • staking

@jewei1997 jewei1997 enabled auto-merge (squash) September 23, 2024 02:45
@jewei1997 jewei1997 disabled auto-merge September 23, 2024 02:59
@jewei1997 jewei1997 enabled auto-merge (squash) September 23, 2024 12:28
@jewei1997 jewei1997 merged commit ad02ac6 into main Sep 23, 2024
49 checks passed
@jewei1997 jewei1997 deleted the add-delegatecall-flag-to-precompile branch September 23, 2024 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants