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 21:32:53 +0800 |
commit | 3a84568a63f64423683a1dbb9f46cee886a39270 (patch) | |
tree | 070d3478a6f2031b447148ee1d51a952565c02ab /core/vm/evm.go | |
parent | c1138b576524413f8d5755f77aaebd759d6317fc (diff) | |
download | dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.gz dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.bz2 dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.lz dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.xz dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.zst dexon-3a84568a63f64423683a1dbb9f46cee886a39270.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 |