Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions chain/client/src/chunk_endorsement_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@ use std::sync::Arc;

impl Handler<ChunkEndorsementMessage> for ChunkEndorsementHandlerActor {
fn handle(&mut self, msg: ChunkEndorsementMessage) {
if let Err(err) = self.chunk_endorsement_tracker.process_chunk_endorsement(msg.0) {
tracing::error!(target: "client", ?err, "error processing chunk endorsement");
let endorsement = msg.0;
if let Err(err) = self.chunk_endorsement_tracker.process_chunk_endorsement(&endorsement) {
tracing::error!(
target: "client",
?err,
account_id = %endorsement.account_id(),
key = ?endorsement.chunk_production_key(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In early validator kickout we're moving away from the ChunkProductionKey. Not sure if it makes sense to include it, it might get removed a moment later. /cc @stedfn

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is fine, it will take a while longer than a moment

"error processing chunk endorsement",
);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions chain/client/src/stateless_validation/chunk_endorsement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl ChunkEndorsementTracker {
}

// Validate the chunk endorsement and store it in the cache.
pub fn process_chunk_endorsement(&self, endorsement: ChunkEndorsement) -> Result<(), Error> {
pub fn process_chunk_endorsement(&self, endorsement: &ChunkEndorsement) -> Result<(), Error> {
// Check if we have already received chunk endorsement from this validator.
let key = endorsement.chunk_production_key();
let account_id = endorsement.account_id();
Expand All @@ -54,7 +54,7 @@ impl ChunkEndorsementTracker {
}

// Validate the chunk endorsement and store it in the cache.
match validate_chunk_endorsement(self.epoch_manager.as_ref(), &endorsement, &self.store)? {
match validate_chunk_endorsement(self.epoch_manager.as_ref(), endorsement, &self.store)? {
ChunkRelevance::Relevant => {
let mut cache = self.chunk_endorsements.lock();
cache.get_or_insert_mut(key, || HashMap::new()).insert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Client {
my_signer.as_ref(),
&self.network_adapter.clone().into_sender(),
) {
self.chunk_endorsement_tracker.process_chunk_endorsement(endorsement)?;
self.chunk_endorsement_tracker.process_chunk_endorsement(&endorsement)?;
}
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/src/env/test_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ impl TestEnv {
tracing::warn!(target: "test", %account_id, "client not found for account_id");
return None;
}
let processing_result = self.client(&account_id).chunk_endorsement_tracker.process_chunk_endorsement(endorsement);
let processing_result = self.client(&account_id).chunk_endorsement_tracker.process_chunk_endorsement(&endorsement);
if !allow_errors {
processing_result.unwrap();
}
Expand Down
Loading