Skip to content

Commit 31ea548

Browse files
committed
disco: shred tile chained merkle root on new slot
1 parent ac500c5 commit 31ea548

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/disco/shred/fd_shred_tile.c

+11-9
Original file line numberDiff line numberDiff line change
@@ -466,16 +466,18 @@ during_frag( fd_shred_ctx_t * ctx,
466466
/* Reset batch count if we are in a new slot */
467467
ctx->batch_cnt = 0UL;
468468
ctx->slot = target_slot;
469-
}
470469

471-
if( FD_UNLIKELY( SHOULD_PROCESS_THESE_SHREDS ) ) {
472-
/* chained_merkle_root is set as the merkle root of the last FEC set
473-
of the parent block (and passed in by POH tile) */
474-
if( FD_LIKELY( entry_meta->parent_block_id_valid ) ) {
475-
memcpy( ctx->chained_merkle_root, entry_meta->parent_block_id, FD_SHRED_MERKLE_ROOT_SZ );
476-
} else {
477-
ctx->metrics->invalid_block_id_cnt++;
478-
memset( ctx->chained_merkle_root, 0, FD_SHRED_MERKLE_ROOT_SZ );
470+
/* Only copy parent_block_id to chained_merkle_root at the beginning
471+
of a new slot*/
472+
if( FD_UNLIKELY( SHOULD_PROCESS_THESE_SHREDS ) ) {
473+
/* chained_merkle_root is set as the merkle root of the last FEC set
474+
of the parent block (and passed in by POH tile) */
475+
if( FD_LIKELY( entry_meta->parent_block_id_valid ) ) {
476+
memcpy( ctx->chained_merkle_root, entry_meta->parent_block_id, FD_SHRED_MERKLE_ROOT_SZ );
477+
} else {
478+
ctx->metrics->invalid_block_id_cnt++;
479+
memset( ctx->chained_merkle_root, 0, FD_SHRED_MERKLE_ROOT_SZ );
480+
}
479481
}
480482
}
481483

0 commit comments

Comments
 (0)