diff --git a/typescript/infra/config/environments/mainnet3/igp.ts b/typescript/infra/config/environments/mainnet3/igp.ts index 2b388afdd2..3dbe6c775e 100644 --- a/typescript/infra/config/environments/mainnet3/igp.ts +++ b/typescript/infra/config/environments/mainnet3/igp.ts @@ -1,6 +1,7 @@ import { ChainMap, ChainName, + ChainTechnicalStack, HookType, IgpConfig, getTokenExchangeRateFromValues, @@ -14,6 +15,7 @@ import { getOverhead, } from '../../../src/config/gas-oracle.js'; import { mustGetChainNativeToken } from '../../../src/utils/utils.js'; +import { getChain } from '../../registry.js'; import { ethereumChainNames } from './chains.js'; import gasPrices from './gasPrices.json'; @@ -25,9 +27,15 @@ const tokenPrices: ChainMap = rawTokenPrices; export function getOverheadWithOverrides(local: ChainName, remote: ChainName) { let overhead = getOverhead(local, remote, ethereumChainNames); + // Moonbeam gas usage can be up to 4x higher than vanilla EVM if (remote === 'moonbeam') { overhead *= 4; } + // ZkSync gas usage is different from the EVM and tends to give high + // estimates. We double the overhead to help account for this. + if (getChain(remote).technicalStack === ChainTechnicalStack.ZkSync) { + overhead *= 2; + } return overhead; }