-
Notifications
You must be signed in to change notification settings - Fork 179
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
Copy slice when setting block hash list #6734
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6734 +/- ##
=======================================
Coverage 41.23% 41.24%
=======================================
Files 2054 2054
Lines 182364 182368 +4
=======================================
+ Hits 75204 75219 +15
+ Misses 100859 100852 -7
+ Partials 6301 6297 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
fvm/evm/handler/blockHashList.go
Outdated
cpy := make([]byte, len(bucket)) | ||
copy(cpy, bucket) | ||
|
||
if err != nil { | ||
return err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cpy := make([]byte, len(bucket)) | |
copy(cpy, bucket) | |
if err != nil { | |
return err | |
} | |
if err != nil { | |
return err | |
} | |
cpy := make([]byte, len(bucket)) | |
copy(cpy, bucket) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, we can perform the bucket copy, after we know there's no error.
Do we have a test case that would fail without the fix and pass after the fix? |
@zhangchiqing Added a test in 291d0ca |
Solves the block hash list issue seen in #6552
The writing to the
bucket
was done in a way where the original value of thebucket
was also changed. Later when we were checking if there are changes, the original bucket and the new bucket were the same so no changes were written.This requires an HCU