From 40b7dbbd9b18afba2a58d76c736741326cb20304 Mon Sep 17 00:00:00 2001 From: Zhang Guyu Date: Sat, 20 Aug 2022 06:27:45 +0000 Subject: [PATCH] add log --- core/state_transition.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/state_transition.go b/core/state_transition.go index 97c4e31214..b20096c2fa 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -26,6 +26,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" ) @@ -294,6 +295,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { if err := st.preCheck(); err != nil { return nil, err } + log.Info("PreCheck", "st.initialGas", st.initialGas, "st.gas", st.gas) if st.evm.Config.Debug { st.evm.Config.Tracer.CaptureTxStart(st.initialGas) @@ -314,6 +316,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { if err != nil { return nil, err } + log.Info("IntrinsicGas", "st.initialGas", st.initialGas, "st.gas", st.gas) if st.gas < gas { return nil, fmt.Errorf("%w: have %d, want %d", ErrIntrinsicGas, st.gas, gas) } @@ -339,6 +342,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { st.state.SetNonce(msg.From(), st.state.GetNonce(sender.Address())+1) ret, st.gas, vmerr = st.evm.Call(sender, st.to(), st.data, st.gas, st.value) } + log.Info("evm.Call", "st.initialGas", st.initialGas, "st.gas", st.gas) if !rules.IsLondon { // Before EIP-3529: refunds were capped to gasUsed / 2 @@ -361,6 +365,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { fee.Mul(fee, effectiveTip) st.state.AddBalance(st.evm.Context.Coinbase, fee) } + log.Info("TransitionDb.return", "st.initialGas", st.initialGas, "st.gas", st.gas) return &ExecutionResult{ UsedGas: st.gasUsed(),