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

Fix state hash size check in fast implementation #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mininny
Copy link
Collaborator

@mininny mininny commented Jan 9, 2025

Description

The fast implementation calculates the state hash from the state witness in the StateWitness.StateHash function.

However, this function implements a length check that is insufficient. The expected length is known to be 362 but the implementation checks that the length is greater than 32 + 32 + 8 + 8 + 1 = 81. We should check the state witness length is equal to the expected length.

@mininny mininny force-pushed the feature/mininny/audit-30 branch from 47f2b66 to f0395da Compare January 9, 2025 14:34
@codecov-commenter
Copy link

Codecov Report

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

Project coverage is 61.86%. Comparing base (bf4e465) to head (f0395da).

Files with missing lines Patch % Lines
rvgo/fast/state.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #118      +/-   ##
==========================================
- Coverage   61.87%   61.86%   -0.01%     
==========================================
  Files          27       27              
  Lines        4126     4125       -1     
==========================================
- Hits         2553     2552       -1     
  Misses       1432     1432              
  Partials      141      141              

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

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.

2 participants