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: comment for excess fee refund address #167

Merged
merged 8 commits into from
Jul 1, 2024

Conversation

Jason-W123
Copy link
Contributor

No description provided.

@cla-bot cla-bot bot added the s label Apr 15, 2024
@Jason-W123 Jason-W123 changed the title Hotfix comment for excess fee refund address fix: comment for excess fee refund address Apr 15, 2024
Copy link
Member

@gzeoneth gzeoneth left a comment

Choose a reason for hiding this comment

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

we should also sync these change with the inbox e.g.

* @param excessFeeRefundAddress gasLimit x maxFeePerGas - execution cost gets credited here on L2 balance

src/node-interface/NodeInterface.sol Outdated Show resolved Hide resolved
Jason-W123 and others added 2 commits April 16, 2024 18:16
@@ -53,7 +53,7 @@ interface IERC20Inbox is IInboxBase {
* @param to destination L2 contract address
* @param l2CallValue call value for retryable L2 message
* @param maxSubmissionCost Max gas deducted from user's L2 balance to cover base submission fee
* @param excessFeeRefundAddress gasLimit x maxFeePerGas - execution cost gets credited here on L2 balance
* @param excessFeeRefundAddress (gasLimit x maxFeePerGas - execution cost) + (maxSubmission - (autoredeem ? 0 : submission cost)) gets credited here on L2 balance
Copy link
Member

@gzeoneth gzeoneth Apr 17, 2024

Choose a reason for hiding this comment

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

I believe this is actually a little bit more nuanced for the unsafe entrypoint since you might have l1callvalue < l2callvalue + fees, and you can only get fee refund for at most l1callvaue - l2callvalue

i.e.
max(0,min(l1callvalue - l2callvalue, gasLimit x maxFeePerGas + maxSubmission)) - execution cost - (autoredeem ? 0 : submission cost) lol

I am thinking if we want to be so elaborated here or we should just put a high level description here while have the detail example in docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree to put max(0,min(l1callvalue - l2callvalue, gasLimit x maxFeePerGas + maxSubmission)) - execution cost - (autoredeem ? 0 : submission cost) here

Copy link
Member

Choose a reason for hiding this comment

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

you missed the l1callvalue - l2callvalue part
see if we have time to discuss in standup

gzeoneth
gzeoneth previously approved these changes Jul 1, 2024
@gzeoneth gzeoneth changed the base branch from main to develop July 1, 2024 18:41
@gzeoneth gzeoneth dismissed their stale review July 1, 2024 18:41

The base branch was changed.

@gzeoneth gzeoneth enabled auto-merge July 1, 2024 18:57
@gzeoneth gzeoneth merged commit cfd5cb8 into develop Jul 1, 2024
9 of 13 checks passed
@gzeoneth gzeoneth deleted the hotfix-comment-for-excessFeeRefundAddress branch July 1, 2024 19:03
@gzeoneth gzeoneth mentioned this pull request Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants