diff options
author | Wei-Ning Huang <aitjcize@gmail.com> | 2018-11-14 10:57:53 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 13:49:56 +0800 |
commit | c2adbce8887f41acc19dea4b62c0b209b9eb2072 (patch) | |
tree | bf68c51a05e74a53fdf060165778cb35ec2ec964 /core/vm/evm.go | |
parent | 083072c30c6dc407466e4ab48a7c81b42233f225 (diff) | |
download | dexon-c2adbce8887f41acc19dea4b62c0b209b9eb2072.tar dexon-c2adbce8887f41acc19dea4b62c0b209b9eb2072.tar.gz dexon-c2adbce8887f41acc19dea4b62c0b209b9eb2072.tar.bz2 dexon-c2adbce8887f41acc19dea4b62c0b209b9eb2072.tar.lz dexon-c2adbce8887f41acc19dea4b62c0b209b9eb2072.tar.xz dexon-c2adbce8887f41acc19dea4b62c0b209b9eb2072.tar.zst dexon-c2adbce8887f41acc19dea4b62c0b209b9eb2072.zip |
core: validate DKG set with correct nodeset in round-2 (#19)
* vendor: sync consensus core
* core: validate DKG set with correct nodeset in round-2
Diffstat (limited to 'core/vm/evm.go')
-rw-r--r-- | core/vm/evm.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/vm/evm.go b/core/vm/evm.go index a75d0f1d3..865ab0d5b 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -18,11 +18,11 @@ package vm import ( "math/big" - "sync" "sync/atomic" "time" "github.com/dexon-foundation/dexon/common" + "github.com/dexon-foundation/dexon/core/state" "github.com/dexon-foundation/dexon/crypto" "github.com/dexon-foundation/dexon/params" ) @@ -39,6 +39,10 @@ type ( // GetHashFunc returns the nth block hash in the blockchain // and is used by the BLOCKHASH EVM op code. GetHashFunc func(uint64) common.Hash + // StateAtFunc returns the statedb given a root hash. + StateAtNumberFunc func(uint64) (*state.StateDB, error) + // GetRoundHeightFunc returns the round height. + GetRoundHeightFunc func(uint64) (uint64, bool) ) // run runs the given contract and takes care of running precompiles with a fallback to the byte code interpreter. @@ -81,6 +85,10 @@ type Context struct { Transfer TransferFunc // GetHash returns the hash corresponding to n GetHash GetHashFunc + // StateAtNumber returns the statedb given a root hash. + StateAtNumber StateAtNumberFunc + // GetRoundHeight returns the round height. + GetRoundHeight GetRoundHeightFunc // Message information Origin common.Address // Provides information for ORIGIN @@ -93,7 +101,6 @@ type Context struct { Time *big.Int // Provides information for TIME Randomness []byte // Provides information for RAND Difficulty *big.Int // Provides information for DIFFICULTY - RoundHeight sync.Map // Provides information of round height mapping. } // EVM is the Ethereum Virtual Machine base object and provides |