Question about a strange error when using block in numpyro

I think you can use exposed_types=["prng_key"] in block handler. Alternatively, you can do

key = numpyro.rng_key()
with block(), handlers.seed(rng_seed=key):
    sub_program()

The later approach makes it clear that the main program has deterministic keys regardless the number of sample statements in the blocked program.