Skip to content

Commit 63c0c2a

Browse files
MoonBoi9001claude
andcommitted
feat(dips): log proposal rejections at INFO level
When an RCA proposal is rejected, log the rejection reason, error, and deployment ID (when decodable) at INFO level. Previously the rejection was returned via the gRPC response with no server-side log at INFO, making debugging difficult without access to the client. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 41feb8c commit 63c0c2a

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

crates/dips/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,17 @@ fn bytes32_to_ipfs_hash(bytes: &[u8; 32]) -> String {
350350
bs58::encode(&multihash).into_string()
351351
}
352352

353+
/// Try to extract the deployment ID from raw signed RCA bytes.
354+
///
355+
/// Best-effort: returns `None` if any decoding step fails.
356+
pub(crate) fn try_extract_deployment_id(rca_bytes: &[u8]) -> Option<String> {
357+
let signed_rca = SignedRecurringCollectionAgreement::abi_decode(rca_bytes).ok()?;
358+
let metadata =
359+
AcceptIndexingAgreementMetadata::abi_decode(signed_rca.agreement.metadata.as_ref())
360+
.ok()?;
361+
Some(bytes32_to_ipfs_hash(&metadata.subgraphDeploymentId.0))
362+
}
363+
353364
/// Validate and create a RecurringCollectionAgreement.
354365
///
355366
/// Performs validation:

crates/dips/src/server.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ impl IndexerDipsService for DipsServer {
152152

153153
// Validate and store RCA
154154
let domain = crate::rca_eip712_domain(self.chain_id, self.recurring_collector);
155+
let deployment_id = crate::try_extract_deployment_id(&signed_voucher);
155156
match crate::validate_and_create_rca(
156157
self.ctx.clone(),
157158
&domain,
@@ -169,7 +170,12 @@ impl IndexerDipsService for DipsServer {
169170
}
170171
Err(e) => {
171172
let reject_reason = reject_reason_from_error(&e);
172-
tracing::warn!(error = %e, reason = ?reject_reason, "RCA rejected");
173+
tracing::info!(
174+
error = %e,
175+
reason = ?reject_reason,
176+
deployment_id = deployment_id.as_deref().unwrap_or("unknown"),
177+
"RCA proposal rejected"
178+
);
173179
Ok(Response::new(SubmitAgreementProposalResponse {
174180
response: ProposalResponse::Reject.into(),
175181
reject_reason: reject_reason.into(),

0 commit comments

Comments
 (0)