forked from bnb-chain/op-geth
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
andyzhang2023
committed
Oct 12, 2024
1 parent
f3bc8ce
commit 4b86635
Showing
11 changed files
with
117 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package state | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/ethereum/go-ethereum/common" | ||
) | ||
|
||
// for debug | ||
type GasSummary struct { | ||
TxHash common.Hash | ||
GasLimit uint64 | ||
IntrinsicGas struct { | ||
BasicGas uint64 | ||
InputGas struct { | ||
NonZeroGas uint64 | ||
ZeroGas uint64 | ||
InitCodeGas uint64 | ||
} | ||
AccessListGas struct { | ||
AccessListGas uint64 | ||
StorageKeyGas uint64 | ||
} | ||
} | ||
EvmCallGas uint64 | ||
Refunds struct { | ||
IsLondon bool | ||
Refunds uint64 | ||
StateRefunds uint64 | ||
GasUsed uint64 | ||
} | ||
GasUsed uint64 | ||
} | ||
|
||
func (gs *GasSummary) Debug() string { | ||
intri := fmt.Sprintf("BasicGas:%d, NonZeroGas:%d, ZeroGas:%d, InitCodeGas:%d, Acceslist:%d, Storagekey:%d", gs.IntrinsicGas.BasicGas, gs.IntrinsicGas.InputGas.NonZeroGas, gs.IntrinsicGas.InputGas.ZeroGas, gs.IntrinsicGas.InputGas.InitCodeGas, gs.IntrinsicGas.AccessListGas.AccessListGas, gs.IntrinsicGas.AccessListGas.StorageKeyGas) | ||
refunds := fmt.Sprintf("IsLondon:%t, Refunds:%d, StateRefunds:%d, GasUsed:%d", gs.Refunds.IsLondon, gs.Refunds.Refunds, gs.Refunds.StateRefunds, gs.Refunds.GasUsed) | ||
return fmt.Sprintf("TxHash:%s, GasLimit:%d, IntrinsicGas:{%s}, EvmCallGas:%d, Refunds:{%s}, GasUsed:%d", gs.TxHash.Hex(), gs.GasLimit, intri, gs.EvmCallGas, refunds, gs.GasUsed) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters