mirror of https://github.com/poanetwork/quorum.git
Remove logging used for investigation.
This commit is contained in:
parent
e6dd33d71b
commit
97dfe51a56
|
@ -191,10 +191,8 @@ func (self *StateDB) Empty(addr common.Address) bool {
|
|||
func (self *StateDB) GetBalance(addr common.Address) *big.Int {
|
||||
stateObject := self.getStateObject(addr)
|
||||
if stateObject != nil {
|
||||
log.Info(fmt.Sprintf("======== statedb : ACCOUNT FOUND: %x, with balance = %v", addr, stateObject.Balance()))
|
||||
return stateObject.Balance()
|
||||
}
|
||||
log.Info(fmt.Sprintf("======== statedb : ACCOUNT NOT FOUND: %x", addr))
|
||||
return common.Big0
|
||||
}
|
||||
|
||||
|
|
|
@ -220,7 +220,6 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo
|
|||
|
||||
// Pay intrinsic gas
|
||||
gas, err := IntrinsicGas(st.data, contractCreation, homestead)
|
||||
log.Info("======== state_transition.go::TransitionDb(), calculated: ", "intrinsicGas", gas)
|
||||
if err != nil {
|
||||
return nil, 0, false, err
|
||||
}
|
||||
|
@ -257,7 +256,6 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo
|
|||
|
||||
ret, st.gas, vmerr = evm.Call(sender, to, data, st.gas, st.value)
|
||||
}
|
||||
log.Info("======== state_transition.go::TransitionDb(), used gas calculation: ", "st.gas", st.gas)
|
||||
if vmerr != nil {
|
||||
log.Debug("VM returned with error", "err", vmerr)
|
||||
// The only possible consensus-error would be if there wasn't
|
||||
|
|
|
@ -25,7 +25,6 @@ import (
|
|||
"github.com/ethereum/go-ethereum/core/state"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
)
|
||||
|
||||
// note: Quorum, States, and Value Transfer
|
||||
|
@ -174,7 +173,6 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
|
|||
return nil, gas, nil
|
||||
}
|
||||
|
||||
log.Info("======== evm Call(): getting state for:", "addr", addr)
|
||||
evm.Push(getDualState(evm, addr))
|
||||
defer func() { evm.Pop() }()
|
||||
|
||||
|
@ -210,7 +208,6 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
|
|||
// skip transfer if value /= 0 (see note: Quorum, States, and Value Transfer)
|
||||
if value.Sign() != 0 {
|
||||
if evm.quorumReadOnly {
|
||||
log.Info("======== evm Call() 1: disallowing transfer due to read-only flag")
|
||||
return nil, gas, ErrReadOnlyValueTransfer
|
||||
}
|
||||
evm.Transfer(evm.StateDB, caller.Address(), to.Address(), value)
|
||||
|
@ -418,7 +415,6 @@ func (evm *EVM) Create(caller ContractRef, code []byte, gas uint64, value *big.I
|
|||
// skip transfer if value /= 0 (see note: Quorum, States, and Value Transfer)
|
||||
if value.Sign() != 0 {
|
||||
if evm.quorumReadOnly {
|
||||
log.Info("======== evm create() 1: disallowing transfer due to read-only flag")
|
||||
return nil, common.Address{}, gas, ErrReadOnlyValueTransfer
|
||||
}
|
||||
evm.Transfer(evm.StateDB, caller.Address(), contractAddr, value)
|
||||
|
@ -502,9 +498,7 @@ func getDualState(env *EVM, addr common.Address) StateDB {
|
|||
func (env *EVM) PublicState() PublicState { return env.publicState }
|
||||
func (env *EVM) PrivateState() PrivateState { return env.privateState }
|
||||
func (env *EVM) Push(statedb StateDB) {
|
||||
log.Info("======== evm Push(): ENTRY", "env.privateState", env.privateState, "statedb", statedb)
|
||||
if env.privateState != statedb {
|
||||
log.Info("======== evm Push(): setting quorumReadOnly to TRUE")
|
||||
env.quorumReadOnly = true
|
||||
env.readOnlyDepth = env.currentStateDepth
|
||||
}
|
||||
|
@ -517,10 +511,8 @@ func (env *EVM) Push(statedb StateDB) {
|
|||
env.StateDB = statedb
|
||||
}
|
||||
func (env *EVM) Pop() {
|
||||
log.Info("======== evm Pop(): ENTRY")
|
||||
env.currentStateDepth--
|
||||
if env.quorumReadOnly && env.currentStateDepth == env.readOnlyDepth {
|
||||
log.Info("======== evm Pop(): setting quorumReadOnly to FALSE")
|
||||
env.quorumReadOnly = false
|
||||
}
|
||||
env.StateDB = env.states[env.currentStateDepth-1]
|
||||
|
|
|
@ -35,7 +35,6 @@ import (
|
|||
"github.com/ethereum/go-ethereum/event"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
)
|
||||
|
||||
// EthAPIBackend implements ethapi.Backend for full nodes
|
||||
|
@ -146,7 +145,6 @@ func (b *EthAPIBackend) GetTd(blockHash common.Hash) *big.Int {
|
|||
func (b *EthAPIBackend) GetEVM(ctx context.Context, msg core.Message, apiState vm.MinimalApiState, header *types.Header, vmCfg vm.Config) (*vm.EVM, func() error, error) {
|
||||
statedb := apiState.(EthAPIState)
|
||||
|
||||
log.Info("======== GetEVM(): ", "msg:", msg)
|
||||
// Need to ensure private state is initialised (similar to state_processor.go), else we get issues
|
||||
// further down the line when checking for calls from private state to public state.
|
||||
var privateState *state.StateDB
|
||||
|
|
|
@ -660,7 +660,6 @@ func (s *PublicBlockChainAPI) doCall(ctx context.Context, args CallArgs, blockNr
|
|||
|
||||
state, header, err := s.b.StateAndHeaderByNumber(ctx, blockNr)
|
||||
if state == nil || err != nil {
|
||||
log.Info(fmt.Sprintf("======== doCall 1: failure: %v", err))
|
||||
return nil, 0, false, err
|
||||
}
|
||||
// Set sender address or use a default if none specified
|
||||
|
@ -700,7 +699,6 @@ func (s *PublicBlockChainAPI) doCall(ctx context.Context, args CallArgs, blockNr
|
|||
// Get a new instance of the EVM.
|
||||
evm, vmError, err := s.b.GetEVM(ctx, msg, state, header, vmCfg)
|
||||
if err != nil {
|
||||
log.Info(fmt.Sprintf("======== doCall 2: failure: %v", err))
|
||||
return nil, 0, false, err
|
||||
}
|
||||
// Wait for the context to be done and cancel the evm. Even if the
|
||||
|
@ -715,10 +713,8 @@ func (s *PublicBlockChainAPI) doCall(ctx context.Context, args CallArgs, blockNr
|
|||
gp := new(core.GasPool).AddGas(math.MaxUint64)
|
||||
res, gas, failed, err := core.ApplyMessage(evm, msg, gp)
|
||||
if err := vmError(); err != nil {
|
||||
log.Info(fmt.Sprintf("======== doCall 3: failure: %v", err))
|
||||
return nil, 0, false, err
|
||||
}
|
||||
log.Info(fmt.Sprintf("======== doCall 4: returning: failed = %v, err = %v", failed, err))
|
||||
return res, gas, failed, err
|
||||
}
|
||||
|
||||
|
@ -740,7 +736,6 @@ func (s *PublicBlockChainAPI) EstimateGas(ctx context.Context, args CallArgs) (h
|
|||
)
|
||||
if uint64(args.Gas) >= params.TxGas {
|
||||
hi = uint64(args.Gas)
|
||||
log.Info(fmt.Sprintf("======== estimateGas 1a: hi = %v, lo = %v", hi, lo))
|
||||
} else {
|
||||
// Retrieve the current pending block to act as the gas ceiling
|
||||
block, err := s.b.BlockByNumber(ctx, rpc.PendingBlockNumber)
|
||||
|
@ -748,7 +743,6 @@ func (s *PublicBlockChainAPI) EstimateGas(ctx context.Context, args CallArgs) (h
|
|||
return 0, err
|
||||
}
|
||||
hi = block.GasLimit()
|
||||
log.Info(fmt.Sprintf("======== estimateGas 1b: hi = %v, lo = %v", hi, lo))
|
||||
}
|
||||
cap = hi
|
||||
|
||||
|
@ -756,10 +750,8 @@ func (s *PublicBlockChainAPI) EstimateGas(ctx context.Context, args CallArgs) (h
|
|||
executable := func(gas uint64) bool {
|
||||
args.Gas = hexutil.Uint64(gas)
|
||||
|
||||
log.Info(fmt.Sprintf("======== estimateGas 3: calling EVM with mid = %v", gas))
|
||||
_, _, failed, err := s.doCall(ctx, args, rpc.PendingBlockNumber, vm.Config{}, 0)
|
||||
if err != nil || failed {
|
||||
log.Info(fmt.Sprintf("======== estimateGas 5: EVM call failed with err %v", err))
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
@ -768,10 +760,8 @@ func (s *PublicBlockChainAPI) EstimateGas(ctx context.Context, args CallArgs) (h
|
|||
for lo+1 < hi {
|
||||
mid := (hi + lo) / 2
|
||||
if !executable(mid) {
|
||||
log.Info(fmt.Sprintf("======== estimateGas 5b: Call failed, setting lo = %v", mid))
|
||||
lo = mid
|
||||
} else {
|
||||
log.Info(fmt.Sprintf("======== estimateGas 5b: Call succeeded, setting hi = %v", mid))
|
||||
hi = mid
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue