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 function selector check for slow vm #108

Merged
merged 1 commit into from
Jan 8, 2025
Merged

Conversation

mininny
Copy link
Collaborator

@mininny mininny commented Dec 15, 2024

Description

The Go slow implementation is intended to mirror the Solidity implementation. For this, it takes the calldata as input.

However, the slow implementation lacks a check that is abstracted in the Solidity implementation: the function selector.

As the function selector is not checked, calldata with incorrect selector will be executable on the slow implementation but will revert on the Solidity smart contract.

Ensure on the slow implementation that the first 4 bytes of calldata correspond to the correct function selector.

@codecov-commenter
Copy link

codecov-commenter commented Dec 15, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 61.87%. Comparing base (8ff9318) to head (81ee551).

Files with missing lines Patch % Lines
rvgo/slow/vm.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #108      +/-   ##
==========================================
- Coverage   61.89%   61.87%   -0.03%     
==========================================
  Files          27       27              
  Lines        4091     4094       +3     
==========================================
+ Hits         2532     2533       +1     
- Misses       1427     1428       +1     
- Partials      132      133       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mininny mininny force-pushed the feature/mininny/audit-15 branch from c9a7813 to 81ee551 Compare December 16, 2024 01:37
@BlocksOnAChain BlocksOnAChain added the Audit finding grouping for our audit findings label Dec 16, 2024
@mininny mininny added this pull request to the merge queue Jan 8, 2025
Merged via the queue into master with commit 0e65e85 Jan 8, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Audit finding grouping for our audit findings
Development

Successfully merging this pull request may close these issues.

4 participants