From 834c52af6406b9af429104408ca7bcbc525efe5c Mon Sep 17 00:00:00 2001
From: Christoph Jentzsch <jentzsch.software@gmail.com>
Date: Thu, 23 Oct 2014 12:01:05 +0200
Subject: [PATCH] Changing gas cost to zero at stackunderflow

---
 randomTests/201410211657.json          | 44 --------------------------
 randomTests/201410211701.json          | 44 --------------------------
 randomTests/201410211704.json          | 44 --------------------------
 randomTests/201410211707.json          | 44 --------------------------
 randomTests/201410211709.json          | 44 --------------------------
 randomTests/201410211717.json          |  1 -
 randomTests/201410211719.json          | 44 --------------------------
 randomTests/201410211722.json          | 44 --------------------------
 vmtests/vmEnvironmentalInfoTest.json   |  2 +-
 vmtests/vmIOandFlowOperationsTest.json |  4 +--
 vmtests/vmPushDupSwapTest.json         |  4 +--
 11 files changed, 5 insertions(+), 314 deletions(-)
 delete mode 100644 randomTests/201410211657.json
 delete mode 100644 randomTests/201410211701.json
 delete mode 100644 randomTests/201410211704.json
 delete mode 100644 randomTests/201410211707.json
 delete mode 100644 randomTests/201410211709.json
 delete mode 100644 randomTests/201410211717.json
 delete mode 100644 randomTests/201410211719.json
 delete mode 100644 randomTests/201410211722.json

diff --git a/randomTests/201410211657.json b/randomTests/201410211657.json
deleted file mode 100644
index b09bd8b77..000000000
--- a/randomTests/201410211657.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
-    "randomVMtest" : {
-        "callcreates" : [
-        ],
-        "env" : {
-            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
-            "currentDifficulty" : "256",
-            "currentGasLimit" : "1000000",
-            "currentNumber" : "0",
-            "currentTimestamp" : "1",
-            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
-        },
-        "exec" : {
-            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
-            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
-            "code" : "0x5c563a33394098945a",
-            "data" : "0x",
-            "gas" : "10000",
-            "gasPrice" : "100000000000000",
-            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
-            "value" : "1000000000000000000"
-        },
-        "gas" : "9974",
-        "out" : "0x",
-        "post" : {
-            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
-                "code" : "0x5c563a33394098945a",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "pre" : {
-            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
-                "code" : "0x5c563a33394098945a",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        }
-    }
-}
diff --git a/randomTests/201410211701.json b/randomTests/201410211701.json
deleted file mode 100644
index 70b06d25d..000000000
--- a/randomTests/201410211701.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
-    "randomVMtest" : {
-        "callcreates" : [
-        ],
-        "env" : {
-            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
-            "currentDifficulty" : "256",
-            "currentGasLimit" : "1000000",
-            "currentNumber" : "0",
-            "currentTimestamp" : "1",
-            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
-        },
-        "exec" : {
-            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
-            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
-            "code" : "0x8b",
-            "data" : "0x",
-            "gas" : "10000",
-            "gasPrice" : "100000000000000",
-            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
-            "value" : "1000000000000000000"
-        },
-        "gas" : "9999",
-        "out" : "0x",
-        "post" : {
-            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
-                "code" : "0x8b",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "pre" : {
-            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
-                "code" : "0x8b",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        }
-    }
-}
diff --git a/randomTests/201410211704.json b/randomTests/201410211704.json
deleted file mode 100644
index 0e67bd2b3..000000000
--- a/randomTests/201410211704.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
-    "randomVMtest" : {
-        "callcreates" : [
-        ],
-        "env" : {
-            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
-            "currentDifficulty" : "256",
-            "currentGasLimit" : "1000000",
-            "currentNumber" : "0",
-            "currentTimestamp" : "1",
-            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
-        },
-        "exec" : {
-            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
-            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
-            "code" : "0x86",
-            "data" : "0x",
-            "gas" : "10000",
-            "gasPrice" : "100000000000000",
-            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
-            "value" : "1000000000000000000"
-        },
-        "gas" : "9999",
-        "out" : "0x",
-        "post" : {
-            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
-                "code" : "0x86",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "pre" : {
-            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
-                "code" : "0x86",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        }
-    }
-}
diff --git a/randomTests/201410211707.json b/randomTests/201410211707.json
deleted file mode 100644
index a081aac49..000000000
--- a/randomTests/201410211707.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
-    "randomVMtest" : {
-        "callcreates" : [
-        ],
-        "env" : {
-            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
-            "currentDifficulty" : "256",
-            "currentGasLimit" : "1000000",
-            "currentNumber" : "0",
-            "currentTimestamp" : "1",
-            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
-        },
-        "exec" : {
-            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
-            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
-            "code" : "0x9b",
-            "data" : "0x",
-            "gas" : "10000",
-            "gasPrice" : "100000000000000",
-            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
-            "value" : "1000000000000000000"
-        },
-        "gas" : "9999",
-        "out" : "0x",
-        "post" : {
-            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
-                "code" : "0x9b",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "pre" : {
-            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
-                "code" : "0x9b",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        }
-    }
-}
diff --git a/randomTests/201410211709.json b/randomTests/201410211709.json
deleted file mode 100644
index 18c9b3916..000000000
--- a/randomTests/201410211709.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
-    "randomVMtest" : {
-        "callcreates" : [
-        ],
-        "env" : {
-            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
-            "currentDifficulty" : "256",
-            "currentGasLimit" : "1000000",
-            "currentNumber" : "0",
-            "currentTimestamp" : "1",
-            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
-        },
-        "exec" : {
-            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
-            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
-            "code" : "0x94",
-            "data" : "0x",
-            "gas" : "10000",
-            "gasPrice" : "100000000000000",
-            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
-            "value" : "1000000000000000000"
-        },
-        "gas" : "9999",
-        "out" : "0x",
-        "post" : {
-            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
-                "code" : "0x94",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "pre" : {
-            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
-                "code" : "0x94",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        }
-    }
-}
diff --git a/randomTests/201410211717.json b/randomTests/201410211717.json
deleted file mode 100644
index 8b1378917..000000000
--- a/randomTests/201410211717.json
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/randomTests/201410211719.json b/randomTests/201410211719.json
deleted file mode 100644
index 0c1b7c1da..000000000
--- a/randomTests/201410211719.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
-    "randomVMtest" : {
-        "callcreates" : [
-        ],
-        "env" : {
-            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
-            "currentDifficulty" : "256",
-            "currentGasLimit" : "1000000",
-            "currentNumber" : "0",
-            "currentTimestamp" : "1",
-            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
-        },
-        "exec" : {
-            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
-            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
-            "code" : "0x93",
-            "data" : "0x",
-            "gas" : "10000",
-            "gasPrice" : "100000000000000",
-            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
-            "value" : "1000000000000000000"
-        },
-        "gas" : "9999",
-        "out" : "0x",
-        "post" : {
-            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
-                "code" : "0x93",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "pre" : {
-            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
-                "code" : "0x93",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        }
-    }
-}
diff --git a/randomTests/201410211722.json b/randomTests/201410211722.json
deleted file mode 100644
index a081aac49..000000000
--- a/randomTests/201410211722.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
-    "randomVMtest" : {
-        "callcreates" : [
-        ],
-        "env" : {
-            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
-            "currentDifficulty" : "256",
-            "currentGasLimit" : "1000000",
-            "currentNumber" : "0",
-            "currentTimestamp" : "1",
-            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
-        },
-        "exec" : {
-            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
-            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
-            "code" : "0x9b",
-            "data" : "0x",
-            "gas" : "10000",
-            "gasPrice" : "100000000000000",
-            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
-            "value" : "1000000000000000000"
-        },
-        "gas" : "9999",
-        "out" : "0x",
-        "post" : {
-            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
-                "code" : "0x9b",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "pre" : {
-            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
-                "code" : "0x9b",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        }
-    }
-}
diff --git a/vmtests/vmEnvironmentalInfoTest.json b/vmtests/vmEnvironmentalInfoTest.json
index 0b24173d9..35ad5f8f1 100644
--- a/vmtests/vmEnvironmentalInfoTest.json
+++ b/vmtests/vmEnvironmentalInfoTest.json
@@ -1128,4 +1128,4 @@
             }
         }
     }
-}
+}
\ No newline at end of file
diff --git a/vmtests/vmIOandFlowOperationsTest.json b/vmtests/vmIOandFlowOperationsTest.json
index 74d63649e..c5034754a 100644
--- a/vmtests/vmIOandFlowOperationsTest.json
+++ b/vmtests/vmIOandFlowOperationsTest.json
@@ -1170,7 +1170,7 @@
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
-        "gas" : "9999",
+        "gas" : "10000",
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -1369,4 +1369,4 @@
             }
         }
     }
-}
+}
\ No newline at end of file
diff --git a/vmtests/vmPushDupSwapTest.json b/vmtests/vmPushDupSwapTest.json
index 444ccc5d8..f7fcb335d 100644
--- a/vmtests/vmPushDupSwapTest.json
+++ b/vmtests/vmPushDupSwapTest.json
@@ -407,7 +407,7 @@
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
-        "gas" : "9998",
+        "gas" : "9999",
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@@ -2555,7 +2555,7 @@
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
-        "gas" : "9997",
+        "gas" : "9998",
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-- 
GitLab