Browse Source

Use sha3memory to avoid phoning home with huge messages.

cl-refactor
Gav Wood 10 years ago
parent
commit
3840388d20
  1. 13
      ethvm/main.cpp
  2. 7
      libethereum/Executive.cpp

13
ethvm/main.cpp

@ -28,6 +28,7 @@
#include <libethereum/State.h>
#include <libethereum/Executive.h>
#include <libevm/VM.h>
#include <libevm/VMFactory.h>
using namespace std;
using namespace dev;
using namespace eth;
@ -42,6 +43,12 @@ void help()
<< " --gas-price <n> Transaction's gas price' should be <n> (default: 0)." << endl
<< " --sender <a> Transaction sender should be <a> (default: 0000...0069)." << endl
<< " --origin <a> Transaction origin should be <a> (default: 0000...0069)." << endl
#if ETH_EVMJIT || !ETH_TRUE
<< endl
<< "VM options:" << endl
<< " -J,--jit Enable LLVM VM (default: off)." << endl
<< " --smart Enable smart VM (default: off)." << endl
#endif
<< endl
<< "Options for trace:" << endl
<< " --flat Minimal whitespace in the JSON." << endl
@ -89,6 +96,12 @@ int main(int argc, char** argv)
help();
else if (arg == "-V" || arg == "--version")
version();
#if ETH_EVMJIT
else if (arg == "-J" || arg == "--jit")
VMFactory::setKind(VMKind::JIT);
else if (arg == "--smart")
VMFactory::setKind(VMKind::Smart);
#endif
else if (arg == "--mnemonics")
st.setShowMnemonics();
else if (arg == "--flat")

7
libethereum/Executive.cpp

@ -105,7 +105,12 @@ void StandardTrace::operator()(uint64_t _steps, Instruction inst, bigint newMemS
}
if (changesMemory(lastInst) || newContext)
r["memory"] = toHex(vm.memory());
{
if (vm.memory().size() < 1024)
r["memory"] = toHex(vm.memory());
else
r["sha3memory"] = sha3(vm.memory()).hex();
}
if (changesStorage(lastInst) || newContext)
{

Loading…
Cancel
Save