Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

s1ce - OpenRelay payment doesn't include L1 Data fees #81

Closed
sherlock-admin4 opened this issue Apr 13, 2024 · 6 comments
Closed

s1ce - OpenRelay payment doesn't include L1 Data fees #81

sherlock-admin4 opened this issue Apr 13, 2024 · 6 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Escalation Resolved This issue's escalations have been approved/rejected Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin4
Copy link

sherlock-admin4 commented Apr 13, 2024

s1ce

high

OpenRelay payment doesn't include L1 Data fees

Summary

Keepers will be undercompensated on L2s, such as Optimism or Blast, because the payment calculation does not include L1 Data fees

Vulnerability Detail

There are two types of gas fees on L2s: The L2 execution fees and the L1 Data fees. The current formula, which multiplies the block base fee times the gas used, only takes into account the execution fees. The L1 Data fees can potentially be costly and are not included as part of this calculation, so keepers could be undercompensated for their transactions as a result.

The error is in this computation:

    uint256 _initialGas = gasleft();
    _automationVault.exec(msg.sender, _execData, new IAutomationVault.FeeData[](0));
    uint256 _gasSpent = _initialGas - gasleft();

    // Calculate the payment for the relayer
    uint256 _payment = (_gasSpent + GAS_BONUS) * block.basefee * GAS_MULTIPLIER / BASE;

Impact

Keepers could be undercompensated

Code Snippet

https://github.com/sherlock-audit/2024-04-xkeeper/blob/main/xkeeper-core/solidity/contracts/relays/OpenRelay.sol#L29

Tool used

Manual Review

Recommendation

Account for L1 Data Fee

Duplicate of #57

@github-actions github-actions bot added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Apr 16, 2024
@Hash01011122 Hash01011122 removed the Medium A valid Medium severity issue label Apr 24, 2024
@sherlock-admin3 sherlock-admin3 changed the title Breezy Bamboo Mink - OpenRelay payment doesn't include L1 Data fees s1ce - OpenRelay payment doesn't include L1 Data fees Apr 24, 2024
@sherlock-admin3 sherlock-admin3 added Non-Reward This issue will not receive a payout and removed Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Apr 24, 2024
@s1ce
Copy link

s1ce commented Apr 24, 2024

Escalate

Not sure why this was excluded. Duplicate of #57

@sherlock-admin2
Copy link
Contributor

Escalate

Not sure why this was excluded. Duplicate of #57

You've created a valid escalation!

To remove the escalation from consideration: Delete your comment.

You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.

@sherlock-admin3 sherlock-admin3 added the Escalated This issue contains a pending escalation label Apr 24, 2024
@Hash01011122
Copy link
Collaborator

Agreed this is indeed duplicate of #57

@cvetanovv
Copy link

I agree it is a duplicate of #57.

Planning to accept the escalation and duplicate with #57.

@Evert0x Evert0x added the Medium A valid Medium severity issue label May 1, 2024
@sherlock-admin2 sherlock-admin2 added Reward A payout will be made for this issue and removed Non-Reward This issue will not receive a payout labels May 1, 2024
@Evert0x
Copy link

Evert0x commented May 1, 2024

Result:
Medium
Duplicate of #57

@sherlock-admin2
Copy link
Contributor

sherlock-admin2 commented May 1, 2024

Escalations have been resolved successfully!

Escalation status:

@sherlock-admin3 sherlock-admin3 removed the Escalated This issue contains a pending escalation label May 1, 2024
@sherlock-admin4 sherlock-admin4 added the Escalation Resolved This issue's escalations have been approved/rejected label May 1, 2024
@sherlock-admin3 sherlock-admin3 added the Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label label May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Escalation Resolved This issue's escalations have been approved/rejected Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

7 participants