Skip to content

Commit

Permalink
add print
Browse files Browse the repository at this point in the history
  • Loading branch information
iteyelmp committed Dec 26, 2024
1 parent a1dbba4 commit a50d75e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 3 additions & 0 deletions core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package vm

import (
"errors"
"log"
"math/big"
"sync/atomic"

Expand All @@ -41,11 +42,13 @@ type (
)

func (evm *EVM) precompile(addr common.Address) (PrecompiledContract, bool) {
log.Println("-----precompile--1---")
p, ok := evm.precompiles[addr]
if evm.Config.PrecompileOverrides != nil {
override := evm.Config.PrecompileOverrides(evm.chainRules, p, addr)
return override, override != nil
}
log.Println("-----precompile--2---", evm.Config.IsEthStorage, !ok)
if evm.Config.IsEthStorage && !ok {
p, ok = PrecompiledContractsES[addr]
}
Expand Down
15 changes: 8 additions & 7 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,13 @@ func doCall(ctx context.Context, b Backend, args TransactionArgs, state *state.S
} else {
gp.AddGas(globalGasCap)
}
return applyMessage(ctx, b, args, state, header, timeout, gp, &blockCtx, &vm.Config{NoBaseFee: true}, precompiles, true)

var isEthStorage = false
if ctx.Value(esKey{}) == true {
isEthStorage = true
}
log.Info("-----isEthStorage-----", "isEthStorage", isEthStorage)
return applyMessage(ctx, b, args, state, header, timeout, gp, &blockCtx, &vm.Config{NoBaseFee: true, IsEthStorage: isEthStorage}, precompiles, true)
}

func applyMessage(ctx context.Context, b Backend, args TransactionArgs, state *state.StateDB, header *types.Header, timeout time.Duration, gp *core.GasPool, blockContext *vm.BlockContext, vmConfig *vm.Config, precompiles vm.PrecompiledContracts, skipChecks bool) (*core.ExecutionResult, error) {
Expand All @@ -1289,12 +1295,7 @@ func applyMessage(ctx context.Context, b Backend, args TransactionArgs, state *s
if msg.BlobGasFeeCap != nil && msg.BlobGasFeeCap.BitLen() == 0 {
blockContext.BlobBaseFee = new(big.Int)
}
var isEthStorage = false
if ctx.Value(esKey{}) == true {
isEthStorage = true
}
evm := b.GetEVM(ctx, msg, state, header, &vm.Config{NoBaseFee: true, IsEthStorage: isEthStorage}, blockContext)
// TODO evm := b.GetEVM(ctx, msg, state, header, vmConfig, blockContext)
evm := b.GetEVM(ctx, msg, state, header, vmConfig, blockContext)
if precompiles != nil {
evm.SetPrecompiles(precompiles)
}
Expand Down

0 comments on commit a50d75e

Please sign in to comment.