Skip to content

Instantly share code, notes, and snippets.

💭
<i>foo</i>

Martin Holst Swende holiman

💭
<i>foo</i>
Block or report user

Report or block holiman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@holiman
holiman / dbreads.md
Last active Apr 21, 2019
This is taken during a fast-sync, in the phase where we download state/headers/bodes/receipts simultaneously. All lines that are leveldb-internal have been removed, thus the top item is empty -- that's the internal leveldb compaction routine. The second item is the init, which reads a lot on startup but does not grow over time.
View dbreads.md

2 GB from


115 MB from

ethdb/leveldb/leveldb.go:93
core/rawdb/database.go:47
node/service.go:47
View Old chain miners.md

These blocks have been mined on the old mainnet chain, presumably having failed to update the miner software for the Constantinople fork - a waste of money...

block 7280000 miner 0x06b8c5883ec71bc3f4b332081519f23834c8706e extradata .......geth.go1.10.4.linux
block 7280001 miner 0x96338149e9f6c262d4cb7aeec1cf4c652079a11c extradata .......Parity-Ethereum.1.30.1.li
block 7280002 miner 0x28974b4a92e7be907418722b37446f2eb60184cc extradata .......geth.go1.10.linux
block 7280003 miner 0x06b8c5883ec71bc3f4b332081519f23834c8706e extradata .......geth.go1.10.4.linux
block 7280004 miner 0x96338149e9f6c262d4cb7aeec1cf4c652079a11c extradata .......Parity-Ethereum.1.30.1.li
block 7280005 miner 0x8e59176cd996342da6fdf20c85cb02bca095d552 extradata .Grupo+58
block 7280006 miner 0x96338149e9f6c262d4cb7aeec1cf4c652079a11c extradata .......Parity-Ethereum.1.30.1.li
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']
@holiman
holiman / clip.sh
Created Sep 25, 2018
best script ever, place it as `~/bin/clip`
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": "",
You can’t perform that action at this time.