Merge branch 'vmfixes'

This commit is contained in:
nicksavers 2014-10-24 17:48:53 +02:00
commit 3613002557
36 changed files with 2333 additions and 1801 deletions

View File

@ -5,7 +5,6 @@ import org.ethereum.facade.Repository;
import org.ethereum.listener.EthereumListener; import org.ethereum.listener.EthereumListener;
import org.ethereum.manager.WorldManager; import org.ethereum.manager.WorldManager;
import org.ethereum.net.BlockQueue; import org.ethereum.net.BlockQueue;
import org.ethereum.net.eth.EthHandler;
import org.ethereum.util.AdvancedDeviceUtils; import org.ethereum.util.AdvancedDeviceUtils;
import org.ethereum.vm.*; import org.ethereum.vm.*;
import org.slf4j.Logger; import org.slf4j.Logger;

View File

@ -3,8 +3,6 @@ package org.ethereum.core;
import org.ethereum.crypto.HashUtil; import org.ethereum.crypto.HashUtil;
import org.ethereum.trie.Trie; import org.ethereum.trie.Trie;
import org.ethereum.trie.TrieImpl; import org.ethereum.trie.TrieImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spongycastle.util.encoders.Hex; import org.spongycastle.util.encoders.Hex;
import java.math.BigInteger; import java.math.BigInteger;
@ -41,8 +39,6 @@ public class Genesis extends Block {
"1a26338f0d905e295fccb71fa9ea849ffa12aaf4", // # (A) "1a26338f0d905e295fccb71fa9ea849ffa12aaf4", // # (A)
}; };
Logger logger = LoggerFactory.getLogger("main");
private static byte[] zeroHash256 = new byte[32]; private static byte[] zeroHash256 = new byte[32];
private static byte[] zeroHash160 = new byte[20]; private static byte[] zeroHash160 = new byte[20];
@ -74,9 +70,6 @@ public class Genesis extends Block {
state.update(Hex.decode(address), acctState.getEncoded()); state.update(Hex.decode(address), acctState.getEncoded());
} }
setStateRoot(state.getRootHash()); setStateRoot(state.getRootHash());
logger.info("Genesis-hash: {}", Hex.toHexString(this.getHash()));
logger.info("Genesis-stateRoot: {}", Hex.toHexString(this.getStateRoot()));
} }
public static Block getInstance() { public static Block getInstance() {

View File

@ -12,7 +12,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.spongycastle.util.BigIntegers; import org.spongycastle.util.BigIntegers;
import java.math.BigInteger;
import java.security.SignatureException; import java.security.SignatureException;
/** /**
@ -25,7 +24,7 @@ import java.security.SignatureException;
*/ */
public class Transaction { public class Transaction {
private static Logger logger = LoggerFactory.getLogger(Transaction.class); private static final Logger logger = LoggerFactory.getLogger(Transaction.class);
/* SHA3 hash of the RLP encoded transaction */ /* SHA3 hash of the RLP encoded transaction */
private byte[] hash; private byte[] hash;

View File

@ -27,7 +27,7 @@ import org.spongycastle.util.encoders.Hex;
*/ */
public class DatabaseImpl implements Database { public class DatabaseImpl implements Database {
private static Logger logger = LoggerFactory.getLogger("db"); private static final Logger logger = LoggerFactory.getLogger("db");
private DB db; private DB db;
private String name; private String name;

View File

@ -56,7 +56,7 @@ import static org.ethereum.config.SystemProperties.CONFIG;
*/ */
public class RepositoryImpl implements Repository { public class RepositoryImpl implements Repository {
private Logger logger = LoggerFactory.getLogger("repository"); private static final Logger logger = LoggerFactory.getLogger("repository");
private Trie worldState; private Trie worldState;
private TrackTrie accountStateDB; private TrackTrie accountStateDB;
@ -473,18 +473,17 @@ public class RepositoryImpl implements Repository {
} }
public void close() { public void close() {
if (this.detailsDB != null){
if (this.chainDB != null){ detailsDB.close();
chainDB.close(); detailsDB = null;
chainDB = null;
} }
if (this.stateDB != null){ if (this.stateDB != null){
stateDB.close(); stateDB.close();
stateDB = null; stateDB = null;
} }
if (this.detailsDB != null){ if (this.chainDB != null){
detailsDB.close(); chainDB.close();
detailsDB = null; chainDB = null;
} }
} }

View File

@ -44,273 +44,275 @@ public class TestRunner {
public List<String> runTestCase(TestCase testCase) { public List<String> runTestCase(TestCase testCase) {
System.out.println("\nRunning test case: " + testCase.getName()); Repository repository = new RepositoryImpl();
List<String> results = new ArrayList<>();
try {
Repository repository = new RepositoryImpl(); System.out.println("\nRunning test case: " + testCase.getName());
List<String> results = new ArrayList<>();
System.out.println("--------- PRE ---------");
/* 1. Store pre-exist accounts - Pre */ System.out.println("--------- PRE ---------");
for (ByteArrayWrapper key : testCase.getPre().keySet()) { /* 1. Store pre-exist accounts - Pre */
for (ByteArrayWrapper key : testCase.getPre().keySet()) {
AccountState accountState = testCase.getPre().get(key);
AccountState accountState = testCase.getPre().get(key);
repository.createAccount(key.getData());
repository.saveCode(key.getData(), accountState.getCode()); repository.createAccount(key.getData());
repository.addBalance(key.getData(), new BigInteger(accountState.getBalance())); repository.saveCode(key.getData(), accountState.getCode());
repository.addBalance(key.getData(), new BigInteger(accountState.getBalance()));
for (long i = 0; i < accountState.getNonceLong(); ++i)
repository.increaseNonce(key.getData()); for (long i = 0; i < accountState.getNonceLong(); ++i)
} repository.increaseNonce(key.getData());
}
/* 2. Create ProgramInvoke - Env/Exec */
Env env = testCase.getEnv(); /* 2. Create ProgramInvoke - Env/Exec */
Exec exec = testCase.getExec(); Env env = testCase.getEnv();
Exec exec = testCase.getExec();
byte[] address = exec.getAddress();
byte[] origin = exec.getOrigin(); byte[] address = exec.getAddress();
byte[] caller = exec.getCaller(); byte[] origin = exec.getOrigin();
byte[] balance = ByteUtil.bigIntegerToBytes(repository.getBalance(exec.getAddress())); byte[] caller = exec.getCaller();
byte[] gasPrice = exec.getGasPrice(); byte[] balance = ByteUtil.bigIntegerToBytes(repository.getBalance(exec.getAddress()));
byte[] gas = exec.getGas(); byte[] gasPrice = exec.getGasPrice();
byte[] callValue = exec.getValue(); byte[] gas = exec.getGas();
byte[] msgData = exec.getData(); byte[] callValue = exec.getValue();
byte[] lastHash = env.getPreviousHash(); byte[] msgData = exec.getData();
byte[] coinbase = env.getCurrentCoinbase(); byte[] lastHash = env.getPreviousHash();
long timestamp = new BigInteger(env.getCurrentTimestamp()).longValue(); byte[] coinbase = env.getCurrentCoinbase();
long number = new BigInteger(env.getCurrentNumber()).longValue(); long timestamp = new BigInteger(env.getCurrentTimestamp()).longValue();
byte[] difficulty = env.getCurrentDifficlty(); long number = new BigInteger(env.getCurrentNumber()).longValue();
long gaslimit = new BigInteger(env.getCurrentGasLimit()).longValue(); byte[] difficulty = env.getCurrentDifficlty();
long gaslimit = new BigInteger(env.getCurrentGasLimit()).longValue();
// Origin and caller need to exist in order to be able to execute
if(repository.getAccountState(origin) == null) // Origin and caller need to exist in order to be able to execute
repository.createAccount(origin); if(repository.getAccountState(origin) == null)
if(repository.getAccountState(caller) == null) repository.createAccount(origin);
repository.createAccount(caller); if(repository.getAccountState(caller) == null)
repository.createAccount(caller);
ProgramInvoke programInvoke = new ProgramInvokeImpl(address, origin, caller, balance,
gasPrice, gas, callValue, msgData, lastHash, coinbase, ProgramInvoke programInvoke = new ProgramInvokeImpl(address, origin, caller, balance,
timestamp, number, difficulty, gaslimit, repository, true); gasPrice, gas, callValue, msgData, lastHash, coinbase,
timestamp, number, difficulty, gaslimit, repository, true);
/* 3. Create Program - exec.code */
/* 4. run VM */ /* 3. Create Program - exec.code */
VM vm = new VM(); /* 4. run VM */
Program program = new Program(exec.getCode(), programInvoke); VM vm = new VM();
Program program = new Program(exec.getCode(), programInvoke);
try {
System.out.println("-------- EXEC --------"); try {
while(!program.isStopped()) System.out.println("-------- EXEC --------");
vm.step(program); while(!program.isStopped())
} catch (RuntimeException e) { vm.step(program);
program.setRuntimeFailure(e); } catch (RuntimeException e) {
} program.setRuntimeFailure(e);
}
System.out.println("--------- POST --------");
/* 5. Assert Post values */ System.out.println("--------- POST --------");
for (ByteArrayWrapper key : testCase.getPost().keySet()) { /* 5. Assert Post values */
for (ByteArrayWrapper key : testCase.getPost().keySet()) {
AccountState accountState = testCase.getPost().get(key);
AccountState accountState = testCase.getPost().get(key);
long expectedNonce = accountState.getNonceLong();
BigInteger expectedBalance = accountState.getBigIntegerBalance(); long expectedNonce = accountState.getNonceLong();
byte[] expectedCode = accountState.getCode(); BigInteger expectedBalance = accountState.getBigIntegerBalance();
byte[] expectedCode = accountState.getCode();
boolean accountExist = (null != repository.getAccountState(key.getData()));
if (!accountExist) { boolean accountExist = (null != repository.getAccountState(key.getData()));
if (!accountExist) {
String output =
String.format("The expected account does not exist. key: [ %s ]", String output =
Hex.toHexString(key.getData())); String.format("The expected account does not exist. key: [ %s ]",
logger.info(output); Hex.toHexString(key.getData()));
results.add(output); logger.info(output);
continue; results.add(output);
} continue;
}
long actualNonce = repository.getNonce(key.getData()).longValue();
BigInteger actualBalance = repository.getBalance(key.getData()); long actualNonce = repository.getNonce(key.getData()).longValue();
byte[] actualCode = repository.getCode(key.getData()); BigInteger actualBalance = repository.getBalance(key.getData());
if (actualCode == null) actualCode = "".getBytes(); byte[] actualCode = repository.getCode(key.getData());
if (actualCode == null) actualCode = "".getBytes();
if (expectedNonce != actualNonce) {
if (expectedNonce != actualNonce) {
String output =
String.format("The nonce result is different. key: [ %s ], expectedNonce: [ %d ] is actualNonce: [ %d ] ", String output =
Hex.toHexString(key.getData()), expectedNonce, actualNonce); String.format("The nonce result is different. key: [ %s ], expectedNonce: [ %d ] is actualNonce: [ %d ] ",
logger.info(output); Hex.toHexString(key.getData()), expectedNonce, actualNonce);
results.add(output); logger.info(output);
} results.add(output);
}
if (!expectedBalance.equals(actualBalance)) {
if (!expectedBalance.equals(actualBalance)) {
String output =
String.format("The balance result is different. key: [ %s ], expectedBalance: [ %s ] is actualBalance: [ %s ] ", String output =
Hex.toHexString(key.getData()), expectedBalance.toString(), actualBalance.toString()); String.format("The balance result is different. key: [ %s ], expectedBalance: [ %s ] is actualBalance: [ %s ] ",
logger.info(output); Hex.toHexString(key.getData()), expectedBalance.toString(), actualBalance.toString());
results.add(output); logger.info(output);
} results.add(output);
}
if (!Arrays.equals(expectedCode, actualCode)) {
if (!Arrays.equals(expectedCode, actualCode)) {
String output =
String.format("The code result is different. account: [ %s ], expectedCode: [ %s ] is actualCode: [ %s ] ", String output =
Hex.toHexString(key.getData()), String.format("The code result is different. account: [ %s ], expectedCode: [ %s ] is actualCode: [ %s ] ",
Hex.toHexString(expectedCode), Hex.toHexString(key.getData()),
Hex.toHexString(actualCode)); Hex.toHexString(expectedCode),
logger.info(output); Hex.toHexString(actualCode));
results.add(output); logger.info(output);
} results.add(output);
}
// assert storage
Map<ByteArrayWrapper, ByteArrayWrapper> storage = accountState.getStorage(); // assert storage
for (ByteArrayWrapper storageKey : storage.keySet()) { Map<ByteArrayWrapper, ByteArrayWrapper> storage = accountState.getStorage();
for (ByteArrayWrapper storageKey : storage.keySet()) {
byte[] expectedStValue = storage.get(storageKey).getData();
byte[] expectedStValue = storage.get(storageKey).getData();
ContractDetails contractDetails =
program.getResult().getRepository().getContractDetails(accountState.getAddress()); ContractDetails contractDetails =
program.getResult().getRepository().getContractDetails(accountState.getAddress());
if (contractDetails == null) {
if (contractDetails == null) {
String output =
String.format("Storage raw doesn't exist: key [ %s ], expectedValue: [ %s ]", String output =
Hex.toHexString(storageKey.getData()), String.format("Storage raw doesn't exist: key [ %s ], expectedValue: [ %s ]",
Hex.toHexString(expectedStValue) Hex.toHexString(storageKey.getData()),
); Hex.toHexString(expectedStValue)
logger.info(output); );
results.add(output); logger.info(output);
continue; results.add(output);
} continue;
}
Map<DataWord, DataWord> testStorage = contractDetails.getStorage();
DataWord actualValue = testStorage.get(new DataWord(storageKey.getData())); Map<DataWord, DataWord> testStorage = contractDetails.getStorage();
DataWord actualValue = testStorage.get(new DataWord(storageKey.getData()));
if (!Arrays.equals(expectedStValue, actualValue.getNoLeadZeroesData())) {
if (!Arrays.equals(expectedStValue, actualValue.getNoLeadZeroesData())) {
String output =
String.format("Storage value different: key [ %s ], expectedValue: [ %s ], actualValue: [ %s ]", String output =
Hex.toHexString(storageKey.getData()), String.format("Storage value different: key [ %s ], expectedValue: [ %s ], actualValue: [ %s ]",
Hex.toHexString(expectedStValue), Hex.toHexString(storageKey.getData()),
Hex.toHexString(actualValue.getNoLeadZeroesData())); Hex.toHexString(expectedStValue),
logger.info(output); Hex.toHexString(actualValue.getNoLeadZeroesData()));
results.add(output); logger.info(output);
} results.add(output);
} }
} }
}
// TODO: assert that you have no extra accounts in the repository
// TODO: -> basically the deleted by suicide should be deleted // TODO: assert that you have no extra accounts in the repository
// TODO: -> and no unexpected created // TODO: -> basically the deleted by suicide should be deleted
// TODO: -> and no unexpected created
List<org.ethereum.vm.CallCreate> resultCallCreates =
program.getResult().getCallCreateList(); List<org.ethereum.vm.CallCreate> resultCallCreates =
program.getResult().getCallCreateList();
// assert call creates
for (int i = 0; i < testCase.getCallCreateList().size(); ++i) { // assert call creates
for (int i = 0; i < testCase.getCallCreateList().size(); ++i) {
org.ethereum.vm.CallCreate resultCallCreate = null;
if (resultCallCreates != null && resultCallCreates.size() > i) { org.ethereum.vm.CallCreate resultCallCreate = null;
resultCallCreate = resultCallCreates.get(i); if (resultCallCreates != null && resultCallCreates.size() > i) {
} resultCallCreate = resultCallCreates.get(i);
}
CallCreate expectedCallCreate = testCase.getCallCreateList().get(i);
CallCreate expectedCallCreate = testCase.getCallCreateList().get(i);
if (resultCallCreate == null && expectedCallCreate != null) {
if (resultCallCreate == null && expectedCallCreate != null) {
String output =
String.format("Missing call/create invoke: to: [ %s ], data: [ %s ], gas: [ %s ], value: [ %s ]", String output =
Hex.toHexString(expectedCallCreate.getDestination()), String.format("Missing call/create invoke: to: [ %s ], data: [ %s ], gas: [ %s ], value: [ %s ]",
Hex.toHexString(expectedCallCreate.getData()), Hex.toHexString(expectedCallCreate.getDestination()),
Hex.toHexString(expectedCallCreate.getGasLimit()), Hex.toHexString(expectedCallCreate.getData()),
Hex.toHexString(expectedCallCreate.getValue())); Hex.toHexString(expectedCallCreate.getGasLimit()),
logger.info(output); Hex.toHexString(expectedCallCreate.getValue()));
results.add(output); logger.info(output);
results.add(output);
continue;
} continue;
}
boolean assertDestination = Arrays.equals(
expectedCallCreate.getDestination(), boolean assertDestination = Arrays.equals(
resultCallCreate.getDestination()); expectedCallCreate.getDestination(),
if (!assertDestination) { resultCallCreate.getDestination());
if (!assertDestination) {
String output =
String.format("Call/Create destination is different. Expected: [ %s ], result: [ %s ]", String output =
Hex.toHexString(expectedCallCreate.getDestination()), String.format("Call/Create destination is different. Expected: [ %s ], result: [ %s ]",
Hex.toHexString(resultCallCreate.getDestination())); Hex.toHexString(expectedCallCreate.getDestination()),
logger.info(output); Hex.toHexString(resultCallCreate.getDestination()));
results.add(output); logger.info(output);
} results.add(output);
}
boolean assertData = Arrays.equals(
expectedCallCreate.getData(), boolean assertData = Arrays.equals(
resultCallCreate.getData()); expectedCallCreate.getData(),
if (!assertData) { resultCallCreate.getData());
if (!assertData) {
String output =
String.format("Call/Create data is different. Expected: [ %s ], result: [ %s ]", String output =
Hex.toHexString(expectedCallCreate.getData()), String.format("Call/Create data is different. Expected: [ %s ], result: [ %s ]",
Hex.toHexString(resultCallCreate.getData())); Hex.toHexString(expectedCallCreate.getData()),
logger.info(output); Hex.toHexString(resultCallCreate.getData()));
results.add(output); logger.info(output);
} results.add(output);
}
boolean assertGasLimit = Arrays.equals(
expectedCallCreate.getGasLimit(), boolean assertGasLimit = Arrays.equals(
resultCallCreate.getGasLimit()); expectedCallCreate.getGasLimit(),
if (!assertGasLimit) { resultCallCreate.getGasLimit());
String output = if (!assertGasLimit) {
String.format("Call/Create gasLimit is different. Expected: [ %s ], result: [ %s ]", String output =
Hex.toHexString(expectedCallCreate.getGasLimit()), String.format("Call/Create gasLimit is different. Expected: [ %s ], result: [ %s ]",
Hex.toHexString(resultCallCreate.getGasLimit())); Hex.toHexString(expectedCallCreate.getGasLimit()),
logger.info(output); Hex.toHexString(resultCallCreate.getGasLimit()));
results.add(output); logger.info(output);
} results.add(output);
}
boolean assertValue = Arrays.equals(
expectedCallCreate.getValue(), boolean assertValue = Arrays.equals(
resultCallCreate.getValue()); expectedCallCreate.getValue(),
if (!assertValue) { resultCallCreate.getValue());
String output = if (!assertValue) {
String.format("Call/Create value is different. Expected: [ %s ], result: [ %s ]", String output =
Hex.toHexString(expectedCallCreate.getValue()), String.format("Call/Create value is different. Expected: [ %s ], result: [ %s ]",
Hex.toHexString(resultCallCreate.getValue())); Hex.toHexString(expectedCallCreate.getValue()),
logger.info(output); Hex.toHexString(resultCallCreate.getValue()));
results.add(output); logger.info(output);
} results.add(output);
} }
}
// assert out
byte[] expectedHReturn = testCase.getOut(); // assert out
byte[] actualHReturn = ByteUtil.EMPTY_BYTE_ARRAY; byte[] expectedHReturn = testCase.getOut();
if (program.getResult().getHReturn() != null) { byte[] actualHReturn = ByteUtil.EMPTY_BYTE_ARRAY;
actualHReturn = program.getResult().getHReturn().array(); if (program.getResult().getHReturn() != null) {
} actualHReturn = program.getResult().getHReturn().array();
}
if (!Arrays.equals(expectedHReturn, actualHReturn)) {
if (!Arrays.equals(expectedHReturn, actualHReturn)) {
String output =
String.format("HReturn is different. Expected hReturn: [ %s ], actual hReturn: [ %s ]", String output =
Hex.toHexString(expectedHReturn), String.format("HReturn is different. Expected hReturn: [ %s ], actual hReturn: [ %s ]",
Hex.toHexString(actualHReturn)); Hex.toHexString(expectedHReturn),
logger.info(output); Hex.toHexString(actualHReturn));
results.add(output); logger.info(output);
} results.add(output);
}
// assert gas
BigInteger expectedGas = new BigInteger(testCase.getGas()); // assert gas
BigInteger actualGas = new BigInteger(gas).subtract(BigInteger.valueOf(program.getResult().getGasUsed())); BigInteger expectedGas = new BigInteger(testCase.getGas());
BigInteger actualGas = new BigInteger(gas).subtract(BigInteger.valueOf(program.getResult().getGasUsed()));
if (!expectedGas.equals(actualGas)) {
if (!expectedGas.equals(actualGas)) {
String output =
String.format("Gas remaining is different. Expected gas remaining: [ %s ], actual gas remaining: [ %s ]", String output =
expectedGas.toString() , String.format("Gas remaining is different. Expected gas remaining: [ %s ], actual gas remaining: [ %s ]",
actualGas.toString()); expectedGas.toString() ,
logger.info(output); actualGas.toString());
results.add(output); logger.info(output);
} results.add(output);
program.getResult().getRepository().close(); }
return results;
return results; } finally {
repository.close();
}
} }
} }

View File

@ -2,7 +2,6 @@ package org.ethereum.net;
import static org.ethereum.config.SystemProperties.CONFIG; import static org.ethereum.config.SystemProperties.CONFIG;
import org.ethereum.config.SystemProperties;
import org.ethereum.core.Block; import org.ethereum.core.Block;
import org.ethereum.manager.WorldManager; import org.ethereum.manager.WorldManager;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -22,7 +21,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
*/ */
public class BlockQueue { public class BlockQueue {
private static Logger logger = LoggerFactory.getLogger("blockqueue"); private static final Logger logger = LoggerFactory.getLogger("blockqueue");
/** The list of hashes of the heaviest chain on the network, /** The list of hashes of the heaviest chain on the network,
* for which this client doesn't have the blocks yet */ * for which this client doesn't have the blocks yet */

View File

@ -26,7 +26,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
*/ */
public class MessageQueue { public class MessageQueue {
private Logger logger = LoggerFactory.getLogger("net"); private static final Logger logger = LoggerFactory.getLogger("net");
private Queue<MessageRoundtrip> messageQueue = new ConcurrentLinkedQueue<>(); private Queue<MessageRoundtrip> messageQueue = new ConcurrentLinkedQueue<>();
private PeerListener listener; private PeerListener listener;

View File

@ -29,7 +29,7 @@ import static org.ethereum.config.SystemProperties.CONFIG;
*/ */
public class PeerClient { public class PeerClient {
private Logger logger = LoggerFactory.getLogger("wire"); private static final Logger logger = LoggerFactory.getLogger("wire");
private PeerListener peerListener; private PeerListener peerListener;
private P2pHandler p2pHandler; private P2pHandler p2pHandler;

View File

@ -16,7 +16,7 @@ import static java.lang.Thread.sleep;
*/ */
public class TransactionTask implements Callable<Transaction> { public class TransactionTask implements Callable<Transaction> {
private Logger logger = LoggerFactory.getLogger(TransactionTask.class); private static final Logger logger = LoggerFactory.getLogger(TransactionTask.class);
private Transaction tx; private Transaction tx;

View File

@ -17,8 +17,8 @@ import java.util.List;
*/ */
public class MessageDecoder extends ByteToMessageDecoder { public class MessageDecoder extends ByteToMessageDecoder {
private Logger loggerWire = LoggerFactory.getLogger("wire"); private static final Logger loggerWire = LoggerFactory.getLogger("wire");
private Logger loggerNet = LoggerFactory.getLogger("net"); private static final Logger loggerNet = LoggerFactory.getLogger("net");
@Override @Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {

View File

@ -16,8 +16,8 @@ import org.spongycastle.util.encoders.Hex;
*/ */
public class MessageEncoder extends MessageToByteEncoder<Message> { public class MessageEncoder extends MessageToByteEncoder<Message> {
private Logger loggerWire = LoggerFactory.getLogger("wire"); private static final Logger loggerWire = LoggerFactory.getLogger("wire");
private Logger loggerNet = LoggerFactory.getLogger("net"); private static final Logger loggerNet = LoggerFactory.getLogger("net");
@Override @Override

View File

@ -41,7 +41,7 @@ import org.spongycastle.util.encoders.Hex;
*/ */
public class TrieImpl implements Trie { public class TrieImpl implements Trie {
private Logger logger = LoggerFactory.getLogger("trie"); private static final Logger logger = LoggerFactory.getLogger("trie");
private static byte PAIR_SIZE = 2; private static byte PAIR_SIZE = 2;
private static byte LIST_SIZE = 17; private static byte LIST_SIZE = 17;

View File

@ -9,304 +9,305 @@ import java.util.Map;
* - Appendix G. Virtual Machine Specification * - Appendix G. Virtual Machine Specification
*/ */
public enum OpCode { public enum OpCode {
/** Halts execution (0x00) */ /** Halts execution (0x00) */
STOP(0x00), STOP(0x00, 0),
/* Arithmetic Operations */ /* Arithmetic Operations */
/** (0x01) Addition operation */ /** (0x01) Addition operation */
ADD(0x01), ADD(0x01, 2),
/** (0x02) Multiplication operation */ /** (0x02) Multiplication operation */
MUL(0x02), MUL(0x02, 2),
/** (0x03) Subtraction operations */ /** (0x03) Subtraction operations */
SUB(0x03), SUB(0x03, 2),
/** (0x04) Integer division operation */ /** (0x04) Integer division operation */
DIV(0x04), DIV(0x04, 2),
/** (0x05) Signed integer division operation*/ /** (0x05) Signed integer division operation*/
SDIV(0x05), SDIV(0x05, 2),
/** (0x06) Modulo remainder operation */ /** (0x06) Modulo remainder operation */
MOD(0x06), MOD(0x06, 2),
/** (0x07) Signed modulo remainder operation*/ /** (0x07) Signed modulo remainder operation*/
SMOD(0x07), SMOD(0x07, 2),
/** (0x08) Exponential operation */ /** (0x08) Exponential operation */
EXP(0x08), EXP(0x08, 2),
/** (0x09) Negation operation */ /** (0x09) Negation operation */
NEG(0x09), NEG(0x09, 1),
/** (0x0a) Less-than comparison */ /** (0x0a) Less-than comparison */
LT(0X0a), LT(0X0a, 2),
/** (0x0b) Greater-than comparison */ /** (0x0b) Greater-than comparison */
GT(0X0b), GT(0X0b, 2),
/** (0x0c) Signed less-than comparison */ /** (0x0c) Signed less-than comparison */
SLT(0X0c), SLT(0X0c, 2),
/** (0x0d) Signed greater-than comparison */ /** (0x0d) Signed greater-than comparison */
SGT(0X0d), SGT(0X0d, 2),
/** (0x0e) Equality comparison */ /** (0x0e) Equality comparison */
EQ(0X0e), EQ(0X0e, 2),
/** (0x0f) Simple not operator */ /** (0x0f) Simple not operator */
NOT(0X0f), NOT(0X0f, 1),
/* Bitwise Logic Operations */ /* Bitwise Logic Operations */
/** (0x10) Bitwise AND operation */ /** (0x10) Bitwise AND operation */
AND(0x10), AND(0x10, 2),
/** (0x11) Bitwise OR operation */ /** (0x11) Bitwise OR operation */
OR(0x11), OR(0x11, 2),
/** (0x12) Bitwise XOR operation */ /** (0x12) Bitwise XOR operation */
XOR(0x12), XOR(0x12, 2),
/** (0x13) Retrieve single byte from word */ /** (0x13) Retrieve single byte from word */
BYTE(0x13), BYTE(0x13, 2),
/** (0x14) Addition combined with modulo /** (0x14) Addition combined with modulo
* remainder operation */ * remainder operation */
ADDMOD(0x14), ADDMOD(0x14, 3),
/** (0x15) Multiplication combined with modulo /** (0x15) Multiplication combined with modulo
* remainder operation */ * remainder operation */
MULMOD(0x15), MULMOD(0x15, 3),
/* Cryptographic Operations */ /* Cryptographic Operations */
/** (0x20) Compute SHA3-256 hash */ /** (0x20) Compute SHA3-256 hash */
SHA3(0x20), SHA3(0x20, 2),
/* Environmental Information */ /* Environmental Information */
/** (0x30) Get address of currently /** (0x30) Get address of currently
* executing account */ * executing account */
ADDRESS(0x30), ADDRESS(0x30, 0),
/** (0x31) Get balance of the given account */ /** (0x31) Get balance of the given account */
BALANCE(0x31), BALANCE(0x31, 1),
/** (0x32) Get execution origination address*/ /** (0x32) Get execution origination address*/
ORIGIN(0x32), ORIGIN(0x32, 0),
/** (0x33) Get caller address */ /** (0x33) Get caller address */
CALLER(0x33), CALLER(0x33, 0),
/** (0x34) Get deposited value by the /** (0x34) Get deposited value by the
* instruction/transaction responsible * instruction/transaction responsible
* for this execution */ * for this execution */
CALLVALUE(0x34), CALLVALUE(0x34, 0),
/** (0x35) Get input data of current /** (0x35) Get input data of current
* environment */ * environment */
CALLDATALOAD(0x35), CALLDATALOAD(0x35, 1),
/** (0x36) Get size of input data in current /** (0x36) Get size of input data in current
* environment */ * environment */
CALLDATASIZE(0x36), CALLDATASIZE(0x36, 0),
/** (0x37) Copy input data in current /** (0x37) Copy input data in current
* environment to memory */ * environment to memory */
CALLDATACOPY(0x37), CALLDATACOPY(0x37, 3),
/** (0x38) Get size of code running in /** (0x38) Get size of code running in
* current environment */ * current environment */
CODESIZE(0x38), CODESIZE(0x38, 0),
/** (0x39) Copy code running in current /** (0x39) Copy code running in current
* environment to memory */ * environment to memory */
CODECOPY(0x39), // [len code_start mem_start CODECOPY] CODECOPY(0x39, 3), // [len code_start mem_start CODECOPY]
/** (0x3a) Get price of gas in current /** (0x3a) Get price of gas in current
* environment */ * environment */
GASPRICE(0x3a), GASPRICE(0x3a, 0),
/** (0x3b) Get size of code running in /** (0x3b) Get size of code running in
* current environment with given offset */ * current environment with given offset */
EXTCODESIZE(0x3b), EXTCODESIZE(0x3b, 1),
/** (0x3c) Copy code running in current /** (0x3c) Copy code running in current
* environment to memory with given offset */ * environment to memory with given offset */
EXTCODECOPY(0x3c), EXTCODECOPY(0x3c, 4),
/* Block Information */ /* Block Information */
/** (0x40) Get hash of most recent /** (0x40) Get hash of most recent
* complete block */ * complete block */
PREVHASH(0x40), PREVHASH(0x40, 0),
/** (0x41) Get the blocks coinbase address */ /** (0x41) Get the blocks coinbase address */
COINBASE(0x41), COINBASE(0x41, 0),
/** (x042) Get the blocks timestamp */ /** (x042) Get the blocks timestamp */
TIMESTAMP(0x42), TIMESTAMP(0x42, 0),
/** (0x43) Get the blocks number */ /** (0x43) Get the blocks number */
NUMBER(0x43), NUMBER(0x43, 0),
/** (0x44) Get the blocks difficulty */ /** (0x44) Get the blocks difficulty */
DIFFICULTY(0x44), DIFFICULTY(0x44, 0),
/** (0x45) Get the blocks gas limit */ /** (0x45) Get the blocks gas limit */
GASLIMIT(0x45), GASLIMIT(0x45, 0),
/* Memory, Storage and Flow Operations */ /* Memory, Storage and Flow Operations */
/** (0x50) Remove item from stack */ /** (0x50) Remove item from stack */
POP(0x50), POP(0x50, 1),
/** (0x53) Load word from memory */ /** (0x53) Load word from memory */
MLOAD(0x53), MLOAD(0x53, 1),
/** (0x54) Save word to memory */ /** (0x54) Save word to memory */
MSTORE(0x54), MSTORE(0x54, 2),
/** (0x55) Save byte to memory */ /** (0x55) Save byte to memory */
MSTORE8(0x55), MSTORE8(0x55, 2),
/** (0x56) Load word from storage */ /** (0x56) Load word from storage */
SLOAD(0x56), SLOAD(0x56, 1),
/** (0x57) Save word to storage */ /** (0x57) Save word to storage */
SSTORE(0x57), SSTORE(0x57, 2),
/** (0x58) Alter the program counter */ /** (0x58) Alter the program counter */
JUMP(0x58), JUMP(0x58, 1),
/** (0x59) Conditionally alter the program /** (0x59) Conditionally alter the program
* counter */ * counter */
JUMPI(0x59), JUMPI(0x59, 2),
/** (0x5a) Get the program counter */ /** (0x5a) Get the program counter */
PC(0x5a), PC(0x5a, 0),
/** (0x5b) Get the size of active memory */ /** (0x5b) Get the size of active memory */
MSIZE(0x5b), MSIZE(0x5b, 0),
/** (0x5c) Get the amount of available gas */ /** (0x5c) Get the amount of available gas */
GAS(0x5c), GAS(0x5c, 0),
/** (0x5d) */ /** (0x5d) */
JUMPDEST(0x5d), JUMPDEST(0x5d, 0),
/* Push Operations */ /* Push Operations */
/** (0x60) Place 1-byte item on stack */ /** (0x60) Place 1-byte item on stack */
PUSH1(0x60), PUSH1(0x60, 0),
/** (0x61) Place 2-byte item on stack */ /** (0x61) Place 2-byte item on stack */
PUSH2(0x61), PUSH2(0x61, 0),
/** (0x62) Place 3-byte item on stack */ /** (0x62) Place 3-byte item on stack */
PUSH3(0x62), PUSH3(0x62, 0),
/** (0x63) Place 4-byte item on stack */ /** (0x63) Place 4-byte item on stack */
PUSH4(0x63), PUSH4(0x63, 0),
/** (0x64) Place 5-byte item on stack */ /** (0x64) Place 5-byte item on stack */
PUSH5(0x64), PUSH5(0x64, 0),
/** (0x65) Place 6-byte item on stack */ /** (0x65) Place 6-byte item on stack */
PUSH6(0x65), PUSH6(0x65, 0),
/** (0x66) Place 7-byte item on stack */ /** (0x66) Place 7-byte item on stack */
PUSH7(0x66), PUSH7(0x66, 0),
/** (0x67) Place 8-byte item on stack */ /** (0x67) Place 8-byte item on stack */
PUSH8(0x67), PUSH8(0x67, 0),
/** (0x68) Place 9-byte item on stack */ /** (0x68) Place 9-byte item on stack */
PUSH9(0x68), PUSH9(0x68, 0),
/** (0x69) Place 10-byte item on stack */ /** (0x69) Place 10-byte item on stack */
PUSH10(0x69), PUSH10(0x69, 0),
/** (0x6a) Place 11-byte item on stack */ /** (0x6a) Place 11-byte item on stack */
PUSH11(0x6a), PUSH11(0x6a, 0),
/** (0x6b) Place 12-byte item on stack */ /** (0x6b) Place 12-byte item on stack */
PUSH12(0x6b), PUSH12(0x6b, 0),
/** (0x6c) Place 13-byte item on stack */ /** (0x6c) Place 13-byte item on stack */
PUSH13(0x6c), PUSH13(0x6c, 0),
/** (0x6d) Place 14-byte item on stack */ /** (0x6d) Place 14-byte item on stack */
PUSH14(0x6d), PUSH14(0x6d, 0),
/** (0x6e) Place 15-byte item on stack */ /** (0x6e) Place 15-byte item on stack */
PUSH15(0x6e), PUSH15(0x6e, 0),
/** (0x6f) Place 16-byte item on stack */ /** (0x6f) Place 16-byte item on stack */
PUSH16(0x6f), PUSH16(0x6f, 0),
/** (0x70) Place 17-byte item on stack */ /** (0x70) Place 17-byte item on stack */
PUSH17(0x70), PUSH17(0x70, 0),
/** (0x71) Place 18-byte item on stack */ /** (0x71) Place 18-byte item on stack */
PUSH18(0x71), PUSH18(0x71, 0),
/** (0x72) Place 19-byte item on stack */ /** (0x72) Place 19-byte item on stack */
PUSH19(0x72), PUSH19(0x72, 0),
/** (0x73) Place 20-byte item on stack */ /** (0x73) Place 20-byte item on stack */
PUSH20(0x73), PUSH20(0x73, 0),
/** (0x74) Place 21-byte item on stack */ /** (0x74) Place 21-byte item on stack */
PUSH21(0x74), PUSH21(0x74, 0),
/** (0x75) Place 22-byte item on stack */ /** (0x75) Place 22-byte item on stack */
PUSH22(0x75), PUSH22(0x75, 0),
/** (0x76) Place 23-byte item on stack */ /** (0x76) Place 23-byte item on stack */
PUSH23(0x76), PUSH23(0x76, 0),
/** (0x77) Place 24-byte item on stack */ /** (0x77) Place 24-byte item on stack */
PUSH24(0x77), PUSH24(0x77, 0),
/** (0x78) Place 25-byte item on stack */ /** (0x78) Place 25-byte item on stack */
PUSH25(0x78), PUSH25(0x78, 0),
/** (0x79) Place 26-byte item on stack */ /** (0x79) Place 26-byte item on stack */
PUSH26(0x79), PUSH26(0x79, 0),
/** (0x7a) Place 27-byte item on stack */ /** (0x7a) Place 27-byte item on stack */
PUSH27(0x7a), PUSH27(0x7a, 0),
/** (0x7b) Place 28-byte item on stack */ /** (0x7b) Place 28-byte item on stack */
PUSH28(0x7b), PUSH28(0x7b, 0),
/** (0x7c) Place 29-byte item on stack */ /** (0x7c) Place 29-byte item on stack */
PUSH29(0x7c), PUSH29(0x7c, 0),
/** (0x7d) Place 30-byte item on stack */ /** (0x7d) Place 30-byte item on stack */
PUSH30(0x7d), PUSH30(0x7d, 0),
/** (0x7e) Place 31-byte item on stack */ /** (0x7e) Place 31-byte item on stack */
PUSH31(0x7e), PUSH31(0x7e, 0),
/** (0x7f) Place 32-byte (full word) /** (0x7f) Place 32-byte (full word)
* item on stack */ * item on stack */
PUSH32(0x7f), PUSH32(0x7f, 0),
/* Duplicate Nth item from the stack */ /* Duplicate Nth item from the stack */
/** (0x80) Duplicate 1st item on stack */ /** (0x80) Duplicate 1st item on stack */
DUP1(0x80), DUP1(0x80, 1),
/** (0x81) Duplicate 2nd item on stack */ /** (0x81) Duplicate 2nd item on stack */
DUP2(0x81), DUP2(0x81, 2),
/** (0x82) Duplicate 3rd item on stack */ /** (0x82) Duplicate 3rd item on stack */
DUP3(0x82), DUP3(0x82, 3),
/** (0x83) Duplicate 4th item on stack */ /** (0x83) Duplicate 4th item on stack */
DUP4(0x83), DUP4(0x83, 4),
/** (0x84) Duplicate 5th item on stack */ /** (0x84) Duplicate 5th item on stack */
DUP5(0x84), DUP5(0x84, 5),
/** (0x85) Duplicate 6th item on stack */ /** (0x85) Duplicate 6th item on stack */
DUP6(0x85), DUP6(0x85, 6),
/** (0x86) Duplicate 7th item on stack */ /** (0x86) Duplicate 7th item on stack */
DUP7(0x86), DUP7(0x86, 7),
/** (0x87) Duplicate 8th item on stack */ /** (0x87) Duplicate 8th item on stack */
DUP8(0x87), DUP8(0x87, 8),
/** (0x88) Duplicate 9th item on stack */ /** (0x88) Duplicate 9th item on stack */
DUP9(0x88), DUP9(0x88, 9),
/** (0x89) Duplicate 10th item on stack */ /** (0x89) Duplicate 10th item on stack */
DUP10(0x89), DUP10(0x89, 10),
/** (0x8a) Duplicate 11th item on stack */ /** (0x8a) Duplicate 11th item on stack */
DUP11(0x8a), DUP11(0x8a, 11),
/** (0x8b) Duplicate 12th item on stack */ /** (0x8b) Duplicate 12th item on stack */
DUP12(0x8b), DUP12(0x8b, 12),
/** (0x8c) Duplicate 13th item on stack */ /** (0x8c) Duplicate 13th item on stack */
DUP13(0x8c), DUP13(0x8c, 13),
/** (0x8d) Duplicate 14th item on stack */ /** (0x8d) Duplicate 14th item on stack */
DUP14(0x8d), DUP14(0x8d, 14),
/** (0x8e) Duplicate 15th item on stack */ /** (0x8e) Duplicate 15th item on stack */
DUP15(0x8e), DUP15(0x8e, 15),
/** (0x8f) Duplicate 16th item on stack */ /** (0x8f) Duplicate 16th item on stack */
DUP16(0x8f), DUP16(0x8f, 16),
/* Swap the Nth item from the stack with the top */ /* Swap the Nth item from the stack with the top */
/** (0x90) Exchange 2nd item from stack with the top */ /** (0x90) Exchange 2nd item from stack with the top */
SWAP1(0x90), SWAP1(0x90, 2),
/** (0x91) Exchange 3rd item from stack with the top */ /** (0x91) Exchange 3rd item from stack with the top */
SWAP2(0x91), SWAP2(0x91, 3),
/** (0x92) Exchange 4th item from stack with the top */ /** (0x92) Exchange 4th item from stack with the top */
SWAP3(0x92), SWAP3(0x92, 4),
/** (0x93) Exchange 5th item from stack with the top */ /** (0x93) Exchange 5th item from stack with the top */
SWAP4(0x93), SWAP4(0x93, 5),
/** (0x94) Exchange 6th item from stack with the top */ /** (0x94) Exchange 6th item from stack with the top */
SWAP5(0x94), SWAP5(0x94, 6),
/** (0x95) Exchange 7th item from stack with the top */ /** (0x95) Exchange 7th item from stack with the top */
SWAP6(0x95), SWAP6(0x95, 7),
/** (0x96) Exchange 8th item from stack with the top */ /** (0x96) Exchange 8th item from stack with the top */
SWAP7(0x96), SWAP7(0x96, 8),
/** (0x97) Exchange 9th item from stack with the top */ /** (0x97) Exchange 9th item from stack with the top */
SWAP8(0x97), SWAP8(0x97, 9),
/** (0x98) Exchange 10th item from stack with the top */ /** (0x98) Exchange 10th item from stack with the top */
SWAP9(0x98), SWAP9(0x98, 10),
/** (0x99) Exchange 11th item from stack with the top */ /** (0x99) Exchange 11th item from stack with the top */
SWAP10(0x99), SWAP10(0x99, 11),
/** (0x9a) Exchange 12th item from stack with the top */ /** (0x9a) Exchange 12th item from stack with the top */
SWAP11(0x9a), SWAP11(0x9a, 12),
/** (0x9b) Exchange 13th item from stack with the top */ /** (0x9b) Exchange 13th item from stack with the top */
SWAP12(0x9b), SWAP12(0x9b, 13),
/** (0x9c) Exchange 14th item from stack with the top */ /** (0x9c) Exchange 14th item from stack with the top */
SWAP13(0x9c), SWAP13(0x9c, 14),
/** (0x9d) Exchange 15th item from stack with the top */ /** (0x9d) Exchange 15th item from stack with the top */
SWAP14(0x9d), SWAP14(0x9d, 15),
/** (0x9e) Exchange 16th item from stack with the top */ /** (0x9e) Exchange 16th item from stack with the top */
SWAP15(0x9e), SWAP15(0x9e, 16),
/** (0x9f) Exchange 17th item from stack with the top */ /** (0x9f) Exchange 17th item from stack with the top */
SWAP16(0x9f), SWAP16(0x9f, 17),
/* System operations */ /* System operations */
/** (0xf0) Create a new account with associated code */ /** (0xf0) Create a new account with associated code */
CREATE(0xf0), // [in_size] [in_offs] [gas_val] CREATE CREATE(0xf0, 3), // [in_size] [in_offs] [gas_val] CREATE
/** (cxf1) Message-call into an account */ /** (cxf1) Message-call into an account */
CALL(0xf1), // [out_data_size] [out_data_start] [in_data_size] [in_data_start] [value] [to_addr] [gas] CALL CALL(0xf1, 7), // [out_data_size] [out_data_start] [in_data_size] [in_data_start] [value] [to_addr] [gas] CALL
/** (0xf2) Halt execution returning output data */ /** (0xf2) Halt execution returning output data */
RETURN(0xf2), RETURN(0xf2, 2),
/** (0xf3) Calls self, but grabbing the code from the /** (0xf3) Calls self, but grabbing the code from the
* TO argument instead of from one's own address */ * TO argument instead of from one's own address */
CALLCODE(0xf3), CALLCODE(0xf3, 7),
/** (0xff) Halt execution and register account for /** (0xff) Halt execution and register account for
* later deletion */ * later deletion */
SUICIDE(0xff); SUICIDE(0xff, 1);
private byte opcode; private byte opcode;
private int require;
private static final Map<Byte, OpCode> intToTypeMap = new HashMap<>(); private static final Map<Byte, OpCode> intToTypeMap = new HashMap<>();
private static final Map<String, Byte> stringToByteMap = new HashMap<>(); private static final Map<String, Byte> stringToByteMap = new HashMap<>();
@ -318,13 +319,23 @@ public enum OpCode {
} }
} }
private OpCode(int op) { private OpCode(int op, int require) {
this.opcode = (byte) op; this.opcode = (byte) op;
this.require = require;
} }
public byte val() { public byte val() {
return opcode; return opcode;
} }
/**
* Returns the mininum amount of items required on the stack for this operation
*
* @return minimum amount of expected items on the stack
*/
public int require() {
return require;
}
public int asInt() { public int asInt() {
return opcode; return opcode;

View File

@ -24,8 +24,9 @@ import java.util.Stack;
*/ */
public class Program { public class Program {
private Logger logger = LoggerFactory.getLogger("VM"); private static final Logger logger = LoggerFactory.getLogger("VM");
private Logger gasLogger = LoggerFactory.getLogger("gas"); private static final Logger gasLogger = LoggerFactory.getLogger("gas");
private int invokeHash; private int invokeHash;
private ProgramListener listener; private ProgramListener listener;
@ -55,6 +56,12 @@ public class Program {
} }
} }
public byte getOp(int pc) {
if (ops.length <= pc)
return 0;
return ops[pc];
}
public byte getCurrentOp() { public byte getCurrentOp() {
if(ops.length == 0) if(ops.length == 0)
return 0; return 0;
@ -93,9 +100,12 @@ public class Program {
} }
public void setPC(DataWord pc) { public void setPC(DataWord pc) {
this.setPC(pc.intValue());
}
this.pc = pc.intValue(); public void setPC(int pc) {
this.pc = pc;
if (this.pc == ops.length) if (this.pc == ops.length)
stop(); stop();
@ -105,10 +115,6 @@ public class Program {
} }
} }
public void setPC(int pc) {
this.pc = pc;
}
public boolean isStopped() { public boolean isStopped() {
return stopped; return stopped;
} }
@ -130,7 +136,7 @@ public class Program {
if (pc + n > ops.length) { if (pc + n > ops.length) {
stop(); stop();
throw new RuntimeException("pc overflow sweep n: " + n + " pc: " + pc); throw new PcOverflowException("pc overflow sweep n: " + n + " pc: " + pc);
} }
byte[] data = Arrays.copyOfRange(ops, pc, pc + n); byte[] data = Arrays.copyOfRange(ops, pc, pc + n);
@ -257,12 +263,12 @@ public class Program {
public void createContract(DataWord value, DataWord memStart, DataWord memSize) { public void createContract(DataWord value, DataWord memStart, DataWord memSize) {
// [1] FETCH THE CODE FROM THE MEMORY // [1] FETCH THE CODE FROM THE MEMORY
ByteBuffer programCode = memoryChunk(memStart, memSize); byte[] programCode = memoryChunk(memStart, memSize).array();
byte[] senderAddress = this.getOwnerAddress().getLast20Bytes(); byte[] senderAddress = this.getOwnerAddress().getLast20Bytes();
if (logger.isInfoEnabled()) if (logger.isInfoEnabled())
logger.info("creating a new contract inside contract run: [{}]", Hex.toHexString(senderAddress)); logger.info("creating a new contract inside contract run: [{}]", Hex.toHexString(senderAddress));
// actual gas subtract // actual gas subtract
DataWord gasLimit = this.getGas(); DataWord gasLimit = this.getGas();
this.spendGas(gasLimit.longValue(), "internal call"); this.spendGas(gasLimit.longValue(), "internal call");
@ -272,16 +278,12 @@ public class Program {
byte[] newAddress = HashUtil.calcNewAddr(this.getOwnerAddress().getLast20Bytes(), nonce); byte[] newAddress = HashUtil.calcNewAddr(this.getOwnerAddress().getLast20Bytes(), nonce);
result.getRepository().createAccount(newAddress); result.getRepository().createAccount(newAddress);
// [3] UPDATE THE NONCE if (invokeData.byTestingSuite()) {
// (THIS STAGE IS NOT REVERTED BY ANY EXCEPTION) // This keeps track of the contracts created for a test
result.getRepository().increaseNonce(senderAddress); this.getResult().addCallCreate(programCode, newAddress,
gasLimit.getNoLeadZeroesData(),
if (invokeData.byTestingSuite()) { value.getNoLeadZeroesData());
// This keeps track of the contracts created for a test }
this.getResult().addCallCreate(programCode.array(), newAddress,
gasLimit.getNoLeadZeroesData(),
value.getNoLeadZeroesData());
}
// [4] TRANSFER THE BALANCE // [4] TRANSFER THE BALANCE
BigInteger endowment = value.value(); BigInteger endowment = value.value();
@ -291,23 +293,32 @@ public class Program {
return; return;
} }
result.getRepository().addBalance(senderAddress, endowment.negate()); result.getRepository().addBalance(senderAddress, endowment.negate());
result.getRepository().addBalance(newAddress, endowment); BigInteger newBalance = result.getRepository().addBalance(newAddress, endowment);
Repository trackRepository = result.getRepository().getTrack(); Repository trackRepository = result.getRepository().getTrack();
trackRepository.startTracking(); trackRepository.startTracking();
// [3] UPDATE THE NONCE
// (THIS STAGE IS NOT REVERTED BY ANY EXCEPTION)
trackRepository.increaseNonce(senderAddress);
// [5] COOK THE INVOKE AND EXECUTE // [5] COOK THE INVOKE AND EXECUTE
ProgramInvoke programInvoke = ProgramInvoke programInvoke = ProgramInvokeFactory.createProgramInvoke(
ProgramInvokeFactory.createProgramInvoke(this, new DataWord(newAddress), DataWord.ZERO, this, new DataWord(newAddress), DataWord.ZERO, gasLimit,
gasLimit, BigInteger.ZERO, null, trackRepository, this.invokeData.getCallDeep() + 1); newBalance, null, trackRepository);
VM vm = new VM(); ProgramResult result = null;
Program program = new Program(programCode.array(), programInvoke);
vm.play(program); if (programCode != null && programCode.length != 0) {
ProgramResult result = program.getResult(); VM vm = new VM();
this.result.addDeleteAccounts(result.getDeleteAccounts()); Program program = new Program(programCode, programInvoke);
vm.play(program);
if (result.getException() != null && result = program.getResult();
this.result.addDeleteAccounts(result.getDeleteAccounts());
}
if (result != null &&
result.getException() != null &&
result.getException() instanceof Program.OutOfGasException) { result.getException() instanceof Program.OutOfGasException) {
logger.info("contract run halted by OutOfGas: new contract init ={}" , Hex.toHexString(newAddress)); logger.info("contract run halted by OutOfGas: new contract init ={}" , Hex.toHexString(newAddress));
@ -319,17 +330,18 @@ public class Program {
// 4. CREATE THE CONTRACT OUT OF RETURN // 4. CREATE THE CONTRACT OUT OF RETURN
byte[] code = result.getHReturn().array(); byte[] code = result.getHReturn().array();
trackRepository.saveCode(newAddress, code); trackRepository.saveCode(newAddress, code);
trackRepository.commit();
// IN SUCCESS PUSH THE ADDRESS INTO THE STACK // IN SUCCESS PUSH THE ADDRESS INTO THE STACK
stackPush(new DataWord(newAddress)); stackPush(new DataWord(newAddress));
trackRepository.commit();
// 5. REFUND THE REMAIN GAS // 5. REFUND THE REMAIN GAS
long refundGas = gasLimit.longValue() - result.getGasUsed(); long refundGas = gasLimit.longValue() - result.getGasUsed();
if (refundGas > 0) { if (refundGas > 0) {
this.refundGas(refundGas, "remain gas from the internal call"); this.refundGas(refundGas, "remain gas from the internal call");
if (logger.isInfoEnabled()) { if (gasLogger.isInfoEnabled()) {
logger.info("The remaining gas is refunded, account: [{}], gas: [{}] ", gasLogger.info("The remaining gas is refunded, account: [{}], gas: [{}] ",
Hex.toHexString(this.getOwnerAddress().getLast20Bytes()), Hex.toHexString(this.getOwnerAddress().getLast20Bytes()),
refundGas); refundGas);
} }
@ -346,7 +358,7 @@ public class Program {
*/ */
public void callToAddress(MessageCall msg) { public void callToAddress(MessageCall msg) {
ByteBuffer data = memoryChunk(msg.getInDataOffs(), msg.getInDataSize()); byte[] data = memoryChunk(msg.getInDataOffs(), msg.getInDataSize()).array();
// FETCH THE SAVED STORAGE // FETCH THE SAVED STORAGE
byte[] codeAddress = msg.getCodeAddress().getLast20Bytes(); byte[] codeAddress = msg.getCodeAddress().getLast20Bytes();
@ -363,12 +375,12 @@ public class Program {
// 2.1 PERFORM THE GAS VALUE TX // 2.1 PERFORM THE GAS VALUE TX
// (THIS STAGE IS NOT REVERTED BY ANY EXCEPTION) // (THIS STAGE IS NOT REVERTED BY ANY EXCEPTION)
if (this.getGas().longValue() - msg.getGas().longValue() < 0 ) { if (this.getGas().longValue() - msg.getGas().longValue() < 0 ) {
logger.info("No gas for the internal call, \n" + gasLogger.info("No gas for the internal call, \n" +
"fromAddress={}, codeAddress={}", "fromAddress={}, codeAddress={}",
Hex.toHexString(senderAddress), Hex.toHexString(codeAddress)); Hex.toHexString(senderAddress), Hex.toHexString(codeAddress));
throw new OutOfGasException(); throw new OutOfGasException();
} }
BigInteger endowment = msg.getEndowment().value(); BigInteger endowment = msg.getEndowment().value();
BigInteger senderBalance = result.getRepository().getBalance(senderAddress); BigInteger senderBalance = result.getRepository().getBalance(senderAddress);
if (senderBalance.compareTo(endowment) < 0) { if (senderBalance.compareTo(endowment) < 0) {
@ -377,11 +389,10 @@ public class Program {
} }
result.getRepository().addBalance(senderAddress, endowment.negate()); result.getRepository().addBalance(senderAddress, endowment.negate());
BigInteger contextBalance = result.getRepository().addBalance(contextAddress, endowment); BigInteger contextBalance = result.getRepository().addBalance(contextAddress, endowment);
if (invokeData.byTestingSuite()) { if (invokeData.byTestingSuite()) {
// This keeps track of the calls created for a test // This keeps track of the calls created for a test
this.getResult().addCallCreate(data.array(), this.getResult().addCallCreate(data, contextAddress,
contextAddress,
msg.getGas().getNoLeadZeroesData(), msg.getGas().getNoLeadZeroesData(),
msg.getEndowment().getNoLeadZeroesData()); msg.getEndowment().getNoLeadZeroesData());
} }
@ -393,9 +404,8 @@ public class Program {
trackRepository.startTracking(); trackRepository.startTracking();
ProgramInvoke programInvoke = ProgramInvokeFactory.createProgramInvoke( ProgramInvoke programInvoke = ProgramInvokeFactory.createProgramInvoke(
this, new DataWord(contextAddress), msg.getEndowment(), msg.getGas(), this, new DataWord(contextAddress), msg.getEndowment(),
contextBalance, data.array(), trackRepository, msg.getGas(), contextBalance, data, trackRepository);
this.invokeData.getCallDeep() + 1);
ProgramResult result = null; ProgramResult result = null;
@ -410,7 +420,7 @@ public class Program {
if (result != null && if (result != null &&
result.getException() != null && result.getException() != null &&
result.getException() instanceof Program.OutOfGasException) { result.getException() instanceof Program.OutOfGasException) {
logger.info("contract run halted by OutOfGas: contract={}" , Hex.toHexString(contextAddress)); gasLogger.info("contract run halted by OutOfGas: contract={}" , Hex.toHexString(contextAddress));
trackRepository.rollback(); trackRepository.rollback();
stackPushZero(); stackPushZero();
@ -438,10 +448,12 @@ public class Program {
// 5. REFUND THE REMAIN GAS // 5. REFUND THE REMAIN GAS
if (result != null) { if (result != null) {
BigInteger refundGas = msg.getGas().value().subtract(BigInteger.valueOf(result.getGasUsed())); BigInteger refundGas = msg.getGas().value().subtract(BigInteger.valueOf(result.getGasUsed()));
if (refundGas.compareTo(BigInteger.ZERO) == 1) { if (refundGas.signum() == 1) {
this.refundGas(refundGas.longValue(), "remaining gas from the internal call"); this.refundGas(refundGas.longValue(), "remaining gas from the internal call");
logger.info("The remaining gas refunded, account: [{}], gas: [{}] ", if(gasLogger.isInfoEnabled())
Hex.toHexString(senderAddress), refundGas.toString()); gasLogger.info("The remaining gas refunded, account: [{}], gas: [{}] ",
Hex.toHexString(senderAddress),
refundGas.toString());
} }
} else { } else {
this.refundGas(msg.getGas().longValue(), "remaining gas from the internal call"); this.refundGas(msg.getGas().longValue(), "remaining gas from the internal call");

View File

@ -4,6 +4,7 @@ import org.ethereum.core.Block;
import org.ethereum.core.Transaction; import org.ethereum.core.Transaction;
import org.ethereum.facade.Repository; import org.ethereum.facade.Repository;
import org.ethereum.manager.WorldManager; import org.ethereum.manager.WorldManager;
import org.ethereum.util.ByteUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.spongycastle.util.encoders.Hex; import org.spongycastle.util.encoders.Hex;
@ -18,8 +19,16 @@ import java.math.BigInteger;
*/ */
public class ProgramInvokeFactory { public class ProgramInvokeFactory {
private static Logger logger = LoggerFactory.getLogger("VM"); private static final Logger logger = LoggerFactory.getLogger("VM");
/**
* This attribute defines the number of resursive calls allowed in the EVM
* Note: For the JVM to reach this level without a StackOverflow exception,
* ethereumj may need to be started with a JVM argument to increase
* the stack size. For example: -Xss10m
*/
private static final int MAX_CREATE_CALL_DEPTH = 1024;
// Invocation by the wire tx // Invocation by the wire tx
public static ProgramInvoke createProgramInvoke(Transaction tx, Block block, Repository repository) { public static ProgramInvoke createProgramInvoke(Transaction tx, Block block, Repository repository) {
@ -28,7 +37,7 @@ public class ProgramInvokeFactory {
/*** ADDRESS op ***/ /*** ADDRESS op ***/
// YP: Get address of currently executing account. // YP: Get address of currently executing account.
byte[] address = (tx.isContractCreation())? tx.getContractAddress(): tx.getReceiveAddress(); byte[] address = tx.isContractCreation() ? tx.getContractAddress(): tx.getReceiveAddress();
/*** ORIGIN op ***/ /*** ORIGIN op ***/
// YP: This is the sender of original transaction; it is never a contract. // YP: This is the sender of original transaction; it is never a contract.
@ -53,8 +62,7 @@ public class ProgramInvokeFactory {
/*** CALLDATALOAD op ***/ /*** CALLDATALOAD op ***/
/*** CALLDATACOPY op ***/ /*** CALLDATACOPY op ***/
/*** CALLDATASIZE op ***/ /*** CALLDATASIZE op ***/
byte[] data = tx.getData(); byte[] data = tx.getData() == null ? ByteUtil.EMPTY_BYTE_ARRAY : tx.getData();
if (data == null) data = new byte[]{};
/*** PREVHASH op ***/ /*** PREVHASH op ***/
byte[] lastHash = lastBlock.getHash(); byte[] lastHash = lastBlock.getHash();
@ -122,7 +130,7 @@ public class ProgramInvokeFactory {
public static ProgramInvoke createProgramInvoke(Program program, DataWord toAddress, public static ProgramInvoke createProgramInvoke(Program program, DataWord toAddress,
DataWord inValue, DataWord inGas, DataWord inValue, DataWord inGas,
BigInteger balanceInt, byte[] dataIn, BigInteger balanceInt, byte[] dataIn,
Repository repository, int callDeep) { Repository repository) {
DataWord address = toAddress; DataWord address = toAddress;
DataWord origin = program.getOriginAddress(); DataWord origin = program.getOriginAddress();
@ -174,9 +182,14 @@ public class ProgramInvokeFactory {
Hex.toHexString(difficulty.getNoLeadZeroesData()), Hex.toHexString(difficulty.getNoLeadZeroesData()),
gasLimit.longValue()); gasLimit.longValue());
} }
int newCallDepth = program.invokeData.getCallDeep() + 1;
if (newCallDepth >= MAX_CREATE_CALL_DEPTH) {
throw program.new OutOfGasException();
}
return new ProgramInvokeImpl(address, origin, caller, balance, gasPrice, gas, callValue, return new ProgramInvokeImpl(address, origin, caller, balance, gasPrice, gas, callValue,
data, lastHash, coinbase, timestamp, number, difficulty, gasLimit, data, lastHash, coinbase, timestamp, number, difficulty, gasLimit,
repository, callDeep); repository, newCallDepth);
} }
} }

View File

@ -63,23 +63,16 @@ public class ProgramResult {
this.repository = repository; this.repository = repository;
} }
public void addDeleteAccount(DataWord address){ public void addDeleteAccount(DataWord address) {
if (deleteAccounts == null)
if (deleteAccounts == null){
deleteAccounts = new ArrayList<>(); deleteAccounts = new ArrayList<>();
}
deleteAccounts.add(address); deleteAccounts.add(address);
} }
public void addDeleteAccounts(List<DataWord> accounts){ public void addDeleteAccounts(List<DataWord> accounts) {
if (accounts == null) return; if (accounts == null) return;
if (deleteAccounts == null)
if (deleteAccounts == null){
deleteAccounts = new ArrayList<>(); deleteAccounts = new ArrayList<>();
}
deleteAccounts.addAll(accounts); deleteAccounts.addAll(accounts);
} }

View File

@ -62,8 +62,8 @@ import static org.ethereum.vm.OpCode.PUSH1;
*/ */
public class VM { public class VM {
private Logger logger = LoggerFactory.getLogger("VM"); private static final Logger logger = LoggerFactory.getLogger("VM");
private Logger dumpLogger = LoggerFactory.getLogger("dump"); private static final Logger dumpLogger = LoggerFactory.getLogger("dump");
private static BigInteger _32_ = BigInteger.valueOf(32); private static BigInteger _32_ = BigInteger.valueOf(32);
private static String logString = "[{}]\t Op: [{}] Gas: [{}] Deep: [{}] Hint: [{}]"; private static String logString = "[{}]\t Op: [{}] Gas: [{}] Deep: [{}] Hint: [{}]";
@ -94,6 +94,8 @@ public class VM {
long gasBefore = program.getGas().longValue(); long gasBefore = program.getGas().longValue();
int stepBefore = program.getPC(); int stepBefore = program.getPC();
program.stackRequire(op.require());
// Calculate fees and spend gas // Calculate fees and spend gas
switch (op) { switch (op) {
case STOP: case SUICIDE: case STOP: case SUICIDE:
@ -101,7 +103,6 @@ public class VM {
gasCost = GasCost.STOP; gasCost = GasCost.STOP;
break; break;
case SSTORE: case SSTORE:
program.stackRequire(2);
DataWord newValue = stack.get(stack.size()-2); DataWord newValue = stack.get(stack.size()-2);
DataWord oldValue = program.storageLoad(stack.peek()); DataWord oldValue = program.storageLoad(stack.peek());
if (oldValue == null && !newValue.isZero()) if (oldValue == null && !newValue.isZero())
@ -120,40 +121,31 @@ public class VM {
// These all operate on memory and therefore potentially expand it: // These all operate on memory and therefore potentially expand it:
case MSTORE: case MSTORE:
program.stackRequire(2);
newMemSize = memNeeded(stack.peek(), new DataWord(32)); newMemSize = memNeeded(stack.peek(), new DataWord(32));
break; break;
case MSTORE8: case MSTORE8:
program.stackRequire(2);
newMemSize = memNeeded(stack.peek(), new DataWord(1)); newMemSize = memNeeded(stack.peek(), new DataWord(1));
break; break;
case MLOAD: case MLOAD:
program.stackRequire(1);
newMemSize = memNeeded(stack.peek(), new DataWord(32)); newMemSize = memNeeded(stack.peek(), new DataWord(32));
break; break;
case RETURN: case RETURN:
program.stackRequire(2);
newMemSize = memNeeded(stack.peek(), stack.get(stack.size()-2)); newMemSize = memNeeded(stack.peek(), stack.get(stack.size()-2));
break; break;
case SHA3: case SHA3:
program.stackRequire(2);
gasCost = GasCost.SHA3; gasCost = GasCost.SHA3;
newMemSize = memNeeded(stack.peek(), stack.get(stack.size()-2)); newMemSize = memNeeded(stack.peek(), stack.get(stack.size()-2));
break; break;
case CALLDATACOPY: case CALLDATACOPY:
program.stackRequire(3);
newMemSize = memNeeded(stack.peek(), stack.get(stack.size()-3)); newMemSize = memNeeded(stack.peek(), stack.get(stack.size()-3));
break; break;
case CODECOPY: case CODECOPY:
program.stackRequire(3);
newMemSize = memNeeded(stack.peek(), stack.get(stack.size()-3)); newMemSize = memNeeded(stack.peek(), stack.get(stack.size()-3));
break; break;
case EXTCODECOPY: case EXTCODECOPY:
program.stackRequire(4);
newMemSize = memNeeded(stack.get(stack.size()-2), stack.get(stack.size()-4)); newMemSize = memNeeded(stack.get(stack.size()-2), stack.get(stack.size()-4));
break; break;
case CALL: case CALLCODE: case CALL: case CALLCODE:
program.stackRequire(7);
gasCost = GasCost.CALL; gasCost = GasCost.CALL;
DataWord callGasWord = stack.get(stack.size()-1); DataWord callGasWord = stack.get(stack.size()-1);
if(callGasWord.compareTo(program.getGas()) == 1) { if(callGasWord.compareTo(program.getGas()) == 1) {
@ -165,7 +157,6 @@ public class VM {
newMemSize = in.max(out); newMemSize = in.max(out);
break; break;
case CREATE: case CREATE:
program.stackRequire(3);
gasCost = GasCost.CREATE; gasCost = GasCost.CREATE;
newMemSize = memNeeded(stack.get(stack.size()-2), stack.get(stack.size()-3)); newMemSize = memNeeded(stack.get(stack.size()-2), stack.get(stack.size()-3));
break; break;
@ -202,7 +193,6 @@ public class VM {
program.stop(); program.stop();
} break; } break;
case ADD:{ case ADD:{
program.stackRequire(2);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -215,7 +205,6 @@ public class VM {
} break; } break;
case MUL:{ case MUL:{
program.stackRequire(2);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -227,7 +216,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case SUB:{ case SUB:{
program.stackRequire(2);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -239,7 +227,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case DIV:{ case DIV:{
program.stackRequire(2);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -251,7 +238,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case SDIV:{ case SDIV:{
program.stackRequire(2);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -263,7 +249,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case MOD:{ case MOD:{
program.stackRequire(2);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -275,7 +260,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case SMOD:{ case SMOD:{
program.stackRequire(2);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -287,7 +271,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case EXP:{ case EXP:{
program.stackRequire(2);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -299,7 +282,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case NEG:{ case NEG:{
program.stackRequire(1);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
word1.negate(); word1.negate();
@ -310,7 +292,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case LT:{ case LT:{
program.stackRequire(2);
// TODO: can be improved by not using BigInteger // TODO: can be improved by not using BigInteger
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -328,7 +309,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case SLT:{ case SLT:{
program.stackRequire(2);
// TODO: can be improved by not using BigInteger // TODO: can be improved by not using BigInteger
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -346,7 +326,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case SGT:{ case SGT:{
program.stackRequire(2);
// TODO: can be improved by not using BigInteger // TODO: can be improved by not using BigInteger
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -364,7 +343,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case GT:{ case GT:{
program.stackRequire(2);
// TODO: can be improved by not using BigInteger // TODO: can be improved by not using BigInteger
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -382,7 +360,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case EQ:{ case EQ:{
program.stackRequire(2);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -399,7 +376,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case NOT: { case NOT: {
program.stackRequire(1);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
if (word1.isZero()) { if (word1.isZero()) {
word1.getData()[31] = 1; word1.getData()[31] = 1;
@ -417,8 +393,7 @@ public class VM {
/** /**
* Bitwise Logic Operations * Bitwise Logic Operations
*/ */
case AND:{ case AND:{
program.stackRequire(2);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -429,8 +404,7 @@ public class VM {
program.stackPush(word1); program.stackPush(word1);
program.step(); program.step();
} break; } break;
case OR: { case OR: {
program.stackRequire(2);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -441,8 +415,7 @@ public class VM {
program.stackPush(word1); program.stackPush(word1);
program.step(); program.step();
} break; } break;
case XOR: { case XOR: {
program.stackRequire(2);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
@ -453,8 +426,7 @@ public class VM {
program.stackPush(word1); program.stackPush(word1);
program.step(); program.step();
} break; } break;
case BYTE:{ case BYTE:{
program.stackRequire(2);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
DataWord result = null; DataWord result = null;
@ -474,7 +446,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case ADDMOD:{ case ADDMOD:{
program.stackRequire(3);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
DataWord word3 = program.stackPop(); DataWord word3 = program.stackPop();
@ -483,7 +454,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case MULMOD:{ case MULMOD:{
program.stackRequire(3);
DataWord word1 = program.stackPop(); DataWord word1 = program.stackPop();
DataWord word2 = program.stackPop(); DataWord word2 = program.stackPop();
DataWord word3 = program.stackPop(); DataWord word3 = program.stackPop();
@ -495,8 +465,7 @@ public class VM {
/** /**
* SHA3 * SHA3
*/ */
case SHA3:{ case SHA3:{
program.stackRequire(2);
DataWord memOffsetData = program.stackPop(); DataWord memOffsetData = program.stackPop();
DataWord lengthData = program.stackPop(); DataWord lengthData = program.stackPop();
ByteBuffer buffer = program.memoryChunk(memOffsetData, lengthData); ByteBuffer buffer = program.memoryChunk(memOffsetData, lengthData);
@ -524,7 +493,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case BALANCE:{ case BALANCE:{
program.stackRequire(1);
DataWord address = program.stackPop(); DataWord address = program.stackPop();
DataWord balance = program.getBalance(address); DataWord balance = program.getBalance(address);
@ -563,8 +531,7 @@ public class VM {
program.stackPush(callValue); program.stackPush(callValue);
program.step(); program.step();
} break; } break;
case CALLDATALOAD:{ case CALLDATALOAD:{
program.stackRequire(1);
DataWord dataOffs = program.stackPop(); DataWord dataOffs = program.stackPop();
DataWord value = program.getDataValue(dataOffs); DataWord value = program.getDataValue(dataOffs);
@ -583,8 +550,7 @@ public class VM {
program.stackPush(dataSize); program.stackPush(dataSize);
program.step(); program.step();
} break; } break;
case CALLDATACOPY:{ case CALLDATACOPY:{
program.stackRequire(3);
DataWord memOffsetData = program.stackPop(); DataWord memOffsetData = program.stackPop();
DataWord dataOffsetData = program.stackPop(); DataWord dataOffsetData = program.stackPop();
DataWord lengthData = program.stackPop(); DataWord lengthData = program.stackPop();
@ -603,7 +569,6 @@ public class VM {
if (op == OpCode.CODESIZE) if (op == OpCode.CODESIZE)
length = program.getCode().length; length = program.getCode().length;
else { else {
program.stackRequire(1);
DataWord address = program.stackPop(); DataWord address = program.stackPop();
length = program.getCodeAt(address).length; length = program.getCodeAt(address).length;
} }
@ -624,18 +589,20 @@ public class VM {
fullCode = program.getCodeAt(address); fullCode = program.getCodeAt(address);
} }
DataWord memOffsetData = program.stackPop(); DataWord memOffsetData = program.stackPop();
DataWord codeOffsetData = program.stackPop(); BigInteger codeOffsetData = program.stackPop().value();
DataWord lengthData = program.stackPop(); BigInteger lengthData = program.stackPop().value();
int length = lengthData.intValue(); if (fullCode == null
int codeOffset = codeOffsetData.intValue(); || BigInteger.valueOf(fullCode.length).compareTo(
codeOffsetData.add(lengthData)) < 0) {
if (fullCode == null || fullCode.length < length + codeOffset) {
program.stop(); program.stop();
break; break;
} }
int length = lengthData.intValue();
int codeOffset = codeOffsetData.intValue();
byte[] codeCopy = new byte[length]; byte[] codeCopy = new byte[length];
System.arraycopy(fullCode, codeOffset, codeCopy, 0, length); System.arraycopy(fullCode, codeOffset, codeCopy, 0, length);
@ -713,7 +680,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case POP:{ case POP:{
program.stackRequire(1);
program.stackPop(); program.stackPop();
program.step(); program.step();
} break; } break;
@ -723,7 +689,6 @@ public class VM {
case DUP13: case DUP14: case DUP15: case DUP16:{ case DUP13: case DUP14: case DUP15: case DUP16:{
int n = op.val() - OpCode.DUP1.val() + 1; int n = op.val() - OpCode.DUP1.val() + 1;
program.stackRequire(n);
DataWord word_1 = stack.get(stack.size() - n); DataWord word_1 = stack.get(stack.size() - n);
program.stackPush(word_1.clone()); program.stackPush(word_1.clone());
program.step(); program.step();
@ -735,7 +700,6 @@ public class VM {
case SWAP13: case SWAP14: case SWAP15: case SWAP16:{ case SWAP13: case SWAP14: case SWAP15: case SWAP16:{
int n = op.val() - OpCode.SWAP1.val() + 2; int n = op.val() - OpCode.SWAP1.val() + 2;
program.stackRequire(n);
DataWord word_1 = stack.peek(); DataWord word_1 = stack.peek();
stack.set(stack.size() - 1, stack.get(stack.size() - n)); stack.set(stack.size() - 1, stack.get(stack.size() - n));
stack.set(stack.size() - n, word_1); stack.set(stack.size() - n, word_1);
@ -743,7 +707,6 @@ public class VM {
} break; } break;
case MLOAD:{ case MLOAD:{
program.stackRequire(1);
DataWord addr = program.stackPop(); DataWord addr = program.stackPop();
DataWord data = program.memoryLoad(addr); DataWord data = program.memoryLoad(addr);
@ -754,7 +717,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case MSTORE:{ case MSTORE:{
program.stackRequire(2);
DataWord addr = program.stackPop(); DataWord addr = program.stackPop();
DataWord value = program.stackPop(); DataWord value = program.stackPop();
@ -765,7 +727,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case MSTORE8:{ case MSTORE8:{
program.stackRequire(2);
DataWord addr = program.stackPop(); DataWord addr = program.stackPop();
DataWord value = program.stackPop(); DataWord value = program.stackPop();
byte[] byteVal = {value.getData()[31]}; byte[] byteVal = {value.getData()[31]};
@ -773,7 +734,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case SLOAD:{ case SLOAD:{
program.stackRequire(1);
DataWord key = program.stackPop(); DataWord key = program.stackPop();
DataWord val = program.storageLoad(key); DataWord val = program.storageLoad(key);
@ -787,7 +747,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case SSTORE:{ case SSTORE:{
program.stackRequire(2);
DataWord addr = program.stackPop(); DataWord addr = program.stackPop();
DataWord value = program.stackPop(); DataWord value = program.stackPop();
@ -798,32 +757,34 @@ public class VM {
program.step(); program.step();
} break; } break;
case JUMP:{ case JUMP:{
program.stackRequire(1);
DataWord pos = program.stackPop(); DataWord pos = program.stackPop();
// if (!pos.equals(DataWord.ZERO) && OpCode.code(program.getCurrentOp()) != OpCode.JUMPDEST) int nextPC = pos.intValue(); // possible overflow
// throw new BadJumpDestinationException(); if (nextPC != 0 && program.getOp(nextPC-1) != OpCode.JUMPDEST.val())
throw new BadJumpDestinationException();
if (logger.isInfoEnabled()) if (logger.isInfoEnabled())
hint = "~> " + pos.value(); hint = "~> " + nextPC;
program.setPC(nextPC);
program.setPC(pos);
} break; } break;
case JUMPI:{ case JUMPI:{
program.stackRequire(2);
DataWord pos = program.stackPop(); DataWord pos = program.stackPop();
DataWord cond = program.stackPop(); DataWord cond = program.stackPop();
// if (!pos.isZero() && OpCode.code(program.getCurrentOp()) != OpCode.JUMPDEST)
// throw new BadJumpDestinationException();
if (!cond.isZero()) { if (!cond.isZero()) {
program.setPC(pos); int nextPC = pos.intValue(); // possible overflow
if (nextPC != 0 && program.getOp(nextPC-1) != OpCode.JUMPDEST.val())
throw new BadJumpDestinationException();
if (logger.isInfoEnabled())
hint = "~> " + nextPC;
program.setPC(nextPC);
} else { } else {
program.step(); program.step();
} }
if (logger.isInfoEnabled())
hint = "~> " + program.getPC();
} break; } break;
case PC:{ case PC:{
int pc = program.getPC(); int pc = program.getPC();
@ -868,9 +829,9 @@ public class VM {
program.stackPush(data); program.stackPush(data);
} break; } break;
case JUMPDEST:{ case JUMPDEST:{
program.step();
} break; } break;
case CREATE:{ case CREATE:{
program.stackRequire(3);
DataWord value = program.stackPop(); DataWord value = program.stackPop();
DataWord inOffset = program.stackPop(); DataWord inOffset = program.stackPop();
DataWord inSize = program.stackPop(); DataWord inSize = program.stackPop();
@ -887,7 +848,7 @@ public class VM {
} break; } break;
case CALL: case CALLCODE: { case CALL: case CALLCODE: {
DataWord gas = program.stackPop(); DataWord gas = program.stackPop();
DataWord codeAddress = program.stackPop(); DataWord codeAddress = program.stackPop();
DataWord value = program.stackPop(); DataWord value = program.stackPop();
DataWord inDataOffs = program.stackPop(); DataWord inDataOffs = program.stackPop();
@ -916,7 +877,6 @@ public class VM {
program.step(); program.step();
} break; } break;
case RETURN:{ case RETURN:{
program.stackRequire(2);
DataWord offset = program.stackPop(); DataWord offset = program.stackPop();
DataWord size = program.stackPop(); DataWord size = program.stackPop();
@ -932,7 +892,6 @@ public class VM {
program.stop(); program.stop();
} break; } break;
case SUICIDE:{ case SUICIDE:{
program.stackRequire(1);
DataWord address = program.stackPop(); DataWord address = program.stackPop();
program.suicide(address); program.suicide(address);
@ -953,12 +912,9 @@ public class VM {
vmCounter++; vmCounter++;
} catch (RuntimeException e) { } catch (RuntimeException e) {
if(e instanceof OutOfGasException) { if(e instanceof OutOfGasException)
logger.warn("OutOfGasException occurred", e);
program.spendAllGas(); program.spendAllGas();
} logger.warn("VM halted", e.getMessage());
else
logger.error("VM halted", e);
program.stop(); program.stop();
throw e; throw e;
} }
@ -981,8 +937,8 @@ public class VM {
program.setRuntimeFailure(e); program.setRuntimeFailure(e);
} }
} }
/** /**
* Utility to calculate new total memory size needed for an operation. * Utility to calculate new total memory size needed for an operation.
* <br/> Basically just offset + size, unless size is 0, in which case the result is also 0. * <br/> Basically just offset + size, unless size is 0, in which case the result is also 0.
* *

View File

@ -0,0 +1,46 @@
package org.ethereum.jsontestsuite;
import java.util.Iterator;
import java.util.List;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
/**
* Test file specific for tests maintained in the GitHub repository
* by the Ethereum DEV team. <br/>
*
* @see <a href="https://github.com/ethereum/tests/">https://github.com/ethereum/tests/</a>
*/
@RunWith(Suite.class)
@SuiteClasses({
GitHubVMTest.class,
GitHubRandomTest.class
})
public class GitHubJSONTestSuite {
protected static void runGitHubJsonTest(String json) throws ParseException {
Assume.assumeFalse("Online test is not available", json.equals(""));
JSONParser parser = new JSONParser();
JSONObject testSuiteObj = (JSONObject)parser.parse(json);
TestSuite testSuite = new TestSuite(testSuiteObj);
Iterator<TestCase> testIterator = testSuite.iterator();
while (testIterator.hasNext()){
TestCase testCase = testIterator.next();
TestRunner runner = new TestRunner();
List<String> result = runner.runTestCase(testCase);
Assert.assertTrue(result.isEmpty());
}
}
}

View File

@ -1,95 +0,0 @@
package org.ethereum.jsontestsuite;
import java.util.Iterator;
import java.util.List;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;
/**
* Test file specific for tests maintained in the GitHub repository
* by the Ethereum DEV team. <br/>
*
* @see <a href="https://github.com/ethereum/tests/">https://github.com/ethereum/tests/</a>
*/
public class GitHubJSONTestSuiteTest {
@Test // testing full suite
public void testArithmeticFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmArithmeticTest.json");
runGitHubJsonTest(json);
}
@Test // testing full suite
public void testBitwiseLogicOperationFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmBitwiseLogicOperationTest.json");
runGitHubJsonTest(json);
}
@Test // testing full suite
public void testBlockInfoFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmBlockInfoTest.json");
runGitHubJsonTest(json);
}
@Test // testing full suite
public void testEnvironmentalInfoFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmEnvironmentalInfoTest.json");
runGitHubJsonTest(json);
}
@Test // testing full suite
public void testIOandFlowOperationsFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmIOandFlowOperationsTest.json");
runGitHubJsonTest(json);
}
@Test // testing full suite
public void testPushDupSwapFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmPushDupSwapTest.json");
runGitHubJsonTest(json);
}
@Test // testing full suite
public void testShaFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmSha3Test.json");
runGitHubJsonTest(json);
}
@Test // testing full suite
public void testSystemOperationsFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmSystemOperationsTest.json");
runGitHubJsonTest(json);
}
private void runGitHubJsonTest(String json) throws ParseException {
Assume.assumeFalse("Online test is not available", json.equals(""));
JSONParser parser = new JSONParser();
JSONObject testSuiteObj = (JSONObject)parser.parse(json);
TestSuite testSuite = new TestSuite(testSuiteObj);
Iterator<TestCase> testIterator = testSuite.iterator();
while (testIterator.hasNext()){
TestCase testCase = testIterator.next();
TestRunner runner = new TestRunner();
List<String> result = runner.runTestCase(testCase);
Assert.assertTrue(result.isEmpty());
}
}
}

View File

@ -0,0 +1,23 @@
package org.ethereum.jsontestsuite;
import org.json.simple.parser.ParseException;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class GitHubRandomTest {
@Test // testing full suite
public void testRandom04FromGitHub() throws ParseException {
String json = JSONReader.loadJSON("randomTests/201410211705.json");
GitHubJSONTestSuite.runGitHubJsonTest(json);
}
@Test // testing full suite
public void testRandom06FromGitHub() throws ParseException {
String json = JSONReader.loadJSON("randomTests/201410211708.json");
GitHubJSONTestSuite.runGitHubJsonTest(json);
}
}

View File

@ -0,0 +1,66 @@
package org.ethereum.jsontestsuite;
import org.json.simple.parser.ParseException;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class GitHubVMTest {
@Test // testing full suite
public void testArithmeticFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmtests/vmArithmeticTest.json");
GitHubJSONTestSuite.runGitHubJsonTest(json);
}
@Test // testing full suite
public void testBitwiseLogicOperationFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmtests/vmBitwiseLogicOperationTest.json");
GitHubJSONTestSuite.runGitHubJsonTest(json);
}
@Test // testing full suite
public void testBlockInfoFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmtests/vmBlockInfoTest.json");
GitHubJSONTestSuite.runGitHubJsonTest(json);
}
@Test // testing full suite
public void testEnvironmentalInfoFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmtests/vmEnvironmentalInfoTest.json");
GitHubJSONTestSuite.runGitHubJsonTest(json);
}
@Test // testing full suite
public void testIOandFlowOperationsFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmtests/vmIOandFlowOperationsTest.json");
GitHubJSONTestSuite.runGitHubJsonTest(json);
}
@Test // testing full suite
public void testPushDupSwapFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmtests/vmPushDupSwapTest.json");
GitHubJSONTestSuite.runGitHubJsonTest(json);
}
@Test // testing full suite
public void testShaFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmtests/vmSha3Test.json");
GitHubJSONTestSuite.runGitHubJsonTest(json);
}
@Test // testing full suite
public void testSystemOperationsFromGitHub() throws ParseException {
String json = JSONReader.loadJSON("vmtests/vmSystemOperationsTest.json");
GitHubJSONTestSuite.runGitHubJsonTest(json);
}
}

View File

@ -12,7 +12,8 @@ import java.nio.file.Files;
public class JSONReader { public class JSONReader {
public static String loadJSON(String filename) { public static String loadJSON(String filename) {
String json = getFromUrl("https://raw.githubusercontent.com/ethereum/tests/master/vmtests/" + filename); // return getFromLocal(filename);
String json = getFromUrl("https://raw.githubusercontent.com/ethereum/tests/develop/" + filename);
return json == "" ? json = getFromLocal(filename) : json; return json == "" ? json = getFromLocal(filename) : json;
} }

View File

@ -1,11 +1,6 @@
package org.ethereum.jsontestsuite; package org.ethereum.jsontestsuite;
import java.io.File;
import java.io.IOException;
import java.math.BigInteger; import java.math.BigInteger;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
import java.util.List; import java.util.List;
import org.ethereum.db.ByteArrayWrapper; import org.ethereum.db.ByteArrayWrapper;
@ -173,110 +168,52 @@ public class LocalJSONTestSuiteTest {
TestRunner runner = new TestRunner(); TestRunner runner = new TestRunner();
List<String> result = runner.runTestCase(testCase); List<String> result = runner.runTestCase(testCase);
Assert.assertTrue(result.size() == 0); Assert.assertTrue(result.size() == 0);
} }
@Test // TestCase file: vmtest-1.json // @Test // TestCase file: vmtest-1.json //
public void test6() throws ParseException, IOException, URISyntaxException { public void test6() {
String vmtest = JSONReader.getFromLocal("vmtest-1.json");
String testSrc = JSONReader.getFromLocal("vmtest-1.json"); runTest(vmtest);
JSONParser parser = new JSONParser();
JSONObject testCaseJSONObj = (JSONObject)parser.parse(testSrc);
TestSuite testSuite = new TestSuite(testCaseJSONObj);
TestRunner runner = new TestRunner();
List<String> result = runner.runTestSuite(testSuite);
Assert.assertTrue(result.size() == 0);
} }
@Test // TestCase file: vmtest-2.json // @Test // TestCase file: vmtest-2.json //
public void test7() throws ParseException, IOException, URISyntaxException { public void test7() {
String vmtest = JSONReader.getFromLocal("vmtest-2.json");
URL vmtest = ClassLoader runTest(vmtest);
.getSystemResource("jsontestsuite/vmtest-2.json");
File vmTestFile = new File(vmtest.toURI());
byte[] testData = Files.readAllBytes(vmTestFile.toPath());
String testSrc = new String(testData);
JSONParser parser = new JSONParser();
JSONObject testCaseJSONObj = (JSONObject)parser.parse(testSrc);
TestSuite testSuite = new TestSuite(testCaseJSONObj);
TestRunner runner = new TestRunner();
List<String> result = runner.runTestSuite(testSuite);
Assert.assertTrue(result.size() == 0);
} }
@Test // TestCase file: vmtest-3.json // @Test // TestCase file: vmtest-3.json //
public void test8() throws ParseException, IOException, URISyntaxException { public void test8() {
String vmtest = JSONReader.getFromLocal("vmtest-3.json");
URL vmtest = ClassLoader runTest(vmtest);
.getSystemResource("jsontestsuite/vmtest-3.json");
File vmTestFile = new File(vmtest.toURI());
byte[] testData = Files.readAllBytes(vmTestFile.toPath());
String testSrc = new String(testData);
JSONParser parser = new JSONParser();
JSONObject testCaseJSONObj = (JSONObject)parser.parse(testSrc);
TestSuite testSuite = new TestSuite(testCaseJSONObj);
TestRunner runner = new TestRunner();
List<String> result = runner.runTestSuite(testSuite);
Assert.assertTrue(result.size() == 0);
}
@Test // TestCase file: vmtest-4.json //
public void test9() throws ParseException, IOException, URISyntaxException {
URL vmtest = ClassLoader
.getSystemResource("jsontestsuite/vmtest-4.json");
File vmTestFile = new File(vmtest.toURI());
byte[] testData = Files.readAllBytes(vmTestFile.toPath());
String testSrc = new String(testData);
JSONParser parser = new JSONParser();
JSONObject testCaseJSONObj = (JSONObject)parser.parse(testSrc);
TestSuite testSuite = new TestSuite(testCaseJSONObj);
TestRunner runner = new TestRunner();
List<String> result = runner.runTestSuite(testSuite);
Assert.assertTrue(result.size() == 0);
} }
@Test // TestCase file: vmtest-4.json // @Test // TestCase file: vmtest-4.json //
public void test10() throws ParseException, IOException, URISyntaxException { public void test9() {
String vmtest = JSONReader.getFromLocal("vmtest-4.json");
runTest(vmtest);
}
URL vmtest = ClassLoader @Test // TestCase file: vmtest-5.json //
.getSystemResource("jsontestsuite/vmtest-5.json"); public void test10() {
String vmtest = JSONReader.getFromLocal("vmtest-5.json");
File vmTestFile = new File(vmtest.toURI()); runTest(vmtest);
byte[] testData = Files.readAllBytes(vmTestFile.toPath()); }
String testSrc = new String(testData);
private void runTest(String vmtest) {
JSONParser parser = new JSONParser(); try {
JSONObject testCaseJSONObj = (JSONObject)parser.parse(testSrc); JSONParser parser = new JSONParser();
JSONObject testCaseJSONObj = (JSONObject)parser.parse(vmtest);
TestSuite testSuite = new TestSuite(testCaseJSONObj);
TestSuite testSuite = new TestSuite(testCaseJSONObj);
TestRunner runner = new TestRunner();
List<String> result = runner.runTestSuite(testSuite); TestRunner runner = new TestRunner();
List<String> result = runner.runTestSuite(testSuite);
Assert.assertTrue(result.size() == 0);
Assert.assertTrue(result.size() == 0);
} catch (ParseException e) {
Assert.fail(e.getMessage());
}
} }
} }

View File

@ -47,7 +47,7 @@ public class VMComplexTest {
// Set contract into Database // Set contract into Database
String callerAddr = "cd2a3d9f938e13cd947ec05abc7fe734df8dd826"; String callerAddr = "cd2a3d9f938e13cd947ec05abc7fe734df8dd826";
String contractAddr = "77045e71a7a2c50903d88e564cd72fab11e82051"; String contractAddr = "77045e71a7a2c50903d88e564cd72fab11e82051";
String code = "6103e75660005460006000530b0f630000004b596001600053036103e757600060006000600060007377045e71a7a2c50903d88e564cd72fab11e820516008600a5c0402f1630000004c5800"; String code = "6103e75660005460006000530b0f630000004c596001600053036103e757600060006000600060007377045e71a7a2c50903d88e564cd72fab11e820516008600a5c0402f1630000004c585d00";
byte[] contractAddrB = Hex.decode(contractAddr); byte[] contractAddrB = Hex.decode(contractAddr);
byte[] callerAddrB = Hex.decode(callerAddr); byte[] callerAddrB = Hex.decode(callerAddr);

View File

@ -0,0 +1,561 @@
package org.ethereum.vm;
import org.ethereum.vm.Program.OutOfGasException;
import org.ethereum.vm.Program.StackTooSmallException;
import org.junit.After;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import org.spongycastle.util.encoders.Hex;
import java.math.BigInteger;
import static org.junit.Assert.*;
/**
* www.ethereumJ.com
* @author: Roman Mandeleil
* Created on: 01/06/2014 11:05
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class VMCustomTest {
private ProgramInvokeMockImpl invoke;
private Program program;
@Before
public void setup() {
byte[] ownerAddress = Hex.decode("77045E71A7A2C50903D88E564CD72FAB11E82051");
byte[] msgData = Hex.decode("00000000000000000000000000000000000000000000000000000000000000A1" +
"00000000000000000000000000000000000000000000000000000000000000B1");
invoke = new ProgramInvokeMockImpl(msgData);
invoke.setOwnerAddress(ownerAddress);
invoke.getRepository().createAccount(ownerAddress);
invoke.getRepository().addBalance(ownerAddress, BigInteger.valueOf(1000L));
}
@After
public void tearDown() {
invoke.getRepository().close();
}
@Test // CALLDATASIZE OP
public void testCALLDATASIZE_1() {
VM vm = new VM();
program = new Program(Hex.decode("36"), invoke);
String s_expected_1 = "0000000000000000000000000000000000000000000000000000000000000040";
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // CALLDATALOAD OP
public void testCALLDATALOAD_1() {
VM vm = new VM();
program =
new Program(Hex.decode("600035"), invoke);
String s_expected_1 = "00000000000000000000000000000000000000000000000000000000000000A1";
vm.step(program);
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // CALLDATALOAD OP
public void testCALLDATALOAD_2() {
VM vm = new VM();
program =
new Program(Hex.decode("600235"), invoke);
String s_expected_1 = "0000000000000000000000000000000000000000000000000000000000A10000";
vm.step(program);
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // CALLDATALOAD OP
public void testCALLDATALOAD_3() {
VM vm = new VM();
program =
new Program(Hex.decode("602035"), invoke);
String s_expected_1 = "00000000000000000000000000000000000000000000000000000000000000B1";
vm.step(program);
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // CALLDATALOAD OP
public void testCALLDATALOAD_4() {
VM vm = new VM();
program =
new Program(Hex.decode("602335"), invoke);
String s_expected_1 = "00000000000000000000000000000000000000000000000000000000B1000000";
vm.step(program);
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // CALLDATALOAD OP
public void testCALLDATALOAD_5() {
VM vm = new VM();
program =
new Program(Hex.decode("603F35"), invoke);
String s_expected_1 = "B100000000000000000000000000000000000000000000000000000000000000";
vm.step(program);
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test(expected=RuntimeException.class) // CALLDATALOAD OP mal
public void testCALLDATALOAD_6() {
VM vm = new VM();
program =
new Program(Hex.decode("35"), invoke);
try {
vm.step(program);
} finally {
assertTrue(program.isStopped());
}
}
@Test // CALLDATACOPY OP
public void testCALLDATACOPY_1() {
VM vm = new VM();
program =
new Program(Hex.decode("60206000600037"), invoke);
String m_expected = "00000000000000000000000000000000000000000000000000000000000000A1";
vm.step(program);
vm.step(program);
vm.step(program);
vm.step(program);
assertEquals(m_expected, Hex.toHexString(program.memory.array()).toUpperCase());
}
@Test // CALLDATACOPY OP
public void testCALLDATACOPY_2() {
VM vm = new VM();
program =
new Program(Hex.decode("60406000600037"), invoke);
String m_expected = "00000000000000000000000000000000000000000000000000000000000000A1" +
"00000000000000000000000000000000000000000000000000000000000000B1";
vm.step(program);
vm.step(program);
vm.step(program);
vm.step(program);
assertEquals(m_expected, Hex.toHexString(program.memory.array()).toUpperCase());
}
@Test // CALLDATACOPY OP
public void testCALLDATACOPY_3() {
VM vm = new VM();
program =
new Program(Hex.decode("60406004600037"), invoke);
String m_expected = "000000000000000000000000000000000000000000000000000000A100000000" +
"000000000000000000000000000000000000000000000000000000B100000000";
vm.step(program);
vm.step(program);
vm.step(program);
vm.step(program);
assertEquals(m_expected, Hex.toHexString(program.memory.array()).toUpperCase());
}
@Test // CALLDATACOPY OP
public void testCALLDATACOPY_4() {
VM vm = new VM();
program =
new Program(Hex.decode("60406000600437"), invoke);
String m_expected = "0000000000000000000000000000000000000000000000000000000000000000" +
"000000A100000000000000000000000000000000000000000000000000000000" +
"000000B100000000000000000000000000000000000000000000000000000000";
vm.step(program);
vm.step(program);
vm.step(program);
vm.step(program);
assertEquals(m_expected, Hex.toHexString(program.memory.array()).toUpperCase());
}
@Test // CALLDATACOPY OP
public void testCALLDATACOPY_5() {
VM vm = new VM();
program =
new Program(Hex.decode("60406000600437"), invoke);
String m_expected = "0000000000000000000000000000000000000000000000000000000000000000" +
"000000A100000000000000000000000000000000000000000000000000000000" +
"000000B100000000000000000000000000000000000000000000000000000000";
vm.step(program);
vm.step(program);
vm.step(program);
vm.step(program);
assertEquals(m_expected, Hex.toHexString(program.memory.array()).toUpperCase());
}
@Test(expected=StackTooSmallException.class) // CALLDATACOPY OP mal
public void testCALLDATACOPY_6() {
VM vm = new VM();
program =
new Program(Hex.decode("6040600037"), invoke);
try {
vm.step(program);
vm.step(program);
vm.step(program);
} finally {
assertTrue(program.isStopped());
}
}
@Test(expected=OutOfGasException.class) // CALLDATACOPY OP mal
public void testCALLDATACOPY_7() {
VM vm = new VM();
program =
new Program(Hex.decode("6020600073CC0929EB16730E7C14FEFC63006AC2D794C5795637"), invoke);
try {
vm.step(program);
vm.step(program);
vm.step(program);
vm.step(program);
} finally {
assertTrue(program.isStopped());
}
}
@Test // ADDRESS OP
public void testADDRESS_1() {
VM vm = new VM();
program = new Program(Hex.decode("30"), invoke);
String s_expected_1 = "00000000000000000000000077045E71A7A2C50903D88E564CD72FAB11E82051";
vm.step(program);
DataWord item1 = program.stackPop();
program.getResult().getRepository().close();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // BALANCE OP
public void testBALANCE_1() {
VM vm = new VM();
program =
new Program(Hex.decode("3031"), invoke);
String s_expected_1 = "00000000000000000000000000000000000000000000000000000000000003E8";
vm.step(program);
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // ORIGIN OP
public void testORIGIN_1() {
VM vm = new VM();
program =
new Program(Hex.decode("32"), invoke);
String s_expected_1 = "00000000000000000000000013978AEE95F38490E9769C39B2773ED763D9CD5F";
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // CALLER OP
public void testCALLER_1() {
VM vm = new VM();
program =
new Program(Hex.decode("33"), invoke);
String s_expected_1 = "000000000000000000000000885F93EED577F2FC341EBB9A5C9B2CE4465D96C4";
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // CALLVALUE OP
public void testCALLVALUE_1() {
VM vm = new VM();
program =
new Program(Hex.decode("34"), invoke);
String s_expected_1 = "0000000000000000000000000000000000000000000000000DE0B6B3A7640000";
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // SHA3 OP
public void testSHA3_1() {
VM vm = new VM();
program =
new Program(Hex.decode("60016000556001600020"), invoke);
String s_expected_1 = "5FE7F977E71DBA2EA1A68E21057BEEBB9BE2AC30C6410AA38D4F3FBE41DCFFD2";
vm.step(program);
vm.step(program);
vm.step(program);
vm.step(program);
vm.step(program);
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // SHA3 OP
public void testSHA3_2() {
VM vm = new VM();
program =
new Program(Hex.decode("6102016000546002601E20"), invoke);
String s_expected_1 = "114A3FE82A0219FCC31ABD15617966A125F12B0FD3409105FC83B487A9D82DE4";
vm.step(program);
vm.step(program);
vm.step(program);
vm.step(program);
vm.step(program);
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test(expected=StackTooSmallException.class) // SHA3 OP mal
public void testSHA3_3() {
VM vm = new VM();
program =
new Program(Hex.decode("610201600054600220"), invoke);
try {
vm.step(program);
vm.step(program);
vm.step(program);
vm.step(program);
vm.step(program);
} finally {
assertTrue(program.isStopped());
}
}
@Test // PREVHASH OP
public void testPREVHASH_1() {
VM vm = new VM();
program =
new Program(Hex.decode("40"), invoke);
String s_expected_1 = "961CB117ABA86D1E596854015A1483323F18883C2D745B0BC03E87F146D2BB1C";
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // COINBASE OP
public void testCOINBASE_1() {
VM vm = new VM();
program =
new Program(Hex.decode("41"), invoke);
String s_expected_1 = "000000000000000000000000E559DE5527492BCB42EC68D07DF0742A98EC3F1E";
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // TIMESTAMP OP
public void testTIMESTAMP_1() {
VM vm = new VM();
program =
new Program(Hex.decode("42"), invoke);
String s_expected_1 = "000000000000000000000000000000000000000000000000000000005387FE24";
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // NUMBER OP
public void testNUMBER_1() {
VM vm = new VM();
program =
new Program(Hex.decode("43"), invoke);
String s_expected_1 = "0000000000000000000000000000000000000000000000000000000000000021";
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // DIFFICULTY OP
public void testDIFFICULTY_1() {
VM vm = new VM();
program =
new Program(Hex.decode("44"), invoke);
String s_expected_1 = "00000000000000000000000000000000000000000000000000000000003ED290";
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // GASPRICE OP
public void testGASPRICE_1() {
VM vm = new VM();
program =
new Program(Hex.decode("3A"), invoke);
String s_expected_1 = "000000000000000000000000000000000000000000000000000009184E72A000";
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // GAS OP
public void testGAS_1() {
VM vm = new VM();
program =
new Program(Hex.decode("5C"), invoke);
String s_expected_1 = "00000000000000000000000000000000000000000000000000000000000F423F";
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test // GASLIMIT OP
public void testGASLIMIT_1() {
VM vm = new VM();
program =
new Program(Hex.decode("45"), invoke);
String s_expected_1 = "00000000000000000000000000000000000000000000000000000000000F4240";
vm.step(program);
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
@Test(expected=Program.IllegalOperationException.class) // INVALID OP
public void testINVALID_1() {
VM vm = new VM();
program = new Program(Hex.decode("6001516002"), invoke);
String s_expected_1 = "0000000000000000000000000000000000000000000000000000000000000001";
try {
vm.step(program);
vm.step(program);
} finally {
assertTrue(program.isStopped());
DataWord item1 = program.stackPop();
assertEquals(s_expected_1, Hex.toHexString(item1.getData()).toUpperCase());
}
}
/* TEST CASE LIST END */
}
// TODO: add gas expeted and calculated to all test cases
// TODO: considering: G_TXDATA + G_TRANSACTION
/**
* TODO:
*
* 22) CREATE:
* 23) CALL:
*
*
**/
/**
contract creation (gas usage)
-----------------------------
G_TRANSACTION = (500)
60016000546006601160003960066000f261778e600054 (115)
PUSH1 6001 (1)
PUSH1 6000 (1)
MSTORE 54 (1 + 1)
PUSH1 6006 (1)
PUSH1 6011 (1)
PUSH1 6000 (1)
CODECOPY 39 (1)
PUSH1 6006 (1)
PUSH1 6000 (1)
RETURN f2 (1)
61778e600054
*/

File diff suppressed because it is too large Load Diff

View File

@ -1617,6 +1617,134 @@
} }
} }
}, },
"mul4" : {
"callcreates" : [
],
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "1000000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f800000000000000000000000000000000000000000000000000000000000000002600057",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9796",
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f800000000000000000000000000000000000000000000000000000000000000002600057",
"nonce" : "0",
"storage" : {
"0x" : "0x8000000000000000000000000000000000000000000000000000000000000000"
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f800000000000000000000000000000000000000000000000000000000000000002600057",
"nonce" : "0",
"storage" : {
}
}
}
},
"mul5" : {
"callcreates" : [
],
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "1000000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x7f80000000000000000000000000000000000000000000000000000000000000007f800000000000000000000000000000000000000000000000000000000000000002600057",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9896",
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x7f80000000000000000000000000000000000000000000000000000000000000007f800000000000000000000000000000000000000000000000000000000000000002600057",
"nonce" : "0",
"storage" : {
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x7f80000000000000000000000000000000000000000000000000000000000000007f800000000000000000000000000000000000000000000000000000000000000002600057",
"nonce" : "0",
"storage" : {
}
}
}
},
"mul6" : {
"callcreates" : [
],
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "1000000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff02600057",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9796",
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff02600057",
"nonce" : "0",
"storage" : {
"0x" : "0x01"
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff02600057",
"nonce" : "0",
"storage" : {
}
}
}
},
"neg0" : { "neg0" : {
"callcreates" : [ "callcreates" : [
], ],

View File

@ -148,7 +148,7 @@
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000" "value" : "1000000000000000000"
}, },
"gas" : "9796", "gas" : "9997",
"out" : "0x", "out" : "0x",
"post" : { "post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@ -156,7 +156,6 @@
"code" : "0x60236007586001600257", "code" : "0x60236007586001600257",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
"0x02" : "0x23"
} }
} }
}, },
@ -212,6 +211,91 @@
} }
} }
}, },
"jump0_jumpdest0" : {
"callcreates" : [
],
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "1000000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x602360085860015d600257",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9796",
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x602360085860015d600257",
"nonce" : "0",
"storage" : {
"0x02" : "0x23"
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x602360085860015d600257",
"nonce" : "0",
"storage" : {
}
}
}
},
"jump0_jumpdest1" : {
"callcreates" : [
],
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "1000000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x602360075860015d600257",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9997",
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x602360075860015d600257",
"nonce" : "0",
"storage" : {
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x602360075860015d600257",
"nonce" : "0",
"storage" : {
}
}
}
},
"jumpi0" : { "jumpi0" : {
"callcreates" : [ "callcreates" : [
], ],
@ -233,7 +317,7 @@
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000" "value" : "1000000000000000000"
}, },
"gas" : "9795", "gas" : "9996",
"out" : "0x", "out" : "0x",
"post" : { "post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@ -241,7 +325,6 @@
"code" : "0x602360016009596001600257", "code" : "0x602360016009596001600257",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
"0x02" : "0x23"
} }
} }
}, },
@ -298,6 +381,49 @@
} }
} }
}, },
"jumpi1_jumpdest" : {
"callcreates" : [
],
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "1000000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60236001600a5960015d600257",
"data" : "0x",
"gas" : "10000",
"gasPrice" : "100000000000000",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000"
},
"gas" : "9795",
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x60236001600a5960015d600257",
"nonce" : "0",
"storage" : {
"0x02" : "0x23"
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x60236001600a5960015d600257",
"nonce" : "0",
"storage" : {
}
}
}
},
"mloadError0" : { "mloadError0" : {
"callcreates" : [ "callcreates" : [
], ],
@ -1044,7 +1170,7 @@
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000" "value" : "1000000000000000000"
}, },
"gas" : "9999", "gas" : "10000",
"out" : "0x", "out" : "0x",
"post" : { "post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {

View File

@ -407,7 +407,7 @@
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000" "value" : "1000000000000000000"
}, },
"gas" : "9998", "gas" : "9999",
"out" : "0x", "out" : "0x",
"post" : { "post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
@ -2555,7 +2555,7 @@
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "1000000000000000000" "value" : "1000000000000000000"
}, },
"gas" : "9997", "gas" : "9998",
"out" : "0x", "out" : "0x",
"post" : { "post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {

View File

@ -1,5 +1,5 @@
{ {
"ABAcalls" : { "ABAcalls0" : {
"callcreates" : [ "callcreates" : [
{ {
"data" : "0x", "data" : "0x",
@ -63,6 +63,198 @@
} }
} }
}, },
"ABAcalls1" : {
"callcreates" : [
{
"data" : "0x",
"destination" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"gasLimit" : "9999999998992",
"value" : "24"
}
],
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "10000000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x6000600060006000601873945304eb96065b2a98b57a48a06ae28d285a71b56103e85c03f15a57",
"data" : "0x",
"gas" : "10000000000000",
"gasPrice" : "100000000000000",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "100000"
},
"gas" : "898727",
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "999999999999999488",
"code" : "0x6000600060006000601873945304eb96065b2a98b57a48a06ae28d285a71b56103e85c03f15a57",
"nonce" : "0",
"storage" : {
"0x25" : "0x01"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "535",
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e85c03f16001015a57",
"nonce" : "0",
"storage" : {
"0x28" : "0x02"
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x6000600060006000601873945304eb96065b2a98b57a48a06ae28d285a71b56103e85c03f15a57",
"nonce" : "0",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23",
"code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e85c03f16001015a57",
"nonce" : "0",
"storage" : {
}
}
}
},
"ABAcalls2" : {
"callcreates" : [
{
"data" : "0x",
"destination" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"gasLimit" : "9999999998768",
"value" : "1"
}
],
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "10000000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x6001600056016000576000600060006000600173945304eb96065b2a98b57a48a06ae28d285a71b56103e85c03f1",
"data" : "0x",
"gas" : "10000000000000",
"gasPrice" : "100000000000000",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "100000"
},
"gas" : "1003475",
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "999999999999999488",
"code" : "0x6001600056016000576000600060006000600173945304eb96065b2a98b57a48a06ae28d285a71b56103e85c03f1",
"nonce" : "0",
"storage" : {
"0x" : "0x01"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "512",
"code" : "0x60016000560160005760006000600060006000730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e85c03f1",
"nonce" : "0",
"storage" : {
"0x" : "0x0200"
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x6001600056016000576000600060006000600173945304eb96065b2a98b57a48a06ae28d285a71b56103e85c03f1",
"nonce" : "0",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0",
"code" : "0x60016000560160005760006000600060006000730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e85c03f1",
"nonce" : "0",
"storage" : {
}
}
}
},
"ABAcalls3" : {
"callcreates" : [
{
"data" : "0x",
"destination" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"gasLimit" : "998768",
"value" : "1"
}
],
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "10000000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x6001600056016000576000600060006000600173945304eb96065b2a98b57a48a06ae28d285a71b56103e85c03f1",
"data" : "0x",
"gas" : "1000000",
"gasPrice" : "100000000000000",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "100000"
},
"gas" : "864457",
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1024558",
"code" : "0x6001600056016000576000600060006000600173945304eb96065b2a98b57a48a06ae28d285a71b56103e85c03f1",
"nonce" : "0",
"storage" : {
"0x" : "0x01"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "442",
"code" : "0x60016000560160005760006000600060006000730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e85c03f1",
"nonce" : "0",
"storage" : {
"0x" : "0x01b9"
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1025000",
"code" : "0x6001600056016000576000600060006000600173945304eb96065b2a98b57a48a06ae28d285a71b56103e85c03f1",
"nonce" : "0",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "0",
"code" : "0x60016000560160005760006000600060006000730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66103e85c03f1",
"nonce" : "0",
"storage" : {
}
}
}
},
"ABAcallsSuicide0" : { "ABAcallsSuicide0" : {
"callcreates" : [ "callcreates" : [
{ {
@ -175,7 +367,7 @@
} }
} }
}, },
"CallRecursiveBomb" : { "CallRecursiveBomb0" : {
"callcreates" : [ "callcreates" : [
{ {
"data" : "0x", "data" : "0x",
@ -239,6 +431,156 @@
} }
} }
}, },
"CallRecursiveBomb1" : {
"callcreates" : [
{
"data" : "0x",
"destination" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"gasLimit" : "364267",
"value" : "0"
}
],
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "10000000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x600160005601600057600060006000600060003060e05c03f1600157",
"data" : "0x",
"gas" : "364723",
"gasPrice" : "1",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "100000"
},
"gas" : "104246",
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "20000000",
"code" : "0x600160005601600057600060006000600060003060e05c03f1600157",
"nonce" : "0",
"storage" : {
"0x" : "0x03fe",
"0x01" : "0x01"
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "20000000",
"code" : "0x600160005601600057600060006000600060003060e05c03f1600157",
"nonce" : "0",
"storage" : {
}
}
}
},
"CallRecursiveBomb2" : {
"callcreates" : [
{
"data" : "0x",
"destination" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"gasLimit" : "364268",
"value" : "0"
}
],
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "10000000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x600160005601600057600060006000600060003060e05c03f1600157",
"data" : "0x",
"gas" : "364724",
"gasPrice" : "1",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "100000"
},
"gas" : "104551",
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "20000000",
"code" : "0x600160005601600057600060006000600060003060e05c03f1600157",
"nonce" : "0",
"storage" : {
"0x" : "0x03ff",
"0x01" : "0x01"
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "20000000",
"code" : "0x600160005601600057600060006000600060003060e05c03f1600157",
"nonce" : "0",
"storage" : {
}
}
}
},
"CallRecursiveBomb3" : {
"callcreates" : [
{
"data" : "0x",
"destination" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"gasLimit" : "999544",
"value" : "0"
}
],
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "10000000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x600160005601600057600060006000600060003060e05c03f1600157",
"data" : "0x",
"gas" : "1000000",
"gasPrice" : "1",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "100000"
},
"gas" : "104551",
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "20000000",
"code" : "0x600160005601600057600060006000600060003060e05c03f1600157",
"nonce" : "0",
"storage" : {
"0x" : "0x03ff",
"0x01" : "0x01"
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "20000000",
"code" : "0x600160005601600057600060006000600060003060e05c03f1600157",
"nonce" : "0",
"storage" : {
}
}
}
},
"CallToNameRegistrator0" : { "CallToNameRegistrator0" : {
"callcreates" : [ "callcreates" : [
{ {
@ -279,7 +621,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "46", "balance" : "46",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" : "0xaaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa" "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" : "0xaaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa"
@ -296,7 +638,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -343,7 +685,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "46", "balance" : "46",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
"0xeeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00" : "0xaaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa" "0xeeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00" : "0xaaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa"
@ -360,7 +702,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -407,7 +749,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "46", "balance" : "46",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -423,7 +765,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -469,7 +811,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "46", "balance" : "46",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -485,7 +827,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -525,7 +867,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -541,7 +883,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -581,7 +923,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -597,7 +939,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -637,7 +979,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -653,7 +995,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -726,12 +1068,6 @@
}, },
"PostToNameRegistrator0" : { "PostToNameRegistrator0" : {
"callcreates" : [ "callcreates" : [
{
"data" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa",
"destination" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"gasLimit" : "1000000",
"value" : "23"
}
], ],
"env" : { "env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
@ -744,43 +1080,42 @@
"exec" : { "exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681", "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa60205460406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f3", "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546080",
"data" : "0x", "data" : "0x",
"gas" : "10000000000000", "gas" : "10000000000000",
"gasPrice" : "100000000000000", "gasPrice" : "100000000000000",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "100000" "value" : "100000"
}, },
"gas" : "9999998999967", "gas" : "9999999999991",
"out" : "0x", "out" : "0x",
"post" : { "post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "999999999999999977",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa60205460406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f3",
"nonce" : "0",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "46",
"code" : "0x600035560f6009590060203560003557",
"nonce" : "0",
"storage" : {
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" : "0xaaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa"
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa60205460406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f3", "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546080",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0",
"storage" : {
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546080",
"nonce" : "0",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23",
"code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -789,12 +1124,6 @@
}, },
"PostToReturn1" : { "PostToReturn1" : {
"callcreates" : [ "callcreates" : [
{
"data" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa",
"destination" : "945304eb96065b2a98b57a48a06ae28d285a71b5",
"gasLimit" : "1000000",
"value" : "23"
}
], ],
"env" : { "env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
@ -807,25 +1136,25 @@
"exec" : { "exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681", "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa60205460406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f3", "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546080",
"data" : "0x", "data" : "0x",
"gas" : "10000000000000", "gas" : "10000000000000",
"gasPrice" : "100000000000000", "gasPrice" : "100000000000000",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "100000" "value" : "100000"
}, },
"gas" : "9999998999967", "gas" : "9999999999991",
"out" : "0x", "out" : "0x",
"post" : { "post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "999999999999999977", "balance" : "1000000000000000000",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa60205460406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f3", "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546080",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "46", "balance" : "23",
"code" : "0x603760005560026000f2", "code" : "0x603760005560026000f2",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
@ -835,7 +1164,7 @@
"pre" : { "pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa60205460406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f3", "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546080",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -863,7 +1192,7 @@
"exec" : { "exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681", "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"data" : "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffafffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa", "data" : "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffafffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa",
"gas" : "10000", "gas" : "10000",
"gasPrice" : "100000000000000", "gasPrice" : "100000000000000",
@ -875,7 +1204,7 @@
"post" : { "post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa" : "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa" "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa" : "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa"
@ -885,14 +1214,14 @@
"pre" : { "pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
} }
} }
}, },
"callstatelessToNameRegistrator0" : { "callcodeToNameRegistrator0" : {
"callcreates" : [ "callcreates" : [
{ {
"data" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa", "data" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa",
@ -912,7 +1241,7 @@
"exec" : { "exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681", "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546000604060406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f4600057", "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546000604060406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f3600057",
"data" : "0x", "data" : "0x",
"gas" : "10000000000000", "gas" : "10000000000000",
"gasPrice" : "100000000000000", "gasPrice" : "100000000000000",
@ -924,7 +1253,7 @@
"post" : { "post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546000604060406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f4600057", "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546000604060406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f3600057",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
"0x" : "0x01", "0x" : "0x01",
@ -933,7 +1262,7 @@
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -942,21 +1271,21 @@
"pre" : { "pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546000604060406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f4600057", "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546000604060406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f3600057",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
}, },
"945304eb96065b2a98b57a48a06ae28d285a71b5" : { "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
} }
} }
}, },
"callstatelessToReturn1" : { "callcodeToReturn1" : {
"callcreates" : [ "callcreates" : [
{ {
"data" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa", "data" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa",
@ -976,7 +1305,7 @@
"exec" : { "exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681", "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546002600060406000601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f4600057", "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546002600060406000601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f3600057",
"data" : "0x", "data" : "0x",
"gas" : "10000000000000", "gas" : "10000000000000",
"gasPrice" : "100000000000000", "gasPrice" : "100000000000000",
@ -988,7 +1317,7 @@
"post" : { "post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546002600060406000601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f4600057", "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546002600060406000601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f3600057",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
"0x" : "0x01", "0x" : "0x01",
@ -1006,7 +1335,121 @@
"pre" : { "pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000", "balance" : "1000000000000000000",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546002600060406000601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f4600057", "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546002600060406000601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f3600057",
"nonce" : "0",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23",
"code" : "0x6001600157603760005560026000f2",
"nonce" : "0",
"storage" : {
}
}
}
},
"callstatelessToNameRegistrator0" : {
"callcreates" : [
],
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "10000000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546080600057",
"data" : "0x",
"gas" : "10000000000000",
"gasPrice" : "100000000000000",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "100000"
},
"gas" : "9999999999790",
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546080600057",
"nonce" : "0",
"storage" : {
"0x" : "0x80"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23",
"code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0",
"storage" : {
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546080600057",
"nonce" : "0",
"storage" : {
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23",
"code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0",
"storage" : {
}
}
}
},
"callstatelessToReturn1" : {
"callcreates" : [
],
"env" : {
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "256",
"currentGasLimit" : "10000000",
"currentNumber" : "0",
"currentTimestamp" : "1",
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
},
"exec" : {
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546080600057",
"data" : "0x",
"gas" : "10000000000000",
"gasPrice" : "100000000000000",
"origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "100000"
},
"gas" : "9999999999790",
"out" : "0x",
"post" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546080600057",
"nonce" : "0",
"storage" : {
"0x" : "0x80"
}
},
"945304eb96065b2a98b57a48a06ae28d285a71b5" : {
"balance" : "23",
"code" : "0x6001600157603760005560026000f2",
"nonce" : "0",
"storage" : {
}
}
},
"pre" : {
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "1000000000000000000",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000547faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020546080600057",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -1354,7 +1797,7 @@
"post" : { "post" : {
"cd1722f3947def4cf144679da39c4c32bdc35681" : { "cd1722f3947def4cf144679da39c4c32bdc35681" : {
"balance" : "1000000000000000023", "balance" : "1000000000000000023",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -1370,7 +1813,7 @@
}, },
"cd1722f3947def4cf144679da39c4c32bdc35681" : { "cd1722f3947def4cf144679da39c4c32bdc35681" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -1410,7 +1853,7 @@
}, },
"cd1722f3947def4cf144679da39c4c32bdc35681" : { "cd1722f3947def4cf144679da39c4c32bdc35681" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -1426,7 +1869,7 @@
}, },
"cd1722f3947def4cf144679da39c4c32bdc35681" : { "cd1722f3947def4cf144679da39c4c32bdc35681" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -1459,7 +1902,7 @@
"post" : { "post" : {
"cd1722f3947def4cf144679da39c4c32bdc35681" : { "cd1722f3947def4cf144679da39c4c32bdc35681" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
@ -1475,11 +1918,11 @@
}, },
"cd1722f3947def4cf144679da39c4c32bdc35681" : { "cd1722f3947def4cf144679da39c4c32bdc35681" : {
"balance" : "23", "balance" : "23",
"code" : "0x600035560f6009590060203560003557", "code" : "0x600035560f600a59005d60203560003557",
"nonce" : "0", "nonce" : "0",
"storage" : { "storage" : {
} }
} }
} }
} }
} }

View File

@ -23,8 +23,8 @@ log4j.appender.file.RollingPolicy.FileNamePattern=./logs/ethereum_%d{yyyy-MM-dd}
# filter noisy classes # filter noisy classes
log4j.logger.block = ERROR log4j.logger.block = ERROR
log4j.logger.wallet = ERROR log4j.logger.wallet = ERROR
log4j.logger.net = DEBUG log4j.logger.net = ERROR
log4j.logger.wire = DEBUG log4j.logger.wire = ERROR
log4j.logger.db = ERROR log4j.logger.db = ERROR
log4j.logger.peerdiscovery = ERROR log4j.logger.peerdiscovery = ERROR
log4j.logger.peermonitor = ERROR log4j.logger.peermonitor = ERROR
@ -33,8 +33,8 @@ log4j.logger.io.netty = ERROR
log4j.logger.VM = ERROR log4j.logger.VM = ERROR
log4j.logger.main = ERROR log4j.logger.main = ERROR
log4j.logger.trie = ERROR log4j.logger.trie = ERROR
log4j.logger.state = INFO log4j.logger.state = ERROR
log4j.logger.repository = INFO log4j.logger.repository = ERROR
log4j.logger.blockchain = INFO log4j.logger.blockchain = INFO
log4j.logger.blockqueue = ERROR log4j.logger.blockqueue = ERROR
log4j.logger.txs = ERROR log4j.logger.txs = ERROR