-
Notifications
You must be signed in to change notification settings - Fork 129
feat: revert if task required gas limit is close to the fusaka tx gas cap #1277
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
93d55b4
feat: revert if task required gas limit is close to the fusaka tx gas…
mds1 c5fa12a
Update src/tasks/MultisigTask.sol
mds1 d0d5615
test: add test tp ensure it reverts
mds1 3cb66d7
ci: Skip test that exceeds Fusaka gas limit
mds1 11b7a1e
Merge branch 'main' into feat/check-gas-limit
mds1 048ba03
chore: set gas limit to 15M
mds1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,47 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity 0.8.15; | ||
|
|
||
| import {VmSafe} from "forge-std/Vm.sol"; | ||
|
|
||
| import {L2TaskBase} from "src/tasks/types/L2TaskBase.sol"; | ||
| import {Action} from "src/libraries/MultisigTypes.sol"; | ||
| import {MockTarget} from "test/tasks/mock/MockTarget.sol"; | ||
|
|
||
| /// @notice Mock task that consumes a lot of gas to test that MultisigTask correctly rejects | ||
| /// transactions that consume gas too close to the Fusaka EIP-7825 cap of 16,777,216 gas. | ||
| contract HighGasMultisigTask is L2TaskBase { | ||
| /// @notice reference to the mock target contract | ||
| MockTarget public mockTarget; | ||
|
|
||
| /// @notice Returns the safe address string identifier | ||
| /// @return The string "ProxyAdminOwner" | ||
| function safeAddressString() public pure override returns (string memory) { | ||
| return "ProxyAdminOwner"; | ||
| } | ||
|
|
||
| /// @notice Returns the storage write permissions required for this task | ||
| /// @return Array of storage write permissions | ||
| function _taskStorageWrites() internal pure override returns (string[] memory) { | ||
| string[] memory storageWrites = new string[](1); | ||
| storageWrites[0] = "ProxyAdminOwner"; | ||
| return storageWrites; | ||
| } | ||
|
|
||
| function _templateSetup(string memory, address rootSafe) internal override { | ||
| super._templateSetup("", rootSafe); | ||
| // Initialize mockTarget so it's available when _build() runs | ||
| mockTarget = new MockTarget(); | ||
| } | ||
|
|
||
| /// @notice Build function that creates an action which will consume >15M gas on-chain | ||
| function _build(address) internal override { | ||
| // Call mockTarget.consumeGas() which will expand memory during execution to use a lot of gas | ||
| mockTarget.consumeGas(); | ||
| } | ||
|
|
||
| /// @notice Validates that the task executed | ||
| function _validate(VmSafe.AccountAccess[] memory, Action[] memory, address) internal view override {} | ||
|
|
||
| /// @notice No code exceptions for this template. | ||
| function _getCodeExceptions() internal view virtual override returns (address[] memory) {} | ||
| } |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.