Instantly share code, notes, and snippets.

View SstoreCallToSelfSubRefundBelowZero.json
{
"SstoreCallToSelfSubRefundBelowZero": {
"_info": {
"comment": "Test where accnt has slot 1 value of '2', is cleared, then calls itself and overwrites with '3', causing a refund-deduction in second call context",
"filledwith": "manaually filled by @holiman",
"lllcversion": "none",
"source": "none",
"sourceHash": "none"
},
"env": {
View result.md

parity stateroot:0xa054d80c3c6192476447b6fdb3276af19400068432949c28431e5cc3e63d3c3f,, geth stateroot: 0x3ba0188e00002fd15395c3acca8cbbca76dbe56f5f2214d7fb12c1c348aaa965

View testcase.json
trace
```
#cat /tmp/evmlab/artefacts/ropsten_mini-combined_trace.log
[*] pc 0 op PUSH1( 96) gas 0x23ccaa depth 0 stack []
[*] pc 2 op SLOAD( 84) gas 0x23cca7 depth 0 stack ['0x3']
[*] pc 3 op CALLER( 51) gas 0x23cbdf depth 0 stack ['0x0']
[*] pc 4 op ADDRESS( 48) gas 0x23cbdd depth 0 stack ['0x0', '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b']
[*] pc 5 op EQ( 20) gas 0x23cbdb depth 0 stack ['0x0', '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b', '0xe12d6474ac4964b9f23812bf3375c1fe637ad3b6']
[*] pc 6 op PUSH1( 96) gas 0x23cbd8 depth 0 stack ['0x0', '0x0']
[*] pc 8 op JUMPI( 87) gas 0x23cbd5 depth 0 stack ['0x0', '0x0', '0x1d']
View clip.sh
#!/bin/bash
# Linux version
# Use this script to pipe in/out of the clipboard
#
# Usage: someapp | clipboard # Pipe someapp's output into clipboard
# clipboard | someapp # Pipe clipboard's content into someapp
#
if command -v xclip 1>/dev/null; then
if [[ -p /dev/stdin ]] ; then
View Test_process.md

Current status and problems

Currently, tests are checked in to the tests repo, which contains several things:

  • Manually crafted tests, like bcForkBlockTestCopier.json in the src/BlockchaintestsFiller/ directory. The 'filler' directories contain various tests that are 'to be filled'.
  • Generalized state tests. These are also unfilled, and contain basically prestate, and the expect-section for various 'indexes'. Indexes are used to generalize the test. Example test 'Bazonk':
    • Run this test with gas 2000001, then 400000, on Constantinople and Homestead.
View debugger.md

Writing an EVM-debugger for Geth

This document provides some ideas on how someone fairly easily could build the basic blocks for a debugger using geth.

Integration

The tracer interface defines four methods that a 'tracer' needs to implement:

View 4byte_coverage.md

Signatures included

Not listing calls made fewer than 5 times

1177020 0xa9059cbb-64 47.53% (47.53% aggregate)
107508 0xef343588-576 4.34% (51.88% aggregate)
66946 0x23b872dd-96 2.70% (54.58% aggregate)
46585 0x095ea7b3-64 1.88% (56.46% aggregate)
39975 0x70a08231-32 1.61% (58.07% aggregate)
34695 0x2295115b-256 1.40% (59.48% aggregate)
View output.json
PREIMAGES map[]
{
"root": "d7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544",
"accounts": {
"000d836201318ec6899a67540690382780743280": {
"balance": "200000000000000000000",
"nonce": 0,
"root": "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"codeHash": "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"code": "",
View Tabularized benchmarks.md

The values above, but translated into a table

Name                                         Gascost         Time (ns)       MGas/S    Gasprice for 10MGas/S  Gas/Ideal percent
-----------------------------------------  ---------  ----------------  -----------  -----------------------  -------------------
PrecompiledEcrecover/                           3000  171600              17.4825                   1716      174.8 %
PrecompiledSha256/128                            108     675             160                           6.75   1600.0 %
PrecompiledRipeMD/128                           1080    2336             462.329                      23.36   4623.3 %
PrecompiledIdentity/128                           27      18.8          1436.17                        0.188  14361.7 %
PrecompiledModExp/eip_example1                  2611  140894              18.5317                   1408.94   185.3 %
View 10kblocks.json
{"endblock":3649998,"ids":{"0x00000000":360,"0x005b9b48":3,"0x0121b93f":3,"0x02f2008d":2,"0x03496dae":1,"0x058aace1":8,"0x05f21815":1,"0x07946f50":2,"0x07da68f5":1,"0x07daf2df":3,"0x084da883":1,"0x095ea7b3":312,"0x0a19b14a":346,"0x0d381cad":2,"0x0d59b564":1,"0x0f2c9329":3757,"0x0fb59f95":6,"0x114d081d":4,"0x11610c25":1,"0x11a125ce":4,"0x144fa6d7":2,"0x148105ab":4,"0x154652c8":3,"0x15891148":168,"0x173825d9":2,"0x17be89f0":1,"0x186f161b":11,"0x18cf4469":1,"0x19b667da":1,"0x19c12795":3,"0x1a695230":268,"0x1bbfb029":31,"0x1e9a6950":23,"0x1f21cebb":1,"0x2016890c":1,"0x20987e64":10,"0x20ba018a":1,"0x213ac932":58,"0x219f037a":3,"0x23b872dd":317,"0x257bcd6a":490,"0x25fda176":6,"0x266710ca":1,"0x269673af":1,"0x26cfd794":1,"0x278b8c0e":104,"0x27dc297e":5,"0x29b5b30c":22,"0x29cbdc86":1,"0x29ff4f53":1,"0x2bffc7ed":2,"0x2d580ef6":10,"0x2e1a7d4d":120,"0x2e92abdd":4,"0x2eaed480":1,"0x2ebec916":1,"0x2f54bf6e":1,"0x303017bd":1,"0x30301aa0":1,"0x303029ef":1,"0x30302bee":1,"0x30303614":1,"0x30303a3d":1,"0x30303c6a":1,"0x30303c