Commit 8713832 1 parent 6653985 commit 8713832 Copy full SHA for 8713832
File tree 1 file changed +2
-0
lines changed
packages/state-transition/src/util
1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ export function computeProposerIndex(
122
122
let i = 0 ;
123
123
const cachedHashInput = Buffer . allocUnsafe ( 32 + 8 ) ;
124
124
cachedHashInput . set ( seed , 0 ) ;
125
+ cachedHashInput . writeUint32LE ( 0 , 32 + 4 ) ;
125
126
let cachedHash : Uint8Array | null = null ;
126
127
while ( true ) {
127
128
// an optimized version of the below naive code
@@ -275,6 +276,7 @@ export function getNextSyncCommitteeIndices(
275
276
let cachedHash : Uint8Array | null = null ;
276
277
const cachedHashInput = Buffer . allocUnsafe ( 32 + 8 ) ;
277
278
cachedHashInput . set ( seed , 0 ) ;
279
+ cachedHashInput . writeUInt32LE ( 0 , 32 + 4 ) ;
278
280
// this simple cache makes sure we don't have to recompute the shuffled index for the next round of activeValidatorCount
279
281
const shuffledResult = new Map < number , number > ( ) ;
280
282
while ( syncCommitteeIndices . length < SYNC_COMMITTEE_SIZE ) {
You can’t perform that action at this time.
0 commit comments