def METHOD_NAME(msg: EthereumSignTxEIP1559, data_total: int) -> int:
    length = 0
    fields: tuple[rlp.RLPItem, ...] = (
        msg.nonce,
        msg.gas_limit,
        bytes_from_address(msg.to),
        msg.value,
        msg.chain_id,
        msg.max_gas_fee,
        msg.max_priority_fee,
    )
    for field in fields:
        length += rlp.length(field)
    length += rlp.header_length(data_total, msg.data_initial_chunk)
    length += data_total
    # access_list_length
    payload_length = sum(access_list_item_length(i) for i in msg.access_list)
    access_list_length = rlp.header_length(payload_length) + payload_length
    length += access_list_length
    return length