Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cantina finding #11] do not revert inside _ccipReceive #173

Open
wants to merge 2 commits into
base: add-gaslimit
Choose a base branch
from

Conversation

voith
Copy link
Member

@voith voith commented Feb 23, 2025

This change is Reviewable

require(success, MessageCallFailed());

emit MessageExecuted(messageId, target, payload);
(bool success, bytes memory _error) = target.call(payload);
Copy link

Choose a reason for hiding this comment

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

@voith this is not "enough" because the _ccipReceive could still revert in the above require statements and those messages can be manually retried.

I guess it won't be a huge issue given that mainnetChainSelector, mainnetSender and target cannot be changed, and they will always revert, but still, they will be "available" to be retried in the future.

Copy link

Choose a reason for hiding this comment

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

is it OK for you this behavior?

Copy link
Member Author

Choose a reason for hiding this comment

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

I did think about this. I initially thought that this would be fine but I just read the CCIP docs and they are unclear about the execution of successive messages if the previous one fails.
I think for consistency I'll implement emitting an event and returning early 👍

Copy link

Choose a reason for hiding this comment

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

@voith I don't think that the queue will be paused given that you are sending messages (from mainnet) with the allowOutOfOrderExecution forced to true.

Would you mind sending the link about the explanation you are referring to so I can double check?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was taking a look at FAQ 2: https://docs.chain.link/ccip/concepts/manual-execution#frequently-asked-questions

If a user sends multiple messages and the first message isn't successfully delivered and goes into a manual execution mode, does that mean all subsequent messages from the user will also be stuck?

It depends. If a message goes into manual execution mode due to receiver errors (unhandled exceptions or gas limit issues), subsequent messages don't get automatically blocked, unless they would encounter the same error. However, suppose a message goes into manual execution mode after the Smart Execution time window expires (currently 8 hours). In that case, subsequent messages must wait for the first message to be processed to maintain the default sequence.

Not sure if I'm understanding this correctly.

Copy link

Choose a reason for hiding this comment

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

Yes, it's not quite clear. I think that it would be better for you to ask directly to Chainlink.
If I have to guess, I think that when we are in the scenario "goes into manual execution mode after the Smart Execution time window expires (currently 8 hours)" it means that the whole Chainlink is in a "special" state, it's not just about your message. That's why I think they are saying that you need to wait for the situation to get resolved and the queue to be de-queued.

But it's not clear, that's why I think that you need to ask to them directly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Chainlink stated that messages won't be blocked when allowOutOfOrderExecution = true.

The only require checks in my code are for invalid sender and invalid chain selector. Since messages that fail these checks will always fail, I’m not concerned about retries in these cases. Additionally, with allowOutOfOrderExecution = true, messages won’t be blocked, so I see no need for further changes.

bytes32 indexed messageId,
address indexed target,
bytes payload
);

/// @notice Emitted when a message is successfully executed.
Copy link

Choose a reason for hiding this comment

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

@voith the description is wrong. This event is emitted when the execution fails.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

bytes32 indexed messageId,
address indexed target,
bytes payload,
bytes _error
Copy link

Choose a reason for hiding this comment

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

@voith I would change the variable name. Usually, you use _ when the variable is private or won't be used. I would call it just error without the _

Copy link
Member Author

Choose a reason for hiding this comment

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

error is a keyword, I'll rename it to failure for consistency.

Copy link

Choose a reason for hiding this comment

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

or errorData

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants