hyperledger-firefly / hyperledger-firefly/firefly

Batches with invalid contents should be flagged and skipped during aggregation

Open
#1,270 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
602
Forks
246
Avg merge
18h 47m
Merged PRs (30d)
6

Description

Currently if FireFly receives a batch with any malformed contents (such as a mismatched key due to #1175), it writes the batch to the database but none of the messages or data.
https://github.com/hyperledger/firefly/blob/057a7af8646426bc9d79a95b8d066838e3e6bc43/internal/events/persist_batch.go#L45

However, the saved batch has no marking to indicate that the contents were invalid. Therefore every time the aggregator rewinds to this batch, it will stall with "message not yet available".
https://github.com/hyperledger/firefly/blob/057a7af8646426bc9d79a95b8d066838e3e6bc43/internal/events/aggregator.go#L467

When batch contents are skipped in this fashion, FireFly should actually mark the batch somehow, and when the aggregator attempts to process a message from that batch, it should simply mark the pin dispatched and move on. This is different from rejecting the message, because the message will never even be inserted to the database - but there's no point in blocking the pin forever, since the message will never be valid.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.