Skip to content

Commit 9c0c4e6

Browse files
riptlripatel-fd
authored andcommitted
restore: print expected lthash
Also fix a rare bug in io_wd that results in a false assertion failure.
1 parent 9d14b11 commit 9c0c4e6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/discof/restore/fd_snapin_tile.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,15 @@ process_manifest( fd_snapin_tile_t * ctx ) {
396396
return;
397397
}
398398

399+
if( manifest->has_accounts_lthash ) {
400+
uchar const * sum = manifest->accounts_lthash;
401+
uchar hash32[32]; fd_blake3_hash( sum, FD_LTHASH_LEN_BYTES, hash32 );
402+
FD_BASE58_ENCODE_32_BYTES( sum, sum_enc );
403+
FD_BASE58_ENCODE_32_BYTES( hash32, hash32_enc );
404+
FD_LOG_NOTICE(( "Snapshot manifest slot=%lu indicates lthash[..32]=%s blake3(lthash)=%s",
405+
manifest->slot, sum_enc, hash32_enc ));
406+
}
407+
399408
manifest->txncache_fork_id = ctx->txncache_root_fork_id.val;
400409

401410
ulong sig = ctx->full ? fd_ssmsg_sig( FD_SSMSG_MANIFEST_FULL ) :

src/discof/restore/utils/fd_vinyl_io_wd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ wd_block_used( fd_vinyl_io_wd_t * wd ) {
7373
FD_CRIT( fd_vinyl_seq_ge( wd->base->seq_future, wd->base->seq_present ), "corrupt bstream io state" );
7474
ulong block_sz = wd->base->seq_future - buf->bstream_seq;
7575
FD_CRIT( block_sz<=wd->wr_mtu, "corrupt bstream io state" );
76-
FD_CRIT( block_sz>0UL, "attempted to dispatch empty buf" );
7776
return block_sz;
7877
}
7978

@@ -92,6 +91,7 @@ wd_dispatch( fd_vinyl_io_wd_t * wd ) {
9291
FD_CRIT( fd_vinyl_seq_ge( wd->base->seq_future, wd->base->seq_present ), "corrupt bstream io state" );
9392
ulong block_sz = wd_block_used( wd );
9493
FD_CRIT( fd_ulong_is_aligned( block_sz, FD_VINYL_BSTREAM_BLOCK_SZ ), "misaligned block_sz (bad appends?)" );
94+
FD_CRIT( block_sz>0UL, "attempted to dispatch empty buf" );
9595

9696
/* Align up block_sz to multiple of 4096 bytes.
9797
This step is critical for good O_DIRECT performance. */

0 commit comments

Comments
 (0)