-
-
Notifications
You must be signed in to change notification settings - Fork 331
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: ensure new withdrawalCredentials in switchToCompoundingValidator() #7478
base: unstable
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #7478 +/- ##
============================================
- Coverage 50.48% 50.47% -0.01%
============================================
Files 602 602
Lines 40606 40610 +4
Branches 2230 2230
============================================
Hits 20499 20499
- Misses 20067 20071 +4
Partials 40 40 |
as pointed out on discord, we explicitly convert to lodestar/packages/api/src/utils/server/parser.ts Lines 9 to 12 in a25ea77
however, as a sanity check, we could consider asserting that when we pass the block to state-transition |
Performance Report✔️ no performance regression detected Full benchmark results
|
const newWithdrawalCredentials = validator.withdrawalCredentials.slice(); | ||
const newWithdrawalCredentials = Uint8Array.prototype.slice.call( | ||
validator.withdrawalCredentials, | ||
0, |
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.
Is the second and third param of call()
necessary? Can we do
Uint8Array.prototype.slice.call(validator.withdrawalCredentials);
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.
I don't think it is necessary, but don't mind either way
@nflaig this |
yeah noticed that as well, was pointing that out because only the node that proposed the block has the issue, which is still unclear to me why that is the case |
Motivation
closes #7487
Description
withdrawalCredentials
by enforcing the use ofUint8Array.slice()
, just in case backed data is a BufferUpdate
just found this
even we used this pattern a lot
Uint8Array.prototype.slice.call
in ssz to deserialize state it still return a Bufferwhen we deserialize state from leveldb, the state bytes there is really the Buffer
that's one possibilities how this issue happened