-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
AUTO-8804: create chain specific modules for l1 gas calculations #11896
Conversation
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
contracts/src/v0.8/automation/dev/chains/OptimismAndBaseModule.sol
Outdated
Show resolved
Hide resolved
contracts/src/v0.8/automation/dev/interfaces/v2_2/IChainSpecific.sol
Outdated
Show resolved
Hide resolved
contracts/src/v0.8/automation/dev/v2_2/AutomationRegistryBase2_2.sol
Outdated
Show resolved
Hide resolved
if (isExecution) { | ||
l1CostWei = hotVars.chainSpecificModule.getL1Fee(msg.data); | ||
} else { | ||
// if it's not performing upkeeps, use gas ceiling multiplier to estimate the upper bound | ||
l1CostWei = hotVars.gasCeilingMultiplier * hotVars.chainSpecificModule.getMaxL1Fee(s_storage.maxPerformDataSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
IScrollL1GasPriceOracle internal constant SCROLL_ORACLE = IScrollL1GasPriceOracle(SCROLL_ORACLE_ADDR); | ||
|
||
function blockHash(uint256 blocknumber) external view returns (bytes32) { | ||
return blockhash(blocknumber); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know if this returns an empty bytes32 or throws an error if the block number is older than 256? If it's the latter, we might need to do the same thing we do for arbitrum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's be defensive here and add this check.
will check later.
Go solidity wrappers are out-of-date, regenerate them via the |
1 similar comment
Go solidity wrappers are out-of-date, regenerate them via the |
Go solidity wrappers are out-of-date, regenerate them via the |
@@ -7,12 +7,17 @@ import { AutomationRegistryLogicB2_2__factory as AutomationRegistryLogicBFactory | |||
import { IAutomationRegistryMaster as IAutomationRegistry } from '../../../typechain/IAutomationRegistryMaster' | |||
import { IAutomationRegistryMaster__factory as IAutomationRegistryMasterFactory } from '../../../typechain/factories/IAutomationRegistryMaster__factory' | |||
|
|||
const ZERO = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i had to add these bc SonarQube thinks using magic numbers 0, 1, 2 directly causes brain overload
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lololol you've got to be kidding me!? can we make fix sonar cube rather than making ZERO constants!? that's cray.
function getL1Fee(bytes calldata) external view returns (uint256) { | ||
return ARB_GAS.getCurrentTxL1GasFees(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function ignores the calldata and just uses the msg.data
, right? This feels like a confusing API imho. Can we change this function to actually estimate the gas for the provided data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should change the interface to instead be getCurrentL1Fee()
or similar and avoid passing data all together? Each module can read msg.data directly.
contracts/src/v0.8/automation/dev/interfaces/v2_2/IChainModule.sol
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! Some minor improvements on chain modules which we can do in followup PRs
Quality Gate passedIssues Measures |
* develop: (74 commits) VRF zero confirmation delay (#11947) add toml configs to paths that can cause e2e tests to run in ci (#12001) bump golang.org/x/... (#12042) [chore] Replace clock with specialized lib (#12031) Update style guide (#12041) plugins/cmd/chainlink-mercury: (re)move to chainlink-data-streams repo (#11994) bump go-plugin (#12033) Adds timeout on fuzz script execution (#12024) Add bytes type to abi_type (#12029) AUTO-8804: create chain specific modules for l1 gas calculations (#11896) VRF-878 Gas Optimization V2 Plus (#11982) Improving deletes performance by limiting number of records to scan (#12007) core/web: improve health CLI readabilty (#12021) Handle a 0 exit code from the remote runner instead of always failing (#12015) Add a simple Codec test (#12006) Allow for custom config poller onchain codec (LLO support) (#11957) Update Sonar properties (#11986) golangci-lint: revive: add early-return; fix issues (#12017) Implement NewPluginProvider (EVM) (#11995) Fix lock file version and minor NPM bumps (#11980) ...
No description provided.