)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000085,"name":"Connor Brewster","display_name":"cbrewster","email":"cbrewster@hey.com","username":"cbrewster"},"change_message_id":"c1748a395f5799a44648b1be32b0e5003b107160","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"e70c0cb3_5472d1df","updated":"2024-07-01 17:46:45.000000000","message":"Nice! I\u0027m curious about the impacts the alternative nar URLs will have on the upload path. IIUC `nix copy` client will want to use regular NAR hashes when uploading.","commit_id":"28cbe0495edbcf02e78abb2db58ad6c8d4d5b75f"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"2e3ccc89bfab4ad7ba6b4b6ffb9cb7cf38b99a2c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"286b856c_c3a11bf8","in_reply_to":"24e0aa5c_5d39dd65","updated":"2024-07-20 12:16:56.000000000","message":"See the FUTUREWORK in cl/11987 for this too.","commit_id":"28cbe0495edbcf02e78abb2db58ad6c8d4d5b75f"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"e72687431a9e8368d2852e43ab0e9e73bff3b508","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"24e0aa5c_5d39dd65","in_reply_to":"e70c0cb3_5472d1df","updated":"2024-07-01 18:31:02.000000000","message":"already replied in the other comment, but essentially the client doesn\u0027t check afterwards an already uploaded store path did indeed \"persist\" where it was uploaded to.\n\nWe might do some unnecessary copying, if Nix thinks something isn\u0027t there yet, but I\u0027d assume nar-bridge would be something deployed somewhere local to the uploading job, and tvix-castore would be spoken to a more remote location, which would also avoid uploads.\n\nThis can also partially be alleviated by keeping track of all uploaded nar hashes too.","commit_id":"28cbe0495edbcf02e78abb2db58ad6c8d4d5b75f"}],"tvix/default.nix":[{"author":{"_account_id":1000090,"name":"Ilan Joselevich","email":"personal@ilanjoselevich.com","username":"kranzes"},"change_message_id":"11ac847c35c626e9664ac9872e1649ee0a21b6ac","unresolved":true,"context_lines":[{"line_number":14,"context_line":"  # Load the crate2nix crate tree."},{"line_number":15,"context_line":"  crates \u003d pkgs.callPackage ./Cargo.nix {"},{"line_number":16,"context_line":"    defaultCrateOverrides \u003d pkgs.defaultCrateOverrides // {"},{"line_number":17,"context_line":"      nar-bridge \u003d prev: {"},{"line_number":18,"context_line":"        nativeBuildInputs \u003d protobufDep prev;"},{"line_number":19,"context_line":"        src \u003d depot.tvix.utils.filterRustCrateSrc { root \u003d prev.src.origSrc; };"},{"line_number":20,"context_line":"      };"}],"source_content_type":"text/x-nix","patch_set":5,"id":"b5d94f76_eec11027","line":17,"updated":"2024-07-01 00:48:11.000000000","message":"A bit of a nitpick but can you move it down below in the attrset where we have our other workspace members?","commit_id":"8ba01634be3d00a289aa1dc69ae59650aeb3ec12"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"d4a8066076efd0f98c3bab7d21d24e50ad17c581","unresolved":false,"context_lines":[{"line_number":14,"context_line":"  # Load the crate2nix crate tree."},{"line_number":15,"context_line":"  crates \u003d pkgs.callPackage ./Cargo.nix {"},{"line_number":16,"context_line":"    defaultCrateOverrides \u003d pkgs.defaultCrateOverrides // {"},{"line_number":17,"context_line":"      nar-bridge \u003d prev: {"},{"line_number":18,"context_line":"        nativeBuildInputs \u003d protobufDep prev;"},{"line_number":19,"context_line":"        src \u003d depot.tvix.utils.filterRustCrateSrc { root \u003d prev.src.origSrc; };"},{"line_number":20,"context_line":"      };"}],"source_content_type":"text/x-nix","patch_set":5,"id":"7cb6c491_c2c0140f","line":17,"in_reply_to":"b5d94f76_eec11027","updated":"2024-07-01 06:42:27.000000000","message":"This list is alphabetically sorted (well, except nix-compat).\n\nHowever, thanks to https://github.com/NixOS/nixpkgs/pull/321544 we should be able to only list our own crates here after the next nixpkgs bump, so I\u0027d like to push this to later.","commit_id":"8ba01634be3d00a289aa1dc69ae59650aeb3ec12"}],"tvix/nar-bridge/src/bin/nar-bridge.rs":[{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"d2557a908f672c19263ef2988544604b6811a76f","unresolved":true,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    let app \u003d Router::new()"},{"line_number":65,"context_line":"        .route(\"/\", get(root))"},{"line_number":66,"context_line":"        .route(\"/nar/:root_node_enc\", get(get_nar))"},{"line_number":67,"context_line":"        .route(\"/:narinfo_str\", get(get_narinfo))"},{"line_number":68,"context_line":"        .route(\"/nix-cache-info\", get(move || nix_cache_info(cli.priority)))"},{"line_number":69,"context_line":"        .with_state(state.clone());"}],"source_content_type":"text/x-rustsrc","patch_set":8,"id":"59250cc6_7b35fb13","line":66,"updated":"2024-07-01 07:29:15.000000000","message":"It might make sense to pick a different route here, so these requests can be clearly distinguished from other `{narhash}.nar[.compression]` requests.","commit_id":"b468311e26634d1bed465f693dea68fb81013d55"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"d428f7213885cfd6f12662601b234f5ef517d49b","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    let app \u003d Router::new()"},{"line_number":65,"context_line":"        .route(\"/\", get(root))"},{"line_number":66,"context_line":"        .route(\"/nar/:root_node_enc\", get(get_nar))"},{"line_number":67,"context_line":"        .route(\"/:narinfo_str\", get(get_narinfo))"},{"line_number":68,"context_line":"        .route(\"/nix-cache-info\", get(move || nix_cache_info(cli.priority)))"},{"line_number":69,"context_line":"        .with_state(state.clone());"}],"source_content_type":"text/x-rustsrc","patch_set":8,"id":"ebc99bb6_65e127fe","line":66,"in_reply_to":"59250cc6_7b35fb13","updated":"2024-07-20 12:15:49.000000000","message":"Done","commit_id":"b468311e26634d1bed465f693dea68fb81013d55"}],"tvix/nar-bridge/src/lib.rs":[{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"d2557a908f672c19263ef2988544604b6811a76f","unresolved":true,"context_lines":[{"line_number":32,"context_line":"        }"},{"line_number":33,"context_line":"    }"},{"line_number":34,"context_line":"}"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"#[instrument(skip(path_info_service))]"},{"line_number":37,"context_line":"pub async fn get_narinfo("},{"line_number":38,"context_line":"    axum::extract::Path(narinfo_str): axum::extract::Path\u003cString\u003e,"}],"source_content_type":"text/x-rustsrc","patch_set":8,"id":"d47631af_a0db0f9e","line":35,"updated":"2024-07-01 07:29:15.000000000","message":"should be moved into two submodules (one for the narinfo, one for the nar bits), and tests added","commit_id":"b468311e26634d1bed465f693dea68fb81013d55"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"d428f7213885cfd6f12662601b234f5ef517d49b","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        }"},{"line_number":33,"context_line":"    }"},{"line_number":34,"context_line":"}"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"#[instrument(skip(path_info_service))]"},{"line_number":37,"context_line":"pub async fn get_narinfo("},{"line_number":38,"context_line":"    axum::extract::Path(narinfo_str): axum::extract::Path\u003cString\u003e,"}],"source_content_type":"text/x-rustsrc","patch_set":8,"id":"a9168aef_1c02b5f7","line":35,"in_reply_to":"d47631af_a0db0f9e","updated":"2024-07-20 12:15:49.000000000","message":"Done (sans tests)","commit_id":"b468311e26634d1bed465f693dea68fb81013d55"},{"author":{"_account_id":1000085,"name":"Connor Brewster","display_name":"cbrewster","email":"cbrewster@hey.com","username":"cbrewster"},"change_message_id":"c1748a395f5799a44648b1be32b0e5003b107160","unresolved":true,"context_lines":[{"line_number":80,"context_line":"        StatusCode::INTERNAL_SERVER_ERROR"},{"line_number":81,"context_line":"    })?;"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    // encode the (unnamed) root node in the NAR url itself."},{"line_number":84,"context_line":"    let root_node \u003d path_info"},{"line_number":85,"context_line":"        .node"},{"line_number":86,"context_line":"        .as_ref()"}],"source_content_type":"text/x-rustsrc","patch_set":11,"id":"d9c4976b_4c05c510","line":83,"updated":"2024-07-01 17:46:45.000000000","message":"neat! I wonder if we\u0027ll run into any problems with base names that are too long?\n\nWill this cause any issues for uploads where the client wants to use the NAR hash instead of the custom scheme here?","commit_id":"28cbe0495edbcf02e78abb2db58ad6c8d4d5b75f"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"d428f7213885cfd6f12662601b234f5ef517d49b","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        StatusCode::INTERNAL_SERVER_ERROR"},{"line_number":81,"context_line":"    })?;"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    // encode the (unnamed) root node in the NAR url itself."},{"line_number":84,"context_line":"    let root_node \u003d path_info"},{"line_number":85,"context_line":"        .node"},{"line_number":86,"context_line":"        .as_ref()"}],"source_content_type":"text/x-rustsrc","patch_set":11,"id":"344070c7_f608a524","line":83,"in_reply_to":"32f5dc47_26bc8d2a","updated":"2024-07-20 12:15:49.000000000","message":"Nothing to be done here.","commit_id":"28cbe0495edbcf02e78abb2db58ad6c8d4d5b75f"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"e72687431a9e8368d2852e43ab0e9e73bff3b508","unresolved":true,"context_lines":[{"line_number":80,"context_line":"        StatusCode::INTERNAL_SERVER_ERROR"},{"line_number":81,"context_line":"    })?;"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    // encode the (unnamed) root node in the NAR url itself."},{"line_number":84,"context_line":"    let root_node \u003d path_info"},{"line_number":85,"context_line":"        .node"},{"line_number":86,"context_line":"        .as_ref()"}],"source_content_type":"text/x-rustsrc","patch_set":11,"id":"32f5dc47_26bc8d2a","line":83,"in_reply_to":"d9c4976b_4c05c510","updated":"2024-07-01 18:31:02.000000000","message":"The Basename itself is removed from the proto, so it\u0027s essentially just:\n - the Blake3 digest of a single blob\n - the Blake3 digest of the root directory (and size integer)\n - the symlink target (capped to ~reasonable lengths)\n\nUploads are a separate method and routing, so we can serve Nars from different paths than they are uploaded. in fact, we currently do that with nar-bridge-go already.\n\nWe probably still want to support head \"lookups by nar hash\", so Nix doesn\u0027t upload too much, as it thinks that nar doesn\u0027t exist yet.\n\nIt probably still makes sense to serve nar from a much different path (castore-node/$encoded), so tvix-aware http substitution clients can recognize that and are able to synthesize a PathInfo from that (and potentially substitute through the castore model).\n\nAs long as we don\u0027t have another signature mechanism, they\u0027d still need to download every blob and directory in that store path, then calculate the nar hash and size to check the current signature (so no lazy seeking), but chances are they already have large amounts of these contents and need to transfer less than always downloading the entire NAR file. And can do so in parallel from other peers too.","commit_id":"28cbe0495edbcf02e78abb2db58ad6c8d4d5b75f"}],"tvix/nar-bridge/src/mod.rs":[{"author":{"_account_id":1000085,"name":"Connor Brewster","display_name":"cbrewster","email":"cbrewster@hey.com","username":"cbrewster"},"change_message_id":"c1748a395f5799a44648b1be32b0e5003b107160","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":11,"id":"45c1762c_c18306a8","updated":"2024-07-01 17:46:45.000000000","message":"do we need this?","commit_id":"28cbe0495edbcf02e78abb2db58ad6c8d4d5b75f"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"d428f7213885cfd6f12662601b234f5ef517d49b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"abbb7b38_79e39a25","in_reply_to":"45c1762c_c18306a8","updated":"2024-07-20 12:15:49.000000000","message":"fixed","commit_id":"28cbe0495edbcf02e78abb2db58ad6c8d4d5b75f"}],"tvix/nar-bridge/src/nar.rs":[{"author":{"_account_id":1000082,"name":"Brian Olsen","display_name":"griff","email":"me@griff.name","username":"griff"},"change_message_id":"4ad7ff49e008c33f41175a47f25120c8093f6db0","unresolved":true,"context_lines":[{"line_number":34,"context_line":"            warn!(err\u003d%e, \"unable to decode root node b64\");"},{"line_number":35,"context_line":"            StatusCode::NOT_FOUND"},{"line_number":36,"context_line":"        })?;"},{"line_number":37,"context_line":"    // TODO: reasonable size limit, (digest len) validation"},{"line_number":38,"context_line":"    let root_node: tvix_castore::proto::Node \u003d Message::decode(Bytes::from(root_node_enc))"},{"line_number":39,"context_line":"        .map_err(|e| {"},{"line_number":40,"context_line":"            warn!(err\u003d%e, \"unable to decode root node proto\");"}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"62521557_3774f794","line":37,"updated":"2024-07-20 12:35:46.000000000","message":"TODO","commit_id":"a18b4f043c2078aad9b03aef0cef9f13e8e14229"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"fa62296faab0c5871dbc5ce4e6fcfc0ac4e89479","unresolved":false,"context_lines":[{"line_number":34,"context_line":"            warn!(err\u003d%e, \"unable to decode root node b64\");"},{"line_number":35,"context_line":"            StatusCode::NOT_FOUND"},{"line_number":36,"context_line":"        })?;"},{"line_number":37,"context_line":"    // TODO: reasonable size limit, (digest len) validation"},{"line_number":38,"context_line":"    let root_node: tvix_castore::proto::Node \u003d Message::decode(Bytes::from(root_node_enc))"},{"line_number":39,"context_line":"        .map_err(|e| {"},{"line_number":40,"context_line":"            warn!(err\u003d%e, \"unable to decode root node proto\");"}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"872b57c7_9a27144e","line":37,"in_reply_to":"62521557_3774f794","updated":"2024-07-20 14:51:51.000000000","message":"Done","commit_id":"a18b4f043c2078aad9b03aef0cef9f13e8e14229"}],"tvix/nar-bridge/src/narinfo.rs":[{"author":{"_account_id":1000082,"name":"Brian Olsen","display_name":"griff","email":"me@griff.name","username":"griff"},"change_message_id":"4ad7ff49e008c33f41175a47f25120c8093f6db0","unresolved":true,"context_lines":[{"line_number":87,"context_line":"/// Parses a `3mzh8lvgbynm9daj7c82k2sfsfhrsfsy.narinfo` string and returns the"},{"line_number":88,"context_line":"/// nixbase32-decoded digest."},{"line_number":89,"context_line":"fn parse_narinfo_str(s: \u0026str) -\u003e Result\u003c[u8; 20], StatusCode\u003e {"},{"line_number":90,"context_line":"    Ok(match s.split_at(32) {"},{"line_number":91,"context_line":"        (hash_str, \".narinfo\") \u003d\u003e {"},{"line_number":92,"context_line":"            // we know this is 32 bytes"},{"line_number":93,"context_line":"            let hash_str_fixed: [u8; 32] \u003d hash_str.as_bytes().try_into().unwrap();"}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"14702ac6_9b7b90c6","line":90,"updated":"2024-07-20 12:35:46.000000000","message":"If s it shorter than 32 chars or if there is not a UTF-8 boundary at 32 this will panic.","commit_id":"a18b4f043c2078aad9b03aef0cef9f13e8e14229"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"fa62296faab0c5871dbc5ce4e6fcfc0ac4e89479","unresolved":false,"context_lines":[{"line_number":87,"context_line":"/// Parses a `3mzh8lvgbynm9daj7c82k2sfsfhrsfsy.narinfo` string and returns the"},{"line_number":88,"context_line":"/// nixbase32-decoded digest."},{"line_number":89,"context_line":"fn parse_narinfo_str(s: \u0026str) -\u003e Result\u003c[u8; 20], StatusCode\u003e {"},{"line_number":90,"context_line":"    Ok(match s.split_at(32) {"},{"line_number":91,"context_line":"        (hash_str, \".narinfo\") \u003d\u003e {"},{"line_number":92,"context_line":"            // we know this is 32 bytes"},{"line_number":93,"context_line":"            let hash_str_fixed: [u8; 32] \u003d hash_str.as_bytes().try_into().unwrap();"}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"46f5fd4e_e5d61114","line":90,"in_reply_to":"14702ac6_9b7b90c6","updated":"2024-07-20 14:51:51.000000000","message":"Done","commit_id":"a18b4f043c2078aad9b03aef0cef9f13e8e14229"}]}
