From 298d8ce410a6448d90deb95afff3ce22ec9e886b Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Tue, 12 Apr 2022 12:00:31 +0200 Subject: [PATCH] review feedback for rebase over kiln (#97) --- core/blockchain.go | 7 +------ core/state/state_object.go | 15 --------------- core/types/access_witness.go | 1 - core/vm/interpreter.go | 1 - 4 files changed, 1 insertion(+), 23 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 00de28757036..543755dd5119 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1594,12 +1594,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals, setHead bool) // Process block using the parent state as reference point substart := time.Now() - var ( - usedGas uint64 - receipts types.Receipts - logs []*types.Log - ) - receipts, logs, usedGas, err = bc.processor.Process(block, statedb, bc.vmConfig) + receipts, logs, usedGas, err := bc.processor.Process(block, statedb, bc.vmConfig) if err != nil { bc.reportBlock(block, receipts, err) atomic.StoreUint32(&followupInterrupt, 1) diff --git a/core/state/state_object.go b/core/state/state_object.go index d8be1d2c84f3..5c0f80c76311 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -612,25 +612,10 @@ func (s *stateObject) Balance() *big.Int { return s.data.Balance } -func (s *stateObject) BalanceLE() []byte { - var out [32]byte - for i, b := range s.data.Balance.Bytes() { - out[len(s.data.Balance.Bytes())-1-i] = b - } - - return out[:] -} - func (s *stateObject) Nonce() uint64 { return s.data.Nonce } -func (s *stateObject) NonceLE() []byte { - var out [32]byte - binary.LittleEndian.PutUint64(out[:8], s.data.Nonce) - return out[:] -} - // Never called, but must be present to allow stateObject to be used // as a vm.Account interface that also satisfies the vm.ContractRef // interface. Interfaces are awesome. diff --git a/core/types/access_witness.go b/core/types/access_witness.go index 81802bc429a8..3741d34d7b19 100644 --- a/core/types/access_witness.go +++ b/core/types/access_witness.go @@ -39,7 +39,6 @@ const ( // AccessWitness lists the locations of the state that are being accessed // during the production of a block. -// TODO(@gballet) this doesn't fully support deletions type AccessWitness struct { // Branches flags if a given branch has been loaded Branches map[VerkleStem]Mode diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 103c17f1e0a8..7b93c389a71d 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -197,7 +197,6 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) ( contract.Gas -= touchEachChunksOnReadAndChargeGas(pc, 1, contract.Address().Bytes()[:], contract.Code, contract, in.evm.TxContext.Accesses, contract.IsDeployment) } - // TODO how can we tell if we are in stateless mode here and need to get the op from the witness // If we are in witness mode, then raise an error op = contract.GetOp(pc)