Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
log for request
Browse files Browse the repository at this point in the history
  • Loading branch information
move47 committed Apr 17, 2024
1 parent c522397 commit d6e1089
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/builder_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ impl<TYPES: NodeType> BuilderProgress<TYPES> for BuilderState<TYPES> {
if let Some((timestamp, _, _)) = self.tx_hash_to_available_txns.get(tx_hash)
{
if self.timestamp_to_tx.contains_key(timestamp) {
tracing::debug!("Removing transaction from timestamp_to_tx map");
self.timestamp_to_tx.remove(timestamp);
}
self.tx_hash_to_available_txns.remove(tx_hash);
Expand Down
19 changes: 13 additions & 6 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ where
// verify the signatue
if !sender.validate(signature, for_parent.as_ref()) {
return Err(BuildError::Error {
message: "Signature validation failed".to_string(),
message: "Signature validation failed in get_available_blocks".to_string(),
});
}

Expand Down Expand Up @@ -202,7 +202,7 @@ where
sender: self.builder_keys.0.clone(),
_phantom: Default::default(),
};
tracing::debug!("Initial block info: {:?}", initial_block_info);
tracing::debug!("sending Initial block info: {:?}", initial_block_info);
Ok(vec![initial_block_info])
}
_ => Err(BuildError::Error {
Expand All @@ -216,10 +216,11 @@ where
sender: Types::SignatureKey,
signature: &<<Types as NodeType>::SignatureKey as SignatureKey>::PureAssembledSignatureType,
) -> Result<AvailableBlockData<Types>, BuildError> {
tracing::debug!("Received request for Claiming block {:?}", block_hash);
// verify the signatue
if !sender.validate(signature, block_hash.as_ref()) {
return Err(BuildError::Error {
message: "Signature validation failed".to_string(),
message: "Signature validation failed in claim block".to_string(),
});
}
if let Some(block) = self.block_hash_to_block.get(block_hash) {
Expand All @@ -238,6 +239,7 @@ where
signature: signature_over_builder_commitment,
sender: self.builder_keys.0.clone(),
};
tracing::debug!("Sending Claimed block data: {:?}", block_data);
Ok(block_data)
} else {
Err(BuildError::Error {
Expand All @@ -252,10 +254,14 @@ where
sender: Types::SignatureKey,
signature: &<<Types as NodeType>::SignatureKey as SignatureKey>::PureAssembledSignatureType,
) -> Result<AvailableBlockHeaderInput<Types>, BuildError> {
tracing::debug!(
"Received request for Claiming block header input {:?}",
block_hash
);
// verify the signatue
if !sender.validate(signature, block_hash.as_ref()) {
return Err(BuildError::Error {
message: "Signature validation failed".to_string(),
message: "Signature validation failed in claim block header input".to_string(),
});
}
if let Some(block) = self.block_hash_to_block.get(block_hash) {
Expand All @@ -267,13 +273,14 @@ where
vid_commitment.as_ref(),
)
.expect("Claim block header input signing failed");
let reponse = AvailableBlockHeaderInput::<Types> {
let response = AvailableBlockHeaderInput::<Types> {
vid_commitment,
signature: signature_over_vid_commitment,
sender: self.builder_keys.0.clone(),
_phantom: Default::default(),
};
Ok(reponse)
tracing::debug!("Sending Claimed block header input: {:?}", response);
Ok(response)
} else {
Err(BuildError::Error {
message: "Block not found".to_string(),
Expand Down

0 comments on commit d6e1089

Please sign in to comment.