pub fn finalize(self, protocol_version: ProtocolVersionId) -> H256 {
        if protocol_version >= ProtocolVersionId::Version13 {
            let mut digest = [0_u8; 128];
            U256::from(self.number.0).to_big_endian(&mut digest[0..32]);
            U256::from(self.timestamp).to_big_endian(&mut digest[32..64]);
            digest[64..96].copy_from_slice(self.prev_l2_block_hash.as_bytes());
            digest[96..128].copy_from_slice(self.txs_rolling_hash.as_bytes());
            H256(keccak256(&digest))
        } else {
            Self::legacy_hash(self.number)
        }
    }
Returns the hash of the L2 block.

For newer protocol versions, the hash is computed as

```text
keccak256(u256_be(number) ++ u256_be(timestamp) ++ prev_l2_block_hash ++ txs_rolling_hash)
```

Here, `u256_be` is the big-endian 256-bit serialization of a number, and `txs_rolling_hash`
is *the rolling hash* of L2 block transactions. `txs_rolling_hash` is calculated the following way:

- If the L2 block has 0 transactions, then `txs_rolling_hash` is equal to `H256::zero()`.
- If the L2 block has i transactions, then `txs_rolling_hash` is equal to `H(H_{i-1}, H(tx_i))`, where
`H_{i-1}` is the `txs_rolling_hash` of the first `i - 1` transactions.
core/lib/types/src/block.rs