Nonces expire, but it’s not based on time, it’s based on consumption. Also any time Boulder’s frontend gets restarted, existing nonces are no longer valid. However, badNonce
is very much a recoverable error, since it always includes a fresh nonce.
My recomendation would be: Don’t bother storing nonces on disk. Keep them in memory only for the lifetime of a process. However, in long-running processes, it’s fine to just use the most recent nonce you have, regardless of how old it is. But make sure to implement retries on badNonce errors.