Finish statistics for envelopes
Refactor transaction_spec