Skip to content

Commit

Permalink
fix conditional overhead test
Browse files Browse the repository at this point in the history
  • Loading branch information
infiloop2 committed Feb 16, 2024
1 parent c723350 commit 21a03fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ abstract contract AutomationRegistryBase2_2 is ConfirmedOwner {
// Next block of constants are only used in maxPayment estimation during checkUpkeep simulation
// These values are calibrated using hardhat tests which simulates various cases and verifies that
// the variables result in accurate estimation
uint256 internal constant REGISTRY_CONDITIONAL_OVERHEAD = 55_000; // Fixed gas overhead for conditional upkeeps
uint256 internal constant REGISTRY_CONDITIONAL_OVERHEAD = 60_000; // Fixed gas overhead for conditional upkeeps
uint256 internal constant REGISTRY_LOG_OVERHEAD = 110_400; // Fixed gas overhead for log upkeeps
uint256 internal constant REGISTRY_PER_SIGNER_GAS_OVERHEAD = 7_500; // Value scales with f
uint256 internal constant REGISTRY_PER_PERFORM_BYTE_GAS_OVERHEAD = 16; // Per perform data byte overhead
uint256 internal constant REGISTRY_PER_SIGNER_GAS_OVERHEAD = 7_000; // Value scales with f
uint256 internal constant REGISTRY_PER_PERFORM_BYTE_GAS_OVERHEAD = 22; // Per perform data byte overhead
// The overhead (in bytes) in addition to perform data for upkeep sent in calldata
// This includes overhead for all struct encoding as well as report signatures
// There is a fixed component and a per signer component
Expand All @@ -62,8 +62,7 @@ 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. These values are calibrated using hardhat tests which simulates various cases and verifies that
// the variables result in accurate estimation
// TODO re-adjust overheads
uint256 internal constant ACCOUNTING_FIXED_GAS_OVERHEAD = 22_500; // Fixed overhead per tx
uint256 internal constant ACCOUNTING_FIXED_GAS_OVERHEAD = 20_000; // 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;
Expand Down
4 changes: 2 additions & 2 deletions contracts/test/v0.8/automation/AutomationRegistry2_2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ describe('AutomationRegistry2_2', () => {
},
)

describe.skip('Gas benchmarking conditional upkeeps [ @skip-coverage ]', function () {
describe('Gas benchmarking conditional upkeeps [ @skip-coverage ]', function () {
const fs = [1, 10]
fs.forEach(function (newF) {
it(
Expand Down Expand Up @@ -1999,7 +1999,7 @@ describe('AutomationRegistry2_2', () => {
),
'Gas overhead calculated is too high, decrease account gas variables (ACCOUNTING_FIXED_GAS_OVERHEAD/ACCOUNTING_PER_SIGNER_GAS_OVERHEAD) by at least ' +
chargedGasOverhead
.sub(chargedGasOverhead)
.sub(actualGasOverhead)
.sub(gasCalculationMargin)
.toString()

Expand Down

0 comments on commit 21a03fe

Please sign in to comment.