From b99b2c446ca3a81a692eb58294d5a4f6a999f00c Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 5 Jan 2015 17:37:30 +0100 Subject: Precompiled contract & Depth change * Added pre-compiled contract 0x04 (mem cpy) * Changed depth error to return the gas instead of consuming --- vm/common.go | 1 + 1 file changed, 1 insertion(+) (limited to 'vm/common.go') diff --git a/vm/common.go b/vm/common.go index 529bbdeb1..acf18eede 100644 --- a/vm/common.go +++ b/vm/common.go @@ -38,6 +38,7 @@ var ( GasSha256 = big.NewInt(50) GasRipemd = big.NewInt(50) GasEcrecover = big.NewInt(500) + GasMemCpy = big.NewInt(1) Pow256 = ethutil.BigPow(2, 256) -- cgit v1.2.3 From f0ec75123747424ab2606fe6ef650b13520fac22 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 6 Jan 2015 20:22:31 +0100 Subject: Updated tests --- vm/common.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vm/common.go') diff --git a/vm/common.go b/vm/common.go index acf18eede..f19b0fe4b 100644 --- a/vm/common.go +++ b/vm/common.go @@ -49,7 +49,7 @@ var ( S256 = ethutil.S256 ) -const MaxCallDepth = 1024 +const MaxCallDepth = 1025 func calcMemSize(off, l *big.Int) *big.Int { if l.Cmp(ethutil.Big0) == 0 { -- cgit v1.2.3 From ba225017c4c1b60dff57ad56da4e8972812a17e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 12 Jan 2015 19:40:14 +0100 Subject: JitVm struct stub. Forwards calls to DebugVm. --- vm/common.go | 1 + 1 file changed, 1 insertion(+) (limited to 'vm/common.go') diff --git a/vm/common.go b/vm/common.go index f19b0fe4b..ed250dab1 100644 --- a/vm/common.go +++ b/vm/common.go @@ -14,6 +14,7 @@ type Type int const ( StandardVmTy Type = iota DebugVmTy + JitVmTy MaxVmTy ) -- cgit v1.2.3 From 89c69a1d257daf973690a7fb96d2aa2b9d0849ec Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 19 Jan 2015 11:18:34 +0100 Subject: VmDebug => StdVm --- vm/common.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'vm/common.go') diff --git a/vm/common.go b/vm/common.go index ed250dab1..ff187001f 100644 --- a/vm/common.go +++ b/vm/common.go @@ -9,11 +9,10 @@ import ( var vmlogger = logger.NewLogger("VM") -type Type int +type Type byte const ( - StandardVmTy Type = iota - DebugVmTy + StdVmTy Type = iota JitVmTy MaxVmTy -- cgit v1.2.3 From 8ccde784f9035c0a7a8f234994538c817c5b9de7 Mon Sep 17 00:00:00 2001 From: obscuren Date: Sun, 1 Feb 2015 15:30:29 +0100 Subject: Added (disabled) Jit validation --- vm/common.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'vm/common.go') diff --git a/vm/common.go b/vm/common.go index ff187001f..45a7187a9 100644 --- a/vm/common.go +++ b/vm/common.go @@ -18,6 +18,18 @@ const ( MaxVmTy ) +func NewVm(env Environment) VirtualMachine { + switch env.VmType() { + case JitVmTy: + return NewJitVm(env) + default: + vmlogger.Infoln("unsupported vm type %d", env.VmType()) + fallthrough + case StdVmTy: + return New(env) + } +} + var ( GasStep = big.NewInt(1) GasSha = big.NewInt(10) -- cgit v1.2.3