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): fix bridge quota processing and make processMessage return data #17027

Merged
merged 16 commits into from
May 9, 2024

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented May 8, 2024

BEGIN_COMMIT_OVERRIDE
feat(protocol): make bridge processMessage return message's status and reason
fix(protocol): fix bridge quota processing in processMessage
END_COMMIT_OVERRIDE

Regarding fix bridge quota processing in processMessage

Before this PR

If the bridge is out of ETH quota, the processMessage transaction will fail without marking the message as "retryable", which will keep the message unprocessable and ether locked on the source chain, because this message has to wait for enough quota to be available and cannot be recalled to unlock the funds on the source chain.

After this PR

If there is not enough quota, the message is marked as retrievable, however, no fees are paid to the bridge processor ,otherwise, a very high message.fee can be used to pay message.destOwner to get around of the ETH quota verification. The message can be retried or recalled to unlock funds.

@dantaik dantaik marked this pull request as ready for review May 8, 2024 03:00
Copy link

openzeppelin-code bot commented May 8, 2024

fix(protocol): fix bridge quota processing and make processMessage return data

Generated at commit: 01087449cfc0a3e0c66fd5cf359ff1374a85656f

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
2
0
5
41
50
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): fix Bridge quota processing in processMessage fix(protocol): fix bridge quota processing in processMessage May 8, 2024
packages/protocol/contracts/bridge/Bridge.sol Outdated Show resolved Hide resolved
@dantaik dantaik enabled auto-merge May 8, 2024 13:12
@dantaik dantaik changed the title fix(protocol): fix bridge quota processing in processMessage fix(protocol): fix bridge quota processing and return more data in processMessage May 8, 2024
@dantaik dantaik changed the title fix(protocol): fix bridge quota processing and return more data in processMessage fix(protocol): fix bridge quota processing and make processMessage return data May 8, 2024
@dantaik dantaik disabled auto-merge May 8, 2024 15:05
@dantaik dantaik enabled auto-merge May 9, 2024 03:28
@dantaik dantaik added this pull request to the merge queue May 9, 2024
Merged via the queue into main with commit 277dade May 9, 2024
4 checks passed
@dantaik dantaik deleted the quota_logic branch May 9, 2024 06:31
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.

4 participants