diff --git a/packages/syft/src/syft/service/code/user_code.py b/packages/syft/src/syft/service/code/user_code.py index 7c3a23b19cf..e4ee37dc14b 100644 --- a/packages/syft/src/syft/service/code/user_code.py +++ b/packages/syft/src/syft/service/code/user_code.py @@ -1952,6 +1952,9 @@ def migrate_usercode_v4_to_v5() -> list[Callable]: return [ make_set_default("origin_node_side_type", NodeSideType.HIGH_SIDE), make_set_default("l0_deny_reason", None), + make_set_default("runtime_policy_type", EmptyRuntimePolicy), + make_set_default("runtime_policy_init_kwargs", None), + make_set_default("runtime_policy_state", b""), drop("enclave_metadata"), ] @@ -1959,14 +1962,24 @@ def migrate_usercode_v4_to_v5() -> list[Callable]: @migrate(UserCode, UserCodeV4) def migrate_usercode_v5_to_v4() -> list[Callable]: return [ - drop(["origin_node_side_type", "l0_deny_reason"]), make_set_default("enclave_metadata", None), + drop( + [ + "origin_node_side_type", + "l0_deny_reason", + "runtime_policy_type", + "runtime_policy_init_kwargs", + "runtime_policy_state", + ] + ), ] @migrate(SubmitUserCodeV4, SubmitUserCode) def upgrade_submitusercode() -> list[Callable]: return [ + make_set_default("runtime_policy_type", EmptyRuntimePolicy), + make_set_default("runtime_policy_init_kwargs", None), drop("enclave_metadata"), ] @@ -1974,5 +1987,6 @@ def upgrade_submitusercode() -> list[Callable]: @migrate(SubmitUserCode, SubmitUserCodeV4) def downgrade_submitusercode() -> list[Callable]: return [ + drop(["runtime_policy_type", "runtime_policy_init_kwargs"]), make_set_default("enclave_metadata", None), ]