Skip to content

Commit

Permalink
DataManager: skip unparasable commits and reveals
Browse files Browse the repository at this point in the history
  • Loading branch information
adg-flare committed Mar 11, 2024
1 parent 5362ab9 commit d59d500
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions libs/ftso-core/src/DataManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,12 @@ export class DataManager {
message.protocolId === FTSO2_PROTOCOL_ID &&
message.votingRoundId === submission.votingEpochIdFromTimestamp
) {
const commit = CommitData.decode(message.payload);
voterToLastCommit.set(submission.submitAddress, commit);
try {
const commit = CommitData.decode(message.payload);
voterToLastCommit.set(submission.submitAddress, commit);
} catch (e) {
this.logger.warn(`Unparsable commit message: ${message.payload}, error: ${errorString(e)}`);
}
}
}
}
Expand All @@ -654,8 +658,12 @@ export class DataManager {
message.protocolId === FTSO2_PROTOCOL_ID &&
message.votingRoundId + 1 === submission.votingEpochIdFromTimestamp
) {
const reveal = RevealData.decode(message.payload, feedOrder);
voterToLastReveal.set(submission.submitAddress, reveal);
try {
const reveal = RevealData.decode(message.payload, feedOrder);
voterToLastReveal.set(submission.submitAddress, reveal);
} catch (e) {
this.logger.warn(`Unparsable reveal message: ${message.payload}, error: ${errorString(e)}`);
}
}
}
}
Expand Down

0 comments on commit d59d500

Please sign in to comment.