-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds gas estimation fix to scroll validator
- Loading branch information
1 parent
b9952f9
commit 0aa68b2
Showing
5 changed files
with
113 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
contracts/src/v0.8/l2ep/test/mocks/scroll/MockScrollL1MessageQueue.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.19; | ||
|
||
import {IL1MessageQueue} from "@scroll-tech/contracts/L1/rollup/IL1MessageQueue.sol"; | ||
|
||
contract MockScrollL1MessageQueue is IL1MessageQueue { | ||
/// @notice The start index of all pending inclusion messages. | ||
function pendingQueueIndex() external pure returns (uint256) { | ||
return 0; | ||
} | ||
|
||
/// @notice Return the index of next appended message. | ||
function nextCrossDomainMessageIndex() external pure returns (uint256) { | ||
return 0; | ||
} | ||
|
||
/// @notice Return the message of in `queueIndex`. | ||
function getCrossDomainMessage(uint256 /* queueIndex */) external pure returns (bytes32) { | ||
return ""; | ||
} | ||
|
||
/// @notice Return the amount of ETH should pay for cross domain message. | ||
function estimateCrossDomainMessageFee(uint256 /* gasLimit */) external pure returns (uint256) { | ||
return 0; | ||
} | ||
|
||
/// @notice Return the amount of intrinsic gas fee should pay for cross domain message. | ||
function calculateIntrinsicGasFee(bytes memory /* _calldata */) external pure returns (uint256) { | ||
return 0; | ||
} | ||
|
||
/// @notice Return the hash of a L1 message. | ||
function computeTransactionHash( | ||
address /* sender */, | ||
uint256 /* queueIndex */, | ||
uint256 /* value */, | ||
address /* target */, | ||
uint256 /* gasLimit */, | ||
bytes calldata /* data */ | ||
) external pure returns (bytes32) { | ||
return 0; | ||
} | ||
|
||
/// @notice Append a L1 to L2 message into this contract. | ||
/// @param target The address of target contract to call in L2. | ||
/// @param gasLimit The maximum gas should be used for relay this message in L2. | ||
/// @param data The calldata passed to target contract. | ||
function appendCrossDomainMessage(address target, uint256 gasLimit, bytes calldata data) external {} | ||
|
||
/// @notice Append an enforced transaction to this contract. | ||
/// @dev The address of sender should be an EOA. | ||
/// @param sender The address of sender who will initiate this transaction in L2. | ||
/// @param target The address of target contract to call in L2. | ||
/// @param value The value passed | ||
/// @param gasLimit The maximum gas should be used for this transaction in L2. | ||
/// @param data The calldata passed to target contract. | ||
function appendEnforcedTransaction( | ||
address sender, | ||
address target, | ||
uint256 value, | ||
uint256 gasLimit, | ||
bytes calldata data | ||
) external {} | ||
|
||
/// @notice Pop finalized messages from queue. | ||
/// | ||
/// @dev We can pop at most 256 messages each time. And if the message is not skipped, | ||
/// the corresponding entry will be cleared. | ||
/// | ||
/// @param startIndex The start index to pop. | ||
/// @param count The number of messages to pop. | ||
/// @param skippedBitmap A bitmap indicates whether a message is skipped. | ||
function popCrossDomainMessage(uint256 startIndex, uint256 count, uint256 skippedBitmap) external {} | ||
|
||
/// @notice Drop a skipped message from the queue. | ||
function dropCrossDomainMessage(uint256 index) external {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters