Skip to content

Commit

Permalink
fix some tests, adjust overheads, regen wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixFan1992 committed Feb 15, 2024
1 parent a6b23d7 commit 34e9c35
Show file tree
Hide file tree
Showing 13 changed files with 185 additions and 679 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ contract ArbitrumModule is ChainModuleBase {
return perL1CalldataUnit * dataSize * 16;
}

function getGasOverhead() external view override returns (uint256, uint256) {
function getGasOverhead() external view override returns (uint256 chainModuleFixedOverhead, uint256 chainModulePerByteOverhead) {
// TODO: Calculate
return (0, 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ contract ChainModuleBase is IChainModule {
return 0;
}

function getGasOverhead() external view virtual returns (uint256, uint256) {
function getGasOverhead() external view virtual returns (uint256 chainModuleFixedOverhead, uint256 chainModulePerByteOverhead) {
return (0, 0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ contract OptimismModule is ChainModuleBase {
return OVM_GASPRICEORACLE.getL1Fee(bytes.concat(txCallData, OP_L1_DATA_FEE_PADDING));
}

function getGasOverhead() external view override returns (uint256, uint256) {
function getGasOverhead() external view override returns (uint256 chainModuleFixedOverhead, uint256 chainModulePerByteOverhead) {
// TODO: Calculate
return (0, 0);
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/v0.8/automation/dev/chains/ScrollModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ contract ScrollModule is ChainModuleBase {
return SCROLL_ORACLE.getL1Fee(bytes.concat(txCallData, SCROLL_L1_FEE_DATA_PADDING));
}

function getGasOverhead() external view override returns (uint256, uint256) {
function getGasOverhead() external view override returns (uint256 chainModuleFixedOverhead, uint256 chainModulePerByteOverhead) {
// TODO: Calculate
return (0, 0);
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ interface IChainModule {
// L2 chains which don't have L1 fee component. Return value in wei.
function getMaxL1Fee(uint256 dataSize) external view returns (uint256);

// Returns an upper bound on execution gas cost for one invocation of blockNumber(),
// one invocation of blockHash() and one invocation of getCurrentL1Fee().
// Returns an upper bound on execution gas cost for one invocation of blockNumber(),
// one invocation of blockHash() and one invocation of getCurrentL1Fee().
// Returns two values, first value indicates a fixed cost and the second value is
// the cost per msg.data byte (As some chain module's getCurrentL1Fee execution cost
// the cost per msg.data byte (As some chain module's getCurrentL1Fee execution cost
// scales with calldata size)
function getGasOverhead() external view returns (uint256, uint256);
function getGasOverhead() external view returns (uint256 chainModuleFixedOverhead, uint256 chainModulePerByteOverhead);
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ abstract contract AutomationRegistryBase2_2 is ConfirmedOwner {
// tx itself, but since payment processing itself takes gas, and it needs the overhead as input, we use fixed constants
// to account for gas used in payment processing.
// TODO re-adjust overheads
uint256 internal constant ACCOUNTING_FIXED_GAS_OVERHEAD = 28_100; // Fixed overhead per tx
uint256 internal constant ACCOUNTING_PER_UPKEEP_GAS_OVERHEAD = 7_200; // Overhead per upkeep performed in batch
uint256 internal constant ACCOUNTING_FIXED_GAS_OVERHEAD = 26_500; // Fixed overhead per tx
uint256 internal constant ACCOUNTING_PER_UPKEEP_GAS_OVERHEAD = 6_000; // Overhead per upkeep performed in batch

LinkTokenInterface internal immutable i_link;
AggregatorV3Interface internal immutable i_linkNativeFeed;
Expand Down Expand Up @@ -110,7 +110,6 @@ abstract contract AutomationRegistryBase2_2 is ConfirmedOwner {
error IncorrectNumberOfSignatures();
error IncorrectNumberOfSigners();
error IndexOutOfRange();
error InsufficientFunds();
error InvalidDataLength();
error InvalidTrigger();
error InvalidPayee();
Expand Down Expand Up @@ -448,7 +447,6 @@ abstract contract AutomationRegistryBase2_2 is ConfirmedOwner {
event DedupKeyAdded(bytes32 indexed dedupKey);
event FundsAdded(uint256 indexed id, address indexed from, uint96 amount);
event FundsWithdrawn(uint256 indexed id, uint256 amount, address to);
event InsufficientFundsUpkeepReport(uint256 indexed id, bytes trigger);
event OwnerFundsWithdrawn(uint96 amount);
event Paused(address account);
event PayeesUpdated(address[] transmitters, address[] payees);
Expand Down
Loading

0 comments on commit 34e9c35

Please sign in to comment.