fn factory_deps_in_appearance_order(
        header: &L1BatchHeader,
        mut unsorted_factory_deps: HashMap<H256, Vec<u8>>,
        raw_published_bytecode_hashes: &[H256],
    ) -> Vec<Vec<u8>> {
        // TODO(PLA-731): ensure that the protocol version is always available.
        let protocol_version = header
            .protocol_version
            .unwrap_or_else(ProtocolVersionId::last_potentially_undefined);
        if protocol_version.is_pre_boojum() {
            header.l2_to_l1_logs.iter().filter_map(move |log| {
                let inner = &log.0;
                if inner.sender == KNOWN_CODES_STORAGE_ADDRESS {
                    let bytecode = unsorted_factory_deps.remove(&inner.key).unwrap_or_else(|| {
                        panic!(
                            "Failed to get bytecode that was marked as known: bytecode_hash {:?}, L1 batch number {:?}",
                            inner.key, header.number
                        );
                    });
                    Some(bytecode)
                } else {
                    None
                }
            }).collect()
        } else {
            raw_published_bytecode_hashes
                .iter()
                .map(|bytecode_hash| {
                    unsorted_factory_deps
                        .remove(bytecode_hash)
                        .unwrap_or_else(|| {
                            panic!(
                                "Failed to get bytecode that was marked as known: bytecode_hash {:?}, L1 batch number {:?}",
                                bytecode_hash, header.number
                            );
                        })
                })
                .collect()
        }
    }
Iterates over factory deps in the order in which they appeared in this L1 batch.
core/lib/types/src/commitment/mod.rs