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

fix(protocol): avoid invocation in Bridge message processing if calldata is "" and value is 0 #18137

Merged
merged 6 commits into from
Sep 18, 2024

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented Sep 18, 2024

While reviewing this transaction, we noticed that the processMessage transaction succeeded, but the internal message invocation failed due to an out-of-gas error. This failure occurred because the inner invocation was assigned a gas limit of 1 (since 0 is invalid), despite the invocation being unnecessary.

This PR introduces a check to skip the internal message invocation if the calldata is empty (""), preventing unnecessary execution and gas consumption, and also mark such transactions as "succeeded" instead of "retryable".

@dantaik dantaik marked this pull request as ready for review September 18, 2024 06:46
@dantaik dantaik changed the title feat(protocol): avoid bridge invocation if calldata is "" feat(protocol): avoid inner invocation in Bridge message processing if calldata is "" Sep 18, 2024
@dantaik dantaik changed the title feat(protocol): avoid inner invocation in Bridge message processing if calldata is "" fix(protocol): avoid inner invocation in Bridge message processing if calldata is "" Sep 18, 2024
Copy link

openzeppelin-code bot commented Sep 18, 2024

fix(protocol): avoid invocation in Bridge message processing if calldata is "" and value is 0

Generated at commit: 1de4866e0e38d40bb3218593992b59dcbdfd0e30

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
2
0
8
43
55
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@dantaik dantaik changed the title fix(protocol): avoid inner invocation in Bridge message processing if calldata is "" fix(protocol): avoid invocation in Bridge message processing if calldata is "" and value is 0 Sep 18, 2024
@dantaik dantaik merged commit 10c2972 into main Sep 18, 2024
@dantaik dantaik deleted the bridge_avoid_invocation_if_data_is_empty branch September 18, 2024 16:28
dantaik added a commit that referenced this pull request Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants