fix(tvix/store/grpc_wrapper): don't validate node name

Clients can (and do) send an empty name in here, and we discard it
anyways.

Change-Id: Iec135d9cba48cc066464e5639319c845079787e9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12659
Reviewed-by: edef <edef@edef.eu>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
This commit is contained in:
Florian Klink 2024-10-18 13:48:50 +02:00 committed by clbot
parent cada007937
commit 98df0e4e34

View file

@ -77,10 +77,13 @@ where
&self,
request: Request<castorepb::Node>,
) -> Result<Response<proto::CalculateNarResponse>> {
let (_, root_node) = request.into_inner().into_name_and_node().map_err(|e| {
warn!(err = %e, "invalid root node");
Status::invalid_argument("invalid root node")
})?;
let (_, root_node) = request
.into_inner()
.into_name_bytes_and_node()
.map_err(|e| {
warn!(err = %e, "invalid root node");
Status::invalid_argument("invalid root node")
})?;
match self.nar_calculation_service.calculate_nar(&root_node).await {
Ok((nar_size, nar_sha256)) => Ok(Response::new(proto::CalculateNarResponse {