hiero-ledger / hiero-ledger/hiero-consensus-node
CLPR: Every ClprMessage needs a ClprMessageResponse
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
This issue may require some investigation. At the queue layer we need to detect the invarient that every ClprMessage handled gets a ClprMessageResponse generated which has the status and result of handling the ClprMessage. If we ever detect that we've missed responding to a message, we should log an error.
How we detect this may not be trivial. Do we detect it on both ledgers or just on the destination ledger?
Destination Ledger:
* In the handling of ClprMessageBundle, any ClprMessagePayload that contains a ClprMessage will asynchronously generate an enqueue of the response message. The handling of the ClprMessagePayload is dispatched. But the time control flow returns to the ClprMessageBundleHandler, there should have been a dispatch to enqueue a ClprMessageResponse, and we should be able to see it as the latest message enqueued in the state in the return direction.
* If we can detect an error, we can generate a ClprMessageResponse indicating something went wrong at a fundamental level from the messaging layer.
Source Ledger:
* The responses are coming back asynchronously
* The outgoing messages ids are consumed by both outgoing ClprMessage and ClprMessageResponse.
* The incoming ClprMessageResponses indicate which outgoing ClprMessage ids they correspond to.
Option 1: (Bad)
* Keep a queue of outgoing message ids that we need to have responses for.
Option 2:
* Do not clear the outgoing message queue of ClprMessages until we get the ClprMessageResponse?
Option 3:
* Do Nothing?
Contributor guide
Assessment
This issue has not been assessed yet.