diff --git a/fhevm-engine/coprocessor/.sqlx/query-081b734c487a7cff66e2dead32f90045f2fb25c9ef20ecd96ecf9ca8203f89b7.json b/fhevm-engine/coprocessor/.sqlx/query-081b734c487a7cff66e2dead32f90045f2fb25c9ef20ecd96ecf9ca8203f89b7.json deleted file mode 100644 index bb4e6589..00000000 --- a/fhevm-engine/coprocessor/.sqlx/query-081b734c487a7cff66e2dead32f90045f2fb25c9ef20ecd96ecf9ca8203f89b7.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT tenant_id, output_handle, dependencies, fhe_operation, is_scalar\n FROM computations c\n WHERE is_completed = false\n AND is_error = false\n AND NOT EXISTS (\n SELECT 1\n FROM unnest(c.dependencies) WITH ORDINALITY AS elems(v, dep_index)\n WHERE (c.tenant_id, elems.v) NOT IN ( SELECT tenant_id, handle FROM ciphertexts )\n -- don't select scalar operands\n AND ( NOT c.is_scalar OR c.is_scalar AND NOT elems.dep_index = 2 )\n )\n LIMIT $1\n FOR UPDATE SKIP LOCKED\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "tenant_id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "output_handle", - "type_info": "Bytea" - }, - { - "ordinal": 2, - "name": "dependencies", - "type_info": "ByteaArray" - }, - { - "ordinal": 3, - "name": "fhe_operation", - "type_info": "Int2" - }, - { - "ordinal": 4, - "name": "is_scalar", - "type_info": "Bool" - } - ], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [ - false, - false, - false, - false, - false - ] - }, - "hash": "081b734c487a7cff66e2dead32f90045f2fb25c9ef20ecd96ecf9ca8203f89b7" -} diff --git a/fhevm-engine/coprocessor/.sqlx/query-2a1d204391cc36d74d12fd4c4dea5a33b30ce93fd4122dbd94cab6d9309358c0.json b/fhevm-engine/coprocessor/.sqlx/query-2a1d204391cc36d74d12fd4c4dea5a33b30ce93fd4122dbd94cab6d9309358c0.json deleted file mode 100644 index 95593e3f..00000000 --- a/fhevm-engine/coprocessor/.sqlx/query-2a1d204391cc36d74d12fd4c4dea5a33b30ce93fd4122dbd94cab6d9309358c0.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO ciphertexts(tenant_id, handle, ciphertext, ciphertext_version, ciphertext_type)\n VALUES ($1, $2, $3, $4, $5)\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int4", - "Bytea", - "Bytea", - "Int2", - "Int2" - ] - }, - "nullable": [] - }, - "hash": "2a1d204391cc36d74d12fd4c4dea5a33b30ce93fd4122dbd94cab6d9309358c0" -} diff --git a/fhevm-engine/coprocessor/.sqlx/query-48b4b72956ffe769833233606ef487674eeccfedd5f8660e64662077421ea43c.json b/fhevm-engine/coprocessor/.sqlx/query-48b4b72956ffe769833233606ef487674eeccfedd5f8660e64662077421ea43c.json new file mode 100644 index 00000000..498d552c --- /dev/null +++ b/fhevm-engine/coprocessor/.sqlx/query-48b4b72956ffe769833233606ef487674eeccfedd5f8660e64662077421ea43c.json @@ -0,0 +1,46 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH RECURSIVE dependent_computations(tenant_id, output_handle, dependencies, fhe_operation, is_scalar, produced_handles) AS (\n SELECT c.tenant_id, c.output_handle, c.dependencies, c.fhe_operation, c.is_scalar, ARRAY[ROW(c.tenant_id, c.output_handle)]\n FROM computations c\n WHERE is_completed = false\n AND is_error = false\n AND NOT EXISTS (\n SELECT 1\n FROM unnest(c.dependencies) WITH ORDINALITY AS elems(v, dep_index)\n WHERE (c.tenant_id, elems.v) NOT IN ( SELECT tenant_id, handle FROM ciphertexts )\n -- don't select scalar operands\n AND (\n NOT c.is_scalar\n OR c.is_scalar AND NOT elems.dep_index = 2\n )\n -- ignore fhe random, trivial encrypt operations, all inputs are scalars\n AND NOT c.fhe_operation = ANY(ARRAY[24, 26, 27])\n )\n UNION ALL\n SELECT c.tenant_id, c.output_handle, c.dependencies, c.fhe_operation, c.is_scalar, dc.produced_handles || ROW(c.tenant_id, c.output_handle)\n FROM dependent_computations dc, computations c\n WHERE is_completed = false\n AND is_error = false\n AND NOT EXISTS (\n SELECT 1\n FROM unnest(c.dependencies) WITH ORDINALITY AS elems(v, dep_index)\n WHERE (c.tenant_id, elems.v) NOT IN ( SELECT tenant_id, handle FROM ciphertexts )\n AND NOT ROW(c.tenant_id, elems.v) = ANY(dc.produced_handles)\n -- don't select scalar operands\n AND (\n NOT c.is_scalar\n OR c.is_scalar AND NOT elems.dep_index = 2\n )\n -- ignore fhe random, trivial encrypt operations, all inputs are scalars\n AND NOT c.fhe_operation = ANY(ARRAY[24, 26, 27])\n )\n AND dc.output_handle = ANY(c.dependencies)\n AND dc.tenant_id = c.tenant_id\n ) SEARCH DEPTH FIRST BY output_handle SET computation_order,\n limited_computations AS (\n SELECT tenant_id, output_handle\n FROM dependent_computations\n GROUP BY tenant_id, output_handle\n ORDER BY min(computation_order)\n LIMIT $1\n )\n SELECT tenant_id, output_handle, dependencies, fhe_operation, is_scalar\n FROM computations\n WHERE (tenant_id, output_handle) IN (\n SELECT tenant_id, output_handle FROM limited_computations\n )\n FOR UPDATE SKIP LOCKED\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "tenant_id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "output_handle", + "type_info": "Bytea" + }, + { + "ordinal": 2, + "name": "dependencies", + "type_info": "ByteaArray" + }, + { + "ordinal": 3, + "name": "fhe_operation", + "type_info": "Int2" + }, + { + "ordinal": 4, + "name": "is_scalar", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Int8" + ] + }, + "nullable": [ + false, + false, + false, + false, + false + ] + }, + "hash": "48b4b72956ffe769833233606ef487674eeccfedd5f8660e64662077421ea43c" +} diff --git a/fhevm-engine/coprocessor/.sqlx/query-542528254fdf7530d949fc433de8ec9064d5ac5d655efa8aa0927cb7b23bddba.json b/fhevm-engine/coprocessor/.sqlx/query-542528254fdf7530d949fc433de8ec9064d5ac5d655efa8aa0927cb7b23bddba.json deleted file mode 100644 index 591c7e3a..00000000 --- a/fhevm-engine/coprocessor/.sqlx/query-542528254fdf7530d949fc433de8ec9064d5ac5d655efa8aa0927cb7b23bddba.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT sks_key, cks_key\n FROM tenants\n WHERE tenant_id = $1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "sks_key", - "type_info": "Bytea" - }, - { - "ordinal": 1, - "name": "cks_key", - "type_info": "Bytea" - } - ], - "parameters": { - "Left": [ - "Int4" - ] - }, - "nullable": [ - false, - true - ] - }, - "hash": "542528254fdf7530d949fc433de8ec9064d5ac5d655efa8aa0927cb7b23bddba" -} diff --git a/fhevm-engine/coprocessor/.sqlx/query-b3c087db688b8b51227d7ed02f53e5361d4454a700260d10b3c7eed6f5cd6653.json b/fhevm-engine/coprocessor/.sqlx/query-65760e473cede92be4190c148a5e53d6fefcde24eb5a022105d3208ea430114a.json similarity index 57% rename from fhevm-engine/coprocessor/.sqlx/query-b3c087db688b8b51227d7ed02f53e5361d4454a700260d10b3c7eed6f5cd6653.json rename to fhevm-engine/coprocessor/.sqlx/query-65760e473cede92be4190c148a5e53d6fefcde24eb5a022105d3208ea430114a.json index 46c65d99..1ff7ded2 100644 --- a/fhevm-engine/coprocessor/.sqlx/query-b3c087db688b8b51227d7ed02f53e5361d4454a700260d10b3c7eed6f5cd6653.json +++ b/fhevm-engine/coprocessor/.sqlx/query-65760e473cede92be4190c148a5e53d6fefcde24eb5a022105d3208ea430114a.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT tenant_id, chain_id, verifying_contract_address, pks_key, sks_key\n FROM tenants\n WHERE tenant_id = ANY($1::INT[])\n ", + "query": "\n SELECT tenant_id, chain_id, acl_contract_address, verifying_contract_address, pks_key, sks_key, public_params\n FROM tenants\n WHERE tenant_id = ANY($1::INT[])\n ", "describe": { "columns": [ { @@ -15,18 +15,28 @@ }, { "ordinal": 2, - "name": "verifying_contract_address", + "name": "acl_contract_address", "type_info": "Text" }, { "ordinal": 3, + "name": "verifying_contract_address", + "type_info": "Text" + }, + { + "ordinal": 4, "name": "pks_key", "type_info": "Bytea" }, { - "ordinal": 4, + "ordinal": 5, "name": "sks_key", "type_info": "Bytea" + }, + { + "ordinal": 6, + "name": "public_params", + "type_info": "Bytea" } ], "parameters": { @@ -39,8 +49,10 @@ false, false, false, + false, + false, false ] }, - "hash": "b3c087db688b8b51227d7ed02f53e5361d4454a700260d10b3c7eed6f5cd6653" + "hash": "65760e473cede92be4190c148a5e53d6fefcde24eb5a022105d3208ea430114a" } diff --git a/fhevm-engine/coprocessor/.sqlx/query-80d29059e0d56c3e3b92d98b68cff622e857564cba1193edc4837d604c322b7e.json b/fhevm-engine/coprocessor/.sqlx/query-80d29059e0d56c3e3b92d98b68cff622e857564cba1193edc4837d604c322b7e.json deleted file mode 100644 index 88f0a8e6..00000000 --- a/fhevm-engine/coprocessor/.sqlx/query-80d29059e0d56c3e3b92d98b68cff622e857564cba1193edc4837d604c322b7e.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT tenant_id, pks_key, sks_key\n FROM tenants\n WHERE tenant_id = ANY($1::INT[])\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "tenant_id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "pks_key", - "type_info": "Bytea" - }, - { - "ordinal": 2, - "name": "sks_key", - "type_info": "Bytea" - } - ], - "parameters": { - "Left": [ - "Int4Array" - ] - }, - "nullable": [ - false, - false, - false - ] - }, - "hash": "80d29059e0d56c3e3b92d98b68cff622e857564cba1193edc4837d604c322b7e" -} diff --git a/fhevm-engine/coprocessor/.sqlx/query-872e18492a01ef297c2747b1168c6b4fd16cebdcd07cfa14f55cf7dd61c910e6.json b/fhevm-engine/coprocessor/.sqlx/query-872e18492a01ef297c2747b1168c6b4fd16cebdcd07cfa14f55cf7dd61c910e6.json deleted file mode 100644 index 5d1c1e18..00000000 --- a/fhevm-engine/coprocessor/.sqlx/query-872e18492a01ef297c2747b1168c6b4fd16cebdcd07cfa14f55cf7dd61c910e6.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO ciphertexts(tenant_id, handle, ciphertext, ciphertext_version, ciphertext_type)\n VALUES($1, $2, $3, $4, $5)\n ON CONFLICT (tenant_id, handle, ciphertext_version) DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int4", - "Bytea", - "Bytea", - "Int2", - "Int2" - ] - }, - "nullable": [] - }, - "hash": "872e18492a01ef297c2747b1168c6b4fd16cebdcd07cfa14f55cf7dd61c910e6" -} diff --git a/fhevm-engine/coprocessor/.sqlx/query-b659b963113ba7d1f85912b00c0a3a5e9d3500c23adfabf5e0e1e4eddb52540a.json b/fhevm-engine/coprocessor/.sqlx/query-b659b963113ba7d1f85912b00c0a3a5e9d3500c23adfabf5e0e1e4eddb52540a.json new file mode 100644 index 00000000..e3bc213f --- /dev/null +++ b/fhevm-engine/coprocessor/.sqlx/query-b659b963113ba7d1f85912b00c0a3a5e9d3500c23adfabf5e0e1e4eddb52540a.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO tenants(\n tenant_api_key,\n chain_id,\n acl_contract_address,\n verifying_contract_address,\n pks_key,\n sks_key,\n public_params\n )\n VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7\n )\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Int4", + "Text", + "Text", + "Bytea", + "Bytea", + "Bytea" + ] + }, + "nullable": [] + }, + "hash": "b659b963113ba7d1f85912b00c0a3a5e9d3500c23adfabf5e0e1e4eddb52540a" +} diff --git a/fhevm-engine/coprocessor/.sqlx/query-c4a8cd701c76572b62939f26b74cdf1a7f8a5c436422f0334382da23505832a7.json b/fhevm-engine/coprocessor/.sqlx/query-c4a8cd701c76572b62939f26b74cdf1a7f8a5c436422f0334382da23505832a7.json deleted file mode 100644 index 9f86c14f..00000000 --- a/fhevm-engine/coprocessor/.sqlx/query-c4a8cd701c76572b62939f26b74cdf1a7f8a5c436422f0334382da23505832a7.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT cks_key\n FROM tenants\n WHERE tenant_id = $1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "cks_key", - "type_info": "Bytea" - } - ], - "parameters": { - "Left": [ - "Int4" - ] - }, - "nullable": [ - true - ] - }, - "hash": "c4a8cd701c76572b62939f26b74cdf1a7f8a5c436422f0334382da23505832a7" -} diff --git a/fhevm-engine/coprocessor/.sqlx/query-a3b21adb66baf8e2a9c899b4d5f8c17d9acc17e159696dbbb943ca8fc26f583a.json b/fhevm-engine/coprocessor/.sqlx/query-ddd753bff5727bd1cdd6f245013735d831cbcadb9a3deef7a40325e8da88ec77.json similarity index 52% rename from fhevm-engine/coprocessor/.sqlx/query-a3b21adb66baf8e2a9c899b4d5f8c17d9acc17e159696dbbb943ca8fc26f583a.json rename to fhevm-engine/coprocessor/.sqlx/query-ddd753bff5727bd1cdd6f245013735d831cbcadb9a3deef7a40325e8da88ec77.json index 3ebf008c..6d73d452 100644 --- a/fhevm-engine/coprocessor/.sqlx/query-a3b21adb66baf8e2a9c899b4d5f8c17d9acc17e159696dbbb943ca8fc26f583a.json +++ b/fhevm-engine/coprocessor/.sqlx/query-ddd753bff5727bd1cdd6f245013735d831cbcadb9a3deef7a40325e8da88ec77.json @@ -1,11 +1,11 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT ciphertext, ciphertext_type, handle\n FROM ciphertexts\n WHERE tenant_id = $1\n AND handle = ANY($2::BYTEA[])\n AND ciphertext_version = $3\n ", + "query": "\n SELECT handle, ciphertext_type, ciphertext_version, ciphertext\n FROM ciphertexts\n WHERE tenant_id = $1\n AND handle = ANY($2::BYTEA[])\n ", "describe": { "columns": [ { "ordinal": 0, - "name": "ciphertext", + "name": "handle", "type_info": "Bytea" }, { @@ -15,22 +15,27 @@ }, { "ordinal": 2, - "name": "handle", + "name": "ciphertext_version", + "type_info": "Int2" + }, + { + "ordinal": 3, + "name": "ciphertext", "type_info": "Bytea" } ], "parameters": { "Left": [ "Int4", - "ByteaArray", - "Int2" + "ByteaArray" ] }, "nullable": [ + false, false, false, false ] }, - "hash": "a3b21adb66baf8e2a9c899b4d5f8c17d9acc17e159696dbbb943ca8fc26f583a" + "hash": "ddd753bff5727bd1cdd6f245013735d831cbcadb9a3deef7a40325e8da88ec77" } diff --git a/fhevm-engine/coprocessor/.sqlx/query-f4c7f18af089735e942488b1c643064fd0ea38f3b1e908344002701ab6ce5f31.json b/fhevm-engine/coprocessor/.sqlx/query-f4c7f18af089735e942488b1c643064fd0ea38f3b1e908344002701ab6ce5f31.json deleted file mode 100644 index c550bd0c..00000000 --- a/fhevm-engine/coprocessor/.sqlx/query-f4c7f18af089735e942488b1c643064fd0ea38f3b1e908344002701ab6ce5f31.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT tenant_id, output_handle, dependencies, fhe_operation, is_scalar\n FROM computations c\n WHERE is_completed = false\n AND is_error = false\n AND NOT EXISTS (\n SELECT 1\n FROM unnest(c.dependencies) WITH ORDINALITY AS elems(v, dep_index)\n WHERE (c.tenant_id, elems.v) NOT IN ( SELECT tenant_id, handle FROM ciphertexts )\n -- don't select scalar operands\n AND (\n NOT c.is_scalar\n OR c.is_scalar AND NOT elems.dep_index = 2\n )\n -- ignore fhe random operations, all inputs are scalars\n AND NOT c.fhe_operation = ANY(ARRAY[26, 27])\n )\n LIMIT $1\n FOR UPDATE SKIP LOCKED\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "tenant_id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "output_handle", - "type_info": "Bytea" - }, - { - "ordinal": 2, - "name": "dependencies", - "type_info": "ByteaArray" - }, - { - "ordinal": 3, - "name": "fhe_operation", - "type_info": "Int2" - }, - { - "ordinal": 4, - "name": "is_scalar", - "type_info": "Bool" - } - ], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [ - false, - false, - false, - false, - false - ] - }, - "hash": "f4c7f18af089735e942488b1c643064fd0ea38f3b1e908344002701ab6ce5f31" -}