diff options
author | obscuren <geffobscura@gmail.com> | 2015-06-11 17:59:30 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-06-11 17:59:30 +0800 |
commit | f599a1b5f143503817c9fa411854b9a8dac6ba72 (patch) | |
tree | 0de1bc604e749e1da0707d659edcc5191183affa /core/vm | |
parent | 9e9bd3555789f069b6cb1950fe329d307f951eab (diff) | |
download | dexon-f599a1b5f143503817c9fa411854b9a8dac6ba72.tar dexon-f599a1b5f143503817c9fa411854b9a8dac6ba72.tar.gz dexon-f599a1b5f143503817c9fa411854b9a8dac6ba72.tar.bz2 dexon-f599a1b5f143503817c9fa411854b9a8dac6ba72.tar.lz dexon-f599a1b5f143503817c9fa411854b9a8dac6ba72.tar.xz dexon-f599a1b5f143503817c9fa411854b9a8dac6ba72.tar.zst dexon-f599a1b5f143503817c9fa411854b9a8dac6ba72.zip |
core/vm: added a comment regarding the uint64 vs *big.Int
Diffstat (limited to 'core/vm')
-rw-r--r-- | core/vm/vm.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/vm/vm.go b/core/vm/vm.go index 117331389..4c0ab0f47 100644 --- a/core/vm/vm.go +++ b/core/vm/vm.go @@ -76,8 +76,10 @@ func (self *Vm) Run(context *Context, input []byte) (ret []byte, err error) { codehash = crypto.Sha3Hash(code) // codehash is used when doing jump dest caching mem = NewMemory() // bound memory stack = newstack() // local stack - pc = uint64(0) // program counter statedb = self.env.State() // current state + // For optimisation reason we're using uint64 as the program counter. + // It's theoretically possible to go above 2^64. The YP defines the PC to be uint256. Pratically much less so feasible. + pc = uint64(0) // program counter // jump evaluates and checks whether the given jump destination is a valid one // if valid move the `pc` otherwise return an error. |