Skip to content

Router should emit more events in order to give information about message non-deliverance to destination contract #33

@gusjavaz

Description

@gusjavaz

Apart from Access Control issues there are a couple of additional situations that could lead the router to not deliver a message to the client:

  • A requested quorum is not met yet
  • The message was already delivered to client

This logic is operated in the following receiveMessage function on GlacisRouter contract

        if (
            currentReceipt.uniqueMessagesReceived == quorum &&
            !currentReceipt.executed
        ) {
            currentReceipt.executed = true;
            messageReceipts[glacisData.messageId] = currentReceipt;

            client.receiveMessage(
                receivedAdaptersList[glacisData.messageId],
                fromChainId,
                glacisData.originalFrom,
                payload
            );

            emit GlacisRouter__ExecutedMessage(
                glacisData.messageId,
                glacisData.originalFrom,
                fromChainId,
                msg.sender,
                glacisData.originalTo
            );
        } else {
            messageReceipts[glacisData.messageId] = currentReceipt;
        }

However there are no events triggered to help the user determine why the message hasn't been delivered.
One suggestion would be to allow function receiveMessage to emit QuorumNotMetYet(currentQuorum, destinationQuorum) or MessageAlreadyExecuted(messageId) in else block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions