|
| 1 | +import { ChainsService } from "@/chains"; |
1 | 2 | import { BadRequestException, packUint128Pair, withTrace } from "@/common"; |
2 | 3 | import { TokenWithPermitAbi } from "@/contracts/resources/erc20-with-permit"; |
3 | 4 | import { type ConfigType, InjectConfig } from "@/core/config"; |
@@ -79,6 +80,7 @@ export class SimulationService { |
79 | 80 | private readonly nodeService: NodeService, |
80 | 81 | private readonly tokenSlotDetectionService: TokenSlotDetectionService, |
81 | 82 | private readonly rpcManagerService: RpcManagerService, |
| 83 | + private readonly chainsService: ChainsService, |
82 | 84 | @InjectConfig(gasEstimatorConfig) |
83 | 85 | private readonly gasEstimatorConfiguration: ConfigType< |
84 | 86 | typeof gasEstimatorConfig |
@@ -772,6 +774,17 @@ export class SimulationService { |
772 | 774 | ); |
773 | 775 | } |
774 | 776 |
|
| 777 | + const { simulationGasLimitBuffers } = |
| 778 | + this.chainsService.getChainSettings(chainId); |
| 779 | + |
| 780 | + // Chain specific verification and call gas limit buffers to handle any special cases. |
| 781 | + if (simulationGasLimitBuffers.callGasLimit) |
| 782 | + callGasLimit += simulationGasLimitBuffers.callGasLimit; |
| 783 | + |
| 784 | + if (simulationGasLimitBuffers.verificationGasLimit) |
| 785 | + verificationGasLimit += |
| 786 | + simulationGasLimitBuffers.verificationGasLimit; |
| 787 | + |
775 | 788 | return { |
776 | 789 | userOpIndex, |
777 | 790 | chainId, |
|
0 commit comments