Skip to content

Commit

Permalink
moar logs
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Aug 22, 2024
1 parent 6f0827b commit c6597c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto/kzg4844"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/holiman/uint256"
)
Expand Down Expand Up @@ -270,6 +271,8 @@ func (st *StateTransition) buyGas() error {
mgval = common.Big0
}
if have, want := st.state.GetBalance(st.msg.From), balanceCheckU256; have.Cmp(want) < 0 {
log.Info("failed to get balance", "have", have, "want", want, "isAnchor", st.msg.IsAnchor)

return fmt.Errorf("%w: address %v have %v want %v", ErrInsufficientFunds, st.msg.From.Hex(), have, want)
}
if err := st.gp.SubGas(st.msg.GasLimit); err != nil {
Expand All @@ -280,6 +283,8 @@ func (st *StateTransition) buyGas() error {
st.initialGas = st.msg.GasLimit
mgvalU256, _ := uint256.FromBig(mgval)
st.state.SubBalance(st.msg.From, mgvalU256)

log.Info("bought gas", "isAnchor", st.msg.IsAnchor)
return nil
}

Expand Down Expand Up @@ -462,6 +467,8 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
}
effectiveTipU256, _ := uint256.FromBig(effectiveTip)

log.Info("executed transaction", "from", msg.From, "to", msg.To, "gas", st.gasUsed(), "gasPrice", msg.GasPrice, "effectiveTip", effectiveTip, "value", msg.Value, "isAnchor", msg.IsAnchor)

if st.evm.Config.NoBaseFee && msg.GasFeeCap.Sign() == 0 && msg.GasTipCap.Sign() == 0 {
// Skip fee payment when NoBaseFee is set and the fee fields
// are 0. This avoids a negative effectiveTip being applied to
Expand Down
1 change: 1 addition & 0 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,7 @@ func doCall(ctx context.Context, b Backend, args TransactionArgs, state *state.S
return nil, fmt.Errorf("execution aborted (timeout = %v)", timeout)
}
if err != nil {
log.Info("error executing in doCall", "isAnchor", msg.IsAnchor, "err", err)
return result, fmt.Errorf("err: %w (supplied gas %d)", err, msg.GasLimit)
}
return result, nil
Expand Down

0 comments on commit c6597c6

Please sign in to comment.