aboutsummaryrefslogtreecommitdiffstats
path: root/core/state_processor.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-06-29 16:44:51 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-06-29 16:44:51 +0800
commit6362a9d6102b26e926b3e73563267fc75cb30f9c (patch)
tree56ce21d1aaf6df3908335601a687f0f3ac4a50be /core/state_processor.go
parentd55fc35df1ca4996048625421d4c475a437d273e (diff)
downloaddexon-6362a9d6102b26e926b3e73563267fc75cb30f9c.tar
dexon-6362a9d6102b26e926b3e73563267fc75cb30f9c.tar.gz
dexon-6362a9d6102b26e926b3e73563267fc75cb30f9c.tar.bz2
dexon-6362a9d6102b26e926b3e73563267fc75cb30f9c.tar.lz
dexon-6362a9d6102b26e926b3e73563267fc75cb30f9c.tar.xz
dexon-6362a9d6102b26e926b3e73563267fc75cb30f9c.tar.zst
dexon-6362a9d6102b26e926b3e73563267fc75cb30f9c.zip
Revert "test, cmd/evm, core, core/vm: illegal code hash implementation"
This reverts commit 7a5b571c671e70e0e4807cf971c15e2d1e09d33d.
Diffstat (limited to 'core/state_processor.go')
-rw-r--r--core/state_processor.go24
1 files changed, 3 insertions, 21 deletions
diff --git a/core/state_processor.go b/core/state_processor.go
index 55c1301eb..95b3057bb 100644
--- a/core/state_processor.go
+++ b/core/state_processor.go
@@ -17,10 +17,8 @@
package core
import (
- "errors"
"math/big"
- "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
@@ -30,15 +28,8 @@ import (
)
var (
- big8 = big.NewInt(8)
- big32 = big.NewInt(32)
- illegalCodeHashErr = errors.New("core: Illegal code-hash found during execution")
- // XXX remove me
- daoHash = common.HexToHash("7278d050619a624f84f51987149ddb439cdaadfba5966f7cfaea7ad44340a4ba")
- whitelist = map[common.Address]bool{
- common.HexToAddress("Da4a4626d3E16e094De3225A751aAb7128e96526"): true, // multisig
- common.HexToAddress("2ba9D006C1D72E67A70b5526Fc6b4b0C0fd6D334"): true, // attack contract
- }
+ big8 = big.NewInt(8)
+ big32 = big.NewInt(32)
)
// StateProcessor is a basic Processor, which takes care of transitioning
@@ -95,20 +86,11 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
// ApplyTransactions returns the generated receipts and vm logs during the
// execution of the state transition phase.
func ApplyTransaction(config *ChainConfig, bc *BlockChain, gp *GasPool, statedb *state.StateDB, header *types.Header, tx *types.Transaction, usedGas *big.Int, cfg vm.Config) (*types.Receipt, vm.Logs, *big.Int, error) {
- env := NewEnv(statedb, config, bc, tx, header, cfg)
- _, gas, err := ApplyMessage(env, tx, gp)
+ _, gas, err := ApplyMessage(NewEnv(statedb, config, bc, tx, header, cfg), tx, gp)
if err != nil {
return nil, nil, nil, err
}
- for _, codeHash := range env.CodeHashes {
- _, illegalHash := IllegalCodeHashes[codeHash]
- to := tx.To()
- if illegalHash && to != nil && !whitelist[*to] {
- return nil, nil, nil, illegalCodeHashErr
- }
- }
-
// Update the state with pending changes
usedGas.Add(usedGas, gas)
receipt := types.NewReceipt(statedb.IntermediateRoot().Bytes(), usedGas)