Skip to content

Commit

Permalink
chore(protocol): delete gas debug event (#18620)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored Dec 20, 2024
1 parent b2ca63c commit 06128e8
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions packages/protocol/contracts/layer1/based/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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.
Expand Down Expand Up @@ -90,7 +73,6 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents {
bytes calldata _txList
)
external
measureGasUsed(true, 1)
whenNotPaused
nonReentrant
emitEventForClient
Expand All @@ -106,7 +88,6 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents {
bytes[] calldata _txListArr
)
external
measureGasUsed(true, _paramsArr.length)
whenNotPaused
nonReentrant
emitEventForClient
Expand All @@ -122,7 +103,6 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents {
bytes calldata _input
)
external
measureGasUsed(false, 1)
whenNotPaused
whenProvingNotPaused
nonReentrant
Expand All @@ -138,7 +118,6 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents {
bytes calldata _batchProof
)
external
measureGasUsed(false, _blockIds.length)
whenNotPaused
whenProvingNotPaused
nonReentrant
Expand Down

0 comments on commit 06128e8

Please sign in to comment.