misc: add get_block_size helper function