Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions fbpcp/entity/mpc_game_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@

from dataclasses import dataclass
from typing import List
from warnings import warn


warn(
f"{__file__} has been moved to fbpcs repo. Please consider https://github.com/facebookresearch/fbpcs/tree/main/fbpcs/private_computation/service/mpc instead.",
DeprecationWarning,
stacklevel=2,
)


@dataclass
Expand Down
8 changes: 8 additions & 0 deletions fbpcp/entity/mpc_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, List, Optional
from warnings import warn

from fbpcp.entity.container_instance import ContainerInstance


warn(
f"{__file__} has been moved to fbpcs repo. Please consider https://github.com/facebookresearch/fbpcs/tree/main/fbpcs/private_computation/service/mpc instead.",
DeprecationWarning,
stacklevel=2,
)


class MPCParty(Enum):
SERVER = "SERVER"
CLIENT = "CLIENT"
Expand Down
8 changes: 8 additions & 0 deletions fbpcp/repository/mpc_game_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@
# pyre-strict

import abc
from warnings import warn

from fbpcp.entity.mpc_game_config import MPCGameConfig


warn(
f"{__file__} has been moved to fbpcs repo. Please consider https://github.com/facebookresearch/fbpcs/tree/main/fbpcs/private_computation/service/mpc instead.",
DeprecationWarning,
stacklevel=2,
)


class MPCGameRepository(abc.ABC):
@abc.abstractmethod
def get_game(self, name: str) -> MPCGameConfig:
Expand Down
8 changes: 8 additions & 0 deletions fbpcp/repository/mpc_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@
# pyre-strict

import abc
from warnings import warn

from fbpcp.entity.mpc_instance import MPCInstance


warn(
f"{__file__} has been moved to fbpcs repo. Please consider https://github.com/facebookresearch/fbpcs/tree/main/fbpcs/private_computation/service/mpc instead.",
DeprecationWarning,
stacklevel=2,
)


class MPCInstanceRepository(abc.ABC):
@abc.abstractmethod
def create(self, instance: MPCInstance) -> None:
Expand Down
16 changes: 16 additions & 0 deletions fbpcp/service/mpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import logging
from typing import Any, Dict, List, Optional

from warnings import warn

from fbpcp.entity.certificate_request import CertificateRequest

from fbpcp.entity.container_instance import ContainerInstance, ContainerInstanceStatus
Expand All @@ -24,6 +26,13 @@
DEFAULT_BINARY_VERSION = "latest"


warn(
f"{__file__} has been moved to fbpcs repo. Please consider https://github.com/facebookresearch/fbpcs/tree/main/fbpcs/private_computation/service/mpc instead.",
DeprecationWarning,
stacklevel=2,
)


class MPCService:
"""MPCService is responsible for distributing a larger MPC game to multiple
MPC workers
Expand All @@ -43,6 +52,13 @@ def __init__(
task_definition -- containers task definition
mpc_game_svc -- service to generate package name and game arguments.
"""

warn(
f"{self.__class__.__name__} has been moved to fbpcs repo. Please consider https://github.com/facebookresearch/fbpcs/tree/main/fbpcs/private_computation/service/mpc instead.",
DeprecationWarning,
stacklevel=2,
)

if container_svc is None or instance_repository is None or mpc_game_svc is None:
raise ValueError(
f"Dependency is missing. container_svc={container_svc}, mpc_game_svc={mpc_game_svc}, "
Expand Down
13 changes: 13 additions & 0 deletions fbpcp/service/mpc_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import logging
from typing import Any, Dict, Optional, Tuple
from warnings import warn

from fbpcp.entity.mpc_game_config import MPCGameConfig
from fbpcp.entity.mpc_instance import MPCParty
Expand All @@ -18,8 +19,20 @@
LIFT_AGGREGATOR_GAME_NAME = "aggregator"


warn(
f"{__file__} has been moved to fbpcs repo. Please consider https://github.com/facebookresearch/fbpcs/tree/main/fbpcs/private_computation/service/mpc instead.",
DeprecationWarning,
stacklevel=2,
)


class MPCGameService:
def __init__(self, mpc_game_repository: MPCGameRepository) -> None:
warn(
f"{self.__class__.__name__} has been moved to fbpcs repo. Please consider https://github.com/facebookresearch/fbpcs/tree/main/fbpcs/private_computation/service/mpc instead.",
DeprecationWarning,
stacklevel=2,
)
self.logger: logging.Logger = logging.getLogger(__name__)
self.mpc_game_repository: MPCGameRepository = mpc_game_repository

Expand Down
15 changes: 8 additions & 7 deletions tests/service/test_mpc_do_not_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# This test file is a short-term to freeze the file change during migration.
# After migration completed, we shall delete this ut test
# TODO: T137598681 clean up FBPCS mpc related files after migration complete
# NOTE: please make further change on fbcode/fbpcs/private_computation/service/mpc/
#############################################################################
import hashlib
import inspect
Expand All @@ -27,35 +28,35 @@
NO_CHANGE_FILES = (
{
"cls": MPCService,
"file_md5": "35dbe2a73b1016d6d631b03abc612929",
"file_md5": "45dc9ee0e1f36882c06c6959b3a7d365",
},
{
"cls": TestMPCService,
"file_md5": "6a1c7a74f28d164e113b68dbcab29962",
},
{
"cls": MPCGameService,
"file_md5": "36a2142e36759e382855e970f12c7403",
"file_md5": "b6e129eed50447bcbc7a7c0537771130",
},
{
"cls": TestMPCGameService,
"file_md5": "e1e4517471ff5630a7a7dc5db645ed5f",
},
{
"cls": MPCGameConfig,
"file_md5": "39326c1de0bb8795313ce84560d25c97",
"file_md5": "02d7ca709340b4fb6aa3f1a3d1616e29",
},
{
"cls": MPCGameRepository,
"file_md5": "d2d09421e3ab8c612a2208d7a0269996",
"file_md5": "3ce0126b0a3602c362789e6a17e1bb0e",
},
{
"cls": MPCInstance,
"file_md5": "4a52cc896d438cb8900649265eb46b71",
"file_md5": "f461fe24c29f68b1350c96567ddf28ef",
},
{
"cls": MPCInstanceRepository,
"file_md5": "251b27ef762c7421a43fe1e8062ce86b",
"file_md5": "9e3e1b712782fbec3f9a869d13954e08",
},
)

Expand All @@ -68,7 +69,7 @@ def test_mpc_service_no_change(self):
self.assertEqual(
no_change_file["file_md5"],
self.gen_file_md5(file_name),
msg=f"assertion on file: {file_name}",
msg=f"assertion on file: {file_name}. you should change mpc in fbcode/fbpcs/private_computation/service/mpc/",
)

def gen_file_md5(self, file_name):
Expand Down