From 06128e8f64b7bf2997b70959c78ab256404ebab3 Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Fri, 20 Dec 2024 09:53:12 +0800 Subject: [PATCH] chore(protocol): delete gas debug event (#18620) --- .../contracts/layer1/based/TaikoL1.sol | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/packages/protocol/contracts/layer1/based/TaikoL1.sol b/packages/protocol/contracts/layer1/based/TaikoL1.sol index 1ce30755442..0a1175e5fce 100644 --- a/packages/protocol/contracts/layer1/based/TaikoL1.sol +++ b/packages/protocol/contracts/layer1/based/TaikoL1.sol @@ -25,13 +25,6 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents { uint256[50] private __gap; - /// @dev Emitted to assist with future gas optimizations. - /// @param isProposeBlock True if measuring gas for proposing a block, false if measuring gas - /// for proving a block. - /// @param gasUsed The average gas used per block, including verifications. - /// @param batchSize The number of blocks proposed or proved. - event DebugGasPerBlock(bool isProposeBlock, uint256 gasUsed, uint256 batchSize); - error L1_FORK_HEIGHT_ERROR(); modifier whenProvingNotPaused() { @@ -44,16 +37,6 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents { emit StateVariablesUpdated(state.slotB); } - modifier measureGasUsed(bool _isProposeBlock, uint256 _batchSize) { - uint256 gas = gasleft(); - _; - unchecked { - if (_batchSize > 0) { - emit DebugGasPerBlock(_isProposeBlock, gas - gasleft() / _batchSize, _batchSize); - } - } - } - /// @notice Initializes the contract. /// @param _owner The owner of this contract. msg.sender will be used if this value is zero. /// @param _rollupAddressManager The address of the {AddressManager} contract. @@ -90,7 +73,6 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents { bytes calldata _txList ) external - measureGasUsed(true, 1) whenNotPaused nonReentrant emitEventForClient @@ -106,7 +88,6 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents { bytes[] calldata _txListArr ) external - measureGasUsed(true, _paramsArr.length) whenNotPaused nonReentrant emitEventForClient @@ -122,7 +103,6 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents { bytes calldata _input ) external - measureGasUsed(false, 1) whenNotPaused whenProvingNotPaused nonReentrant @@ -138,7 +118,6 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents { bytes calldata _batchProof ) external - measureGasUsed(false, _blockIds.length) whenNotPaused whenProvingNotPaused nonReentrant