Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store code inside the account leaf #15

Closed
wants to merge 235 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
235 commits
Select commit Hold shift + click to select a range
856c379
eth: don't print db upgrade warning on db init
karalabe May 3, 2021
640d2c5
Merge pull request #22803 from karalabe/silence-scary-warning
karalabe May 4, 2021
b8040a4
cmd/utils: use eth DNS tree for snap discovery (#22808)
fjl May 4, 2021
effaf18
build: improve cross compilation setup (#22804)
fjl May 4, 2021
d107f90
go.mod: go mod tidy (#22814)
fjl May 4, 2021
973ad66
build: fix iOS framework build (#22813)
fjl May 4, 2021
3a2b29c
appveyor.yml: upgrade to VisualStudio 2019 image (#22811)
fjl May 4, 2021
41671d4
build: fix windows installer build for NSIS v3.05 (#22821)
fjl May 5, 2021
0f3a1e7
cmd/devp2p/internal/ethtest: send simultaneous requests on one connec…
renaynay May 5, 2021
991384a
params: go-ethereum v1.10.3 stable
fjl May 5, 2021
37b5595
params: begin v1.10.4 release cycle
fjl May 5, 2021
df20b3b
core/vm: avoid duplicate log in json logger (#22825)
JekaMas May 6, 2021
cc606be
all: define London+baikal, undefine yolov3, add london override flag …
holiman May 6, 2021
e69130d
core/vm, params: implement EIP 3541
chfast Apr 29, 2021
e77ef8f
Merge pull request #22809 from holiman/alt_3541
karalabe May 7, 2021
a5669ae
core, params: implement EIP-3529 (#22733)
holiman May 7, 2021
8a070e8
consensus/clique: add some missing checks (#22836)
holiman May 7, 2021
17b1be2
consensus/ethash: implement EIP-3554 (bomb delay)
holiman May 7, 2021
700df14
rlp: add support for optional struct fields (#22832)
fjl May 7, 2021
7ab7acf
build: upgrade -dlgo version to Go 1.16.4 (#22848)
sandakersmann May 10, 2021
f19a679
cmd/geth: remove reference to monitor command (#22844)
Ceelog May 10, 2021
ae5fcdc
go.mod: upgrade to github.com/holiman/uint256 v1.2.0 (#22745)
holiman May 10, 2021
c0e201b
eth/protocols/eth, les: avoid Raw() when decoding HashOrNumber (#22841)
fjl May 10, 2021
e536bb5
eth/protocols/snap: adapt to uint256 API changes (#22851)
fjl May 10, 2021
643fd0e
core/types: remove support for legacy receipt/log storage encoding (#…
fjl May 11, 2021
ca98080
cmd/geth, eth/gasprice: add configurable threshold to gas price oracl…
ryanschneider May 11, 2021
0524ced
eth/tracers: do the JSON serialization via .js to capture C faults
karalabe May 11, 2021
f34f749
Merge pull request #22857 from karalabe/tracer-stack-fix-2
karalabe May 11, 2021
a2c456a
core: ensure a broken trie invariant crashes genesis creation (#22780)
gballet May 11, 2021
1cca781
Merge pull request #22840 from holiman/eip_3554
karalabe May 12, 2021
addd882
cmd/geth, eth, core: snapshot dump + unify with trie dump (#22795)
holiman May 12, 2021
597ecb3
cmd/evm: return json error if unmarshalling from stdin fails (#22871)
lightclient May 17, 2021
14bc6e5
consensus/ethash: change eip3554 from 9.5M to 9.7M (#22870)
holiman May 17, 2021
94451c2
all: implement EIP-1559 (#22837)
holiman May 17, 2021
67e7f61
core: fix failing tests (#22888)
holiman May 17, 2021
bb9f9cc
core/rawdb: wait for background freezing to exit when closing freezer…
holiman May 17, 2021
b7a9166
core/asm: fix the bug of "00" prefix number (#22883)
Evolution404 May 18, 2021
32c1ed8
core/forkid: fix off-by-one bug (#22879)
sjb933 May 18, 2021
3e6f46c
p2p/discover/v4wire: use optional RLP field for EIP-868 seq (#22842)
fjl May 18, 2021
088da24
rlp: improve decoder stream implementation (#22858)
fjl May 18, 2021
b3a1fda
cmd/utils: expand tilde in --jspath (#22900)
lightclient May 18, 2021
3e79588
eth, p2p/msgrate: move peer QoS tracking to its own package and use i…
karalabe May 19, 2021
16bc574
p2p/dnsdisc: fix crash when iterator closed before first call to Next…
fjl May 20, 2021
a6c4627
EIP-1559: miner changes (#22896)
holiman May 21, 2021
81662fe
core/rawdb: handle prefix in table.compact method (#22911)
Evolution404 May 21, 2021
835fe06
les: generate random nums directly, not via strange conversions
karalabe May 21, 2021
6bc7278
Merge pull request #22921 from karalabe/les-simplify-reqids
karalabe May 21, 2021
59f259b
miner/stress: update stress tests (#22919)
rjl493456442 May 21, 2021
0d076d9
rlp: use atomic.Value for type cache (#22902)
fjl May 22, 2021
154ca32
rlp: optimize byte array handling (#22924)
fjl May 22, 2021
93407b1
core: make txpool free space calculation more accurate (#22933)
basdevelop May 24, 2021
017cf71
rlp, tests/fuzzers/bls12381: gofmt (#22937)
ucwong May 25, 2021
4d33de9
rlp: optimize big.Int decoding for size <= 32 bytes (#22927)
fjl May 25, 2021
836c647
eth: unregister peer only when handler exits (#22908)
fjl May 25, 2021
51b32cc
internal/ethapi: merge CallArgs and SendTxArgs (#22718)
rjl493456442 May 25, 2021
750115f
p2p/nat: skip TestUPNP in non-CI environments if discover fails (#22877)
meowsbits May 25, 2021
6c7d6cf
tests: get test name from testing.T (#22941)
jn-lp May 25, 2021
49bde05
cmd/devp2p: refactor eth test suite (#22843)
renaynay May 25, 2021
10962b6
ethstats: fix URL parser for '@' or ':' in node name/password (#21640)
meowsbits May 25, 2021
05dab7f
internal/ethapi: remove unused vm.Config parameter of DoCall (#22942)
aaronbuchwald May 26, 2021
c73652d
core/state/snapshot: fix flaky tests (#22944)
rjl493456442 May 26, 2021
5869789
ethstats: fix typo in comment (#22952)
stnbu May 26, 2021
2e7714f
cmd/utils: avoid large alloc in --dev mode (#22949)
holiman May 27, 2021
7194c84
p2p/rlpx: reduce allocation and syscalls (#22899)
fjl May 27, 2021
d836ad1
cmd/devp2p/internal/ethtest: add block hash announcement test (#22535)
renaynay May 27, 2021
0703ef6
crypto/secp256k1: fix undefined behavior in BitCurve.Add (#22621)
MariusVanDerWijden May 27, 2021
4271751
p2p/msgrate: return capacity as integer, clamp to max uint32 (#22943)
fjl May 27, 2021
04cb5e2
cmd/puppeth: remove outdated mist support (#22940)
MariusVanDerWijden May 27, 2021
ee35ddc
cmd/devp2p/internal/ethtest: ignore block announcement in tx test (#2…
fjl May 27, 2021
966ee3a
all: EIP-1559 tx pool support (#22898)
zsfelfoldi May 28, 2021
2d716c4
core: add new eip-1559 tx constraints (#22970)
zsfelfoldi May 30, 2021
08ea52e
cmd/geth, core, params: replace baikal with calaveras (#22972)
holiman May 31, 2021
9aaa420
eth/ethconfig: flip the default from fast to snap sync
karalabe May 31, 2021
2cde472
core/state: fix typos in test error message (#22962)
gballet May 31, 2021
2dee319
metrics: use golang.org/x/sys/unix to support Solaris (#22584)
dokterbob Jun 1, 2021
5cff975
core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
holiman Jun 2, 2021
7760a60
Merge pull request #22973 from karalabe/the-switch
karalabe Jun 3, 2021
216ed05
cmd/faucet: disable flaky facebook test (#22988)
holiman Jun 3, 2021
3094e7f
catalyst: runs every transaction in a snapshot in assembleBlock handl…
rjl493456442 Jun 3, 2021
7e915ee
core, eth, miner: enforce configured mining reward post 1559 too
karalabe Jun 4, 2021
71ff65b
miner/stress: add stress test for eip 1559 (#22930)
rjl493456442 Jun 4, 2021
92b8f28
Merge pull request #22995 from karalabe/enforce-miner-tip
karalabe Jun 4, 2021
08379b5
trie: remove the duplicate batch-write for 'preimage' (#23001)
Evolution404 Jun 7, 2021
0e9c7d5
tests: update for London (#22976)
holiman Jun 7, 2021
ddeeb89
go.mod: upgrade to fastcache v1.6.0 (#22982)
ucwong Jun 8, 2021
248572e
core/rawdb: db inspect move 'config' and 'shutdown' into 'meta data' …
Evolution404 Jun 8, 2021
f763846
core: make genesis parse baseFee correctly
holiman Jun 8, 2021
c503f98
all: rename internal 1559 gas fields, add support for graphql (#23010)
karalabe Jun 8, 2021
7a00378
cmd/clef, signer: support for eip-1559 txs in clef (#22966)
holiman Jun 9, 2021
f68a68a
core, internal: support various eth_call invocations post 1559
karalabe Jun 10, 2021
be1267c
eth/ethconfig: bump the RPC gas cap to 50M, since 1559 exceeds 25
karalabe Jun 10, 2021
1fc0eba
Merge pull request #23028 from karalabe/1559-rpcgascap
karalabe Jun 10, 2021
a2ea537
common: rename unused function with typo (#23025)
paularmand Jun 10, 2021
eff998e
Merge pull request #23027 from karalabe/1559-call
karalabe Jun 11, 2021
ccf53da
Merge pull request #23013 from holiman/genesis_fix
karalabe Jun 14, 2021
1d57f22
accounts/abi/bind/backends: add simulated reorgs (#22624)
ggwpez Jun 14, 2021
8a4460c
core: change baseFee into baseFeePerGas in genesis json
holiman Jun 14, 2021
7530803
Merge pull request #23039 from holiman/basefeepergas
karalabe Jun 14, 2021
087ed9c
params, core/forkid: add london testnet blocks (#23041)
holiman Jun 14, 2021
7a7abe3
accounts/abi/bind: fix bounded contracts and sim backend for 1559 (#2…
karalabe Jun 15, 2021
cdb9fef
params: bump CHTs for Geth v1.10.4
karalabe Jun 16, 2021
0aadb49
Merge pull request #23051 from karalabe/cht-1.10.4
karalabe Jun 16, 2021
aa69d36
core, graphql, internal: expose effectiveGasPrice in receipts
karalabe Jun 16, 2021
ae315ef
Merge pull request #23050 from karalabe/1559-receipt-rpc
karalabe Jun 16, 2021
080b6eb
core/vm: evm fix panic (#23047)
holiman Jun 16, 2021
a675c89
core: readded state processor error tests (#23055)
MariusVanDerWijden Jun 16, 2021
90ffcfd
travis, build: own docker builder and hub pusher
karalabe Jun 17, 2021
b28f8c0
Merge pull request #23060 from karalabe/travis-docker
karalabe Jun 17, 2021
40a11d6
travis: don't overwrite amd64 images with arm64
karalabe Jun 17, 2021
e1f244a
Merge pull request #23061 from karalabe/docker-noarm
karalabe Jun 17, 2021
aa637fd
params: release go-ethereum v1.10.4 stable
fjl Jun 17, 2021
87a11a8
params: begin v1.10.5 release cycle
fjl Jun 17, 2021
c63c2d8
accounts/abi/bind: call ensureContext on every context
nfeignon Jun 17, 2021
15fe305
core/types: add DynamicFeeTx to TxData implementation list in docs (#…
shoenseiwaso Jun 17, 2021
bbb2b30
params: fix typo in gas cost comments (#23065)
afanasy Jun 18, 2021
97ce6df
internal/ethapi: fix typo in comment (#23057)
lightclient Jun 18, 2021
58aeab7
tests: fix nil pointer panic on failure (#23053)
MariusVanDerWijden Jun 18, 2021
ef946a6
tests: fix eip1559 tx on non-eip1559 network (#23054)
MariusVanDerWijden Jun 18, 2021
e9f99d1
travis, build: add support for multi-arch docker images
karalabe Jun 18, 2021
4695117
Merge pull request #23069 from karalabe/docker-multi-arch
karalabe Jun 18, 2021
7b6c836
core: copy CliqueConfig in DeveloperGenesisBlock (#23068)
ggwpez Jun 20, 2021
732a6a3
trie: small optimization of delete in fullNode case (#22979)
Evolution404 Jun 20, 2021
f915a4b
travis: move docker steps further to prevent hanging other builders
karalabe Jun 21, 2021
da000c8
Merge pull request #23078 from karalabe/docker-post-publish
karalabe Jun 21, 2021
0f2347d
travis, Dockerfile, build: docker build and multi-arch publish combo
karalabe Jun 21, 2021
653a30f
Merge pull request #23082 from karalabe/docker-flat-publish
karalabe Jun 21, 2021
e012302
travis: enable experimental docker for manifest building
karalabe Jun 21, 2021
5228b2a
Merge pull request #23083 from karalabe/docker-fix-experimental
karalabe Jun 21, 2021
1e44c35
README: Discord server instead of gitter for communication with devs …
sachinkumarsingh092 Jun 22, 2021
fcd7bdc
Merge pull request #23062 from nfeignon/fix-abi-bind-ensure-context
karalabe Jun 22, 2021
ddf1025
accounts/abi/bind: replace context.TODO with context.Background (#23088)
gballet Jun 22, 2021
bef78ef
graphql: fix transaction API (#23052)
rjl493456442 Jun 22, 2021
a750bf8
crypto: fix build directives
holiman Jun 22, 2021
4dde066
core: transaction journal should not be executable (#23090)
nyetwurk Jun 23, 2021
10eb654
Merge pull request #23089 from holiman/fix_fuzzers
karalabe Jun 23, 2021
29905d8
eth/tracers: expose contextual infos (block hash, tx hash, tx index)
karalabe Jun 24, 2021
9e23610
Merge pull request #23104 from karalabe/tracer-context
karalabe Jun 24, 2021
948a600
eth/tracers: convert int/hash values from context into js object (#23…
williamberman Jun 25, 2021
0e69613
cmd/geth: fix IPC probe in les test (#23094)
piersy Jun 25, 2021
c07918e
eth/gasprice: fix typo in comment (#22998)
haryu703 Jun 25, 2021
bca8c03
core/state: remove unused methods ReturnGas, GetStorageProofByHash (#…
anle2022 Jun 25, 2021
2d4eff2
eth/downloader: increase downloader block body allowance (#23074)
holiman Jun 25, 2021
dde6f1e
p2p/enode: fix method doc (#23115)
ForLina Jun 28, 2021
1b5582a
core, eth: fix precompile addresses for tracers (#23097)
s1na Jun 28, 2021
35dbf7a
eth/gasprice: implement feeHistory API (#23033)
zsfelfoldi Jun 28, 2021
61f4b5a
accounts/abi/bind: fix gas price suggestion with pre EIP-1559 clients…
dahu33 Jun 29, 2021
4fcc93d
p2p/server: fix method name in comment (#23123)
Lucy-99 Jun 29, 2021
acdf923
ethclient/gethclient: RPC client wrapper for geth-specific API (#22977)
MariusVanDerWijden Jun 30, 2021
ec88bd0
cmd/geth: dont fail on deprecated toml config fields (#23118)
s1na Jun 30, 2021
e7c8693
internal/ethapi: fix panic in access list creation (#23133)
MariusVanDerWijden Jun 30, 2021
686b288
all: removed blockhash from statedb (#23126)
MariusVanDerWijden Jun 30, 2021
c131e81
eth/fetcher, trie: unit test reliability fixes (#23020)
holiman Jun 30, 2021
bbbeb7d
crypto: gofuzz build directives (#23137)
holiman Jun 30, 2021
f5f906d
eth/tracers: improve tracing performance (#23016)
holiman Jul 1, 2021
3212fb6
go.mod: update UPNP dependency (#23116)
ucwong Jul 1, 2021
6ed812d
les: avoid shutdown hang (#23139)
holiman Jul 1, 2021
a182c76
consensus/clique: avoid a copy in clique (#23149)
ucwong Jul 2, 2021
3b05318
cmd/evm, eth/ethconfig: regenerate struct codecs (#23140)
ucwong Jul 2, 2021
6b6d319
ethstats: fix full node interface post 1559
karalabe Jul 5, 2021
c619562
Merge pull request #23159 from karalabe/ethstats-fix-fullnode
karalabe Jul 5, 2021
bb0191f
dockerfile: get rid of make and env, see if that fixes builds
karalabe Jul 6, 2021
d081c93
Merge pull request #23167 from karalabe/docker-nomake
karalabe Jul 6, 2021
78c34fd
cmd/puppeth: fix dashboard crash caused by updated base image
karalabe Jul 6, 2021
9916901
Merge pull request #23168 from karalabe/puppeth-fix-dashboard
karalabe Jul 6, 2021
bd56697
core: fix bad parent hash when jumping to genesis in setHead (#23162)
rjl493456442 Jul 6, 2021
5afc82d
p2p: fix array out of bounds issue (#23165)
Evolution404 Jul 6, 2021
13bc9c0
fuzzing: fix typo in fuzzer definitions (#23169)
holiman Jul 6, 2021
d21a069
eth, miner: add RPC method to modify miner gaslimit (pre london: ceil…
holiman Jul 6, 2021
e13d14e
core/types: sanity check the basefee length inside a header (#23171)
karalabe Jul 6, 2021
5441a8f
all: remove noop vm config flags (#23111)
s1na Jul 6, 2021
b9d4412
cmd/devp2p: fixes for eth and discv4 tests (#23155)
holiman Jul 7, 2021
7522642
core/types: remove LogForStorage type (#23173)
s1na Jul 7, 2021
00b922f
core/types: go generate (#23177)
ucwong Jul 8, 2021
ff4ff30
core, params: define london block at 12965000 (#23176)
holiman Jul 8, 2021
dea7155
eth/gasprice, internal/ethapi, miner: minor feehistory fixes
karalabe Jul 8, 2021
9624f92
Merge pull request #23178 from karalabe/feeapi-fixes
karalabe Jul 9, 2021
afd4227
params: update CHTs for the 1.10.5 release
karalabe Jul 9, 2021
58b0420
Merge pull request #23183 from karalabe/cht-1.10.5
karalabe Jul 12, 2021
8fe47b0
core/state: avoid unnecessary alloc in trie prefetcher (#23198)
MariusVanDerWijden Jul 12, 2021
846badc
internal/ethapi: fix transaction APIs (#23179)
rjl493456442 Jul 13, 2021
c49e065
internal: get pending and queued transaction by address (#22992)
markya0616 Jul 13, 2021
b9e6e43
consensus/clique: implement getSigner API method (#22987)
MariusVanDerWijden Jul 13, 2021
1fac96c
internal/web3ext: remove unused console APIs (#23208)
rjl493456442 Jul 14, 2021
33ca98e
params: release Geth v1.10.5, Exodus Cluster
karalabe Jul 14, 2021
f0b1bdd
params: begin v1.10.6 release cycle
karalabe Jul 14, 2021
89fde59
node: fix stopping websocket rpc.Server (#23211)
Evolution404 Jul 15, 2021
a5e3aa6
eth/tracers: fix typo in test name (#23218)
aaronbuchwald Jul 15, 2021
f05419f
les: fix eth_sendTransaction API (#23215)
rjl493456442 Jul 15, 2021
97aacd9
core: fix pre-check for account balance under EIP-1559 (#23244)
MariusVanDerWijden Jul 22, 2021
370680a
core/types: revert removal of legacy receipt support (#23247)
rjl493456442 Jul 22, 2021
576681f
params: release go-ethereum v1.10.6 stable
fjl Jul 22, 2021
a1f16bc
params: begin v1.10.7 release cycle
fjl Jul 22, 2021
bbfa648
Use `hexutil.Uint` for `blockCount` parameter in `feeHistory` method …
lightclient Jul 27, 2021
5c89ec9
cmd/geth: update vulnerability testdata (#23252)
holiman Jul 27, 2021
b20bc5c
accounts/abi/bind: parse ABI only once, create metadata struct (#22583)
MariusVanDerWijden Jul 27, 2021
3aea432
accounts/abi/bind: set Context in TransactOpts (#23188)
MariusVanDerWijden Jul 27, 2021
2faf796
internal/ethapi: fix panic in accesslist creation (#23225)
MariusVanDerWijden Jul 28, 2021
0730acc
consensus/ethash: less allocation during mining (#23199)
fxfactorial Jul 28, 2021
56e9001
README: fix default sync mode (#23282)
ligi Jul 28, 2021
523866c
all: change blacklist terms
baptiste-b-pegasys Jul 29, 2021
5c13012
accounts/external, internal/ethapi: fixes for London tx signing (#23…
holiman Jul 29, 2021
fb8ea59
tests: update tests/testdata to v9.0.4 (london) (#23279)
MariusVanDerWijden Jul 29, 2021
64a5e12
go.mod: upgrade to goupnp v1.0.2 (#23197)
ucwong Jul 29, 2021
b157bae
go.mod: bump golang.org/x/text to v0.3.6 (#23291)
s1na Jul 29, 2021
8f11d27
p2p/simulations: fix unlikely crash in probabilistic connect (#23200)
Evolution404 Jul 29, 2021
295bc35
signer/core: move API JSON types to separate package (#23275)
holiman Jul 29, 2021
3526f69
all: remove term "whitelist" in comments and log messages (#23294)
baptiste-b-pegasys Jul 29, 2021
860184d
p2p: remove term "whitelist" (#23295)
baptiste-b-pegasys Jul 29, 2021
85afdee
tests: remove whitelist feature (#23297)
baptiste-b-pegasys Jul 29, 2021
95bbd46
node, cmd/clef: remove term "whitelist" (#23296)
baptiste-b-pegasys Aug 2, 2021
82c5085
cre/state: fix outdated statedb Prepare comment (#23320)
aaronbuchwald Aug 3, 2021
4cd6a14
cmd/devp2p: fix ping/pong race in discv4 tests (#23306)
holiman Aug 3, 2021
c38fab9
core: get header from block cache (#23299)
s1na Aug 3, 2021
f311488
internal/ethapi: fix trace log marshalling (#23292)
rjl493456442 Aug 3, 2021
28ba686
core/state: add trie prefetcher tests (#23216)
MariusVanDerWijden Aug 3, 2021
d3e3a46
core/rawdb: fix logs to print block number, not address (#23328)
patrick-ogrady Aug 4, 2021
d8bfb84
verkle: Implement Trie, NodeIterator and Database ifs
gballet May 6, 2021
990a0cc
Fix crash in TestDump
gballet May 6, 2021
e09dc6d
Fix TestDump
gballet May 7, 2021
c9a8a63
Fix TrieCopy
gballet May 7, 2021
cd33394
remove unnecessary traces
gballet May 11, 2021
e3b8c1b
fix: Error() returned errIteratorEnd in verkle node iterator
gballet May 25, 2021
2743b6c
rewrite the iterator and change the signature of OpenStorageTrie
gballet May 26, 2021
5f32bbe
add the adapter to reuse the account trie for storage
gballet May 26, 2021
4d27208
don't try to deserialize a storage leaf into an account
gballet May 27, 2021
93cf056
Fix statedb unit tests (#14)
gballet May 31, 2021
762012c
One tree to rule them all
gballet Jun 2, 2021
2d957b8
remove updateRoot, there is no root to update
gballet Jun 2, 2021
cddd657
store code inside the account leaf
gballet Jun 11, 2021
e4e1ce5
fix build
gballet Jun 16, 2021
cf4ea4e
save current state for Sina
gballet Jun 17, 2021
d1eca8e
Update go-verkle to latest
gballet Aug 5, 2021
c633aa2
Charge WITNESS_*_COST gas on storage loads
gballet Aug 6, 2021
09310c8
Add witness costs for SSTORE as well
gballet Aug 6, 2021
2e43af8
Charge witness gas in the case of code execution
gballet Aug 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cmd/geth, eth, core: snapshot dump + unify with trie dump (ethereum#2…
…2795)

* cmd/geth, eth, core: snapshot dump + unify with trie dump

* cmd/evm: dump API fixes

* cmd/geth, core, eth: fix some remaining errors

* cmd/evm: dump - add limit, support address startkey, address review concerns

* cmd, core/state, eth: minor polishes, fix snap dump crash, unify format

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
  • Loading branch information
holiman and karalabe committed May 12, 2021
commit addd8824cf3ad6133c1b1bbc3387a621eafba6a3
7 changes: 3 additions & 4 deletions cmd/evm/internal/t8ntool/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,15 @@ func Main(ctx *cli.Context) error {
// Iterate over all the tests, run them and aggregate the results

// Run the test and aggregate the result
state, result, err := prestate.Apply(vmConfig, chainConfig, txs, ctx.Int64(RewardFlag.Name), getTracer)
s, result, err := prestate.Apply(vmConfig, chainConfig, txs, ctx.Int64(RewardFlag.Name), getTracer)
if err != nil {
return err
}
body, _ := rlp.EncodeToBytes(txs)
// Dump the excution result
collector := make(Alloc)
state.DumpToCollector(collector, false, false, false, nil, -1)
s.DumpToCollector(collector, nil)
return dispatchOutput(ctx, baseDir, result, collector, body)

}

// txWithKey is a helper-struct, to allow us to use the types.Transaction along with
Expand Down Expand Up @@ -303,7 +302,7 @@ func (g Alloc) OnAccount(addr common.Address, dumpAccount state.DumpAccount) {
}
}
genesisAccount := core.GenesisAccount{
Code: common.FromHex(dumpAccount.Code),
Code: dumpAccount.Code,
Storage: storage,
Balance: balance,
Nonce: dumpAccount.Nonce,
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func runCmd(ctx *cli.Context) error {
if ctx.GlobalBool(DumpFlag.Name) {
statedb.Commit(true)
statedb.IntermediateRoot(true)
fmt.Println(string(statedb.Dump(false, false, true)))
fmt.Println(string(statedb.Dump(nil)))
}

if memProfilePath := ctx.GlobalString(MemProfileFlag.Name); memProfilePath != "" {
Expand Down
10 changes: 5 additions & 5 deletions cmd/evm/staterunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ func stateTestCmd(ctx *cli.Context) error {
for _, st := range test.Subtests() {
// Run the test and aggregate the result
result := &StatetestResult{Name: key, Fork: st.Fork, Pass: true}
_, state, err := test.Run(st, cfg, false)
_, s, err := test.Run(st, cfg, false)
// print state root for evmlab tracing
if ctx.GlobalBool(MachineFlag.Name) && state != nil {
fmt.Fprintf(os.Stderr, "{\"stateRoot\": \"%x\"}\n", state.IntermediateRoot(false))
if ctx.GlobalBool(MachineFlag.Name) && s != nil {
fmt.Fprintf(os.Stderr, "{\"stateRoot\": \"%x\"}\n", s.IntermediateRoot(false))
}
if err != nil {
// Test failed, mark as so and dump any state to aid debugging
result.Pass, result.Error = false, err.Error()
if ctx.GlobalBool(DumpFlag.Name) && state != nil {
dump := state.RawDump(false, false, true)
if ctx.GlobalBool(DumpFlag.Name) && s != nil {
dump := s.RawDump(nil)
result.State = &dump
}
}
Expand Down
112 changes: 78 additions & 34 deletions cmd/geth/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package main

import (
"encoding/json"
"errors"
"fmt"
"os"
"runtime"
Expand All @@ -27,12 +28,16 @@ import (

"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/node"
"gopkg.in/urfave/cli.v1"
)

Expand Down Expand Up @@ -152,20 +157,21 @@ The export-preimages command export hash preimages to an RLP encoded stream`,
Action: utils.MigrateFlags(dump),
Name: "dump",
Usage: "Dump a specific block from storage",
ArgsUsage: "[<blockHash> | <blockNum>]...",
ArgsUsage: "[? <blockHash> | <blockNum>]",
Flags: []cli.Flag{
utils.DataDirFlag,
utils.CacheFlag,
utils.SyncModeFlag,
utils.IterativeOutputFlag,
utils.ExcludeCodeFlag,
utils.ExcludeStorageFlag,
utils.IncludeIncompletesFlag,
utils.StartKeyFlag,
utils.DumpLimitFlag,
},
Category: "BLOCKCHAIN COMMANDS",
Description: `
The arguments are interpreted as block numbers or hashes.
Use "ethereum dump 0" to dump the genesis block.`,
This command dumps out the state for a given block (or latest, if none provided).
`,
}
)

Expand Down Expand Up @@ -373,47 +379,85 @@ func exportPreimages(ctx *cli.Context) error {
return nil
}

func dump(ctx *cli.Context) error {
stack, _ := makeConfigNode(ctx)
defer stack.Close()

func parseDumpConfig(ctx *cli.Context, stack *node.Node) (*state.DumpConfig, ethdb.Database, common.Hash, error) {
db := utils.MakeChainDatabase(ctx, stack, true)
for _, arg := range ctx.Args() {
var header *types.Header
var header *types.Header
if ctx.NArg() > 1 {
return nil, nil, common.Hash{}, fmt.Errorf("expected 1 argument (number or hash), got %d", ctx.NArg())
}
if ctx.NArg() == 1 {
arg := ctx.Args().First()
if hashish(arg) {
hash := common.HexToHash(arg)
number := rawdb.ReadHeaderNumber(db, hash)
if number != nil {
if number := rawdb.ReadHeaderNumber(db, hash); number != nil {
header = rawdb.ReadHeader(db, hash, *number)
} else {
return nil, nil, common.Hash{}, fmt.Errorf("block %x not found", hash)
}
} else {
number, _ := strconv.Atoi(arg)
hash := rawdb.ReadCanonicalHash(db, uint64(number))
if hash != (common.Hash{}) {
header = rawdb.ReadHeader(db, hash, uint64(number))
}
}
if header == nil {
fmt.Println("{}")
utils.Fatalf("block not found")
} else {
state, err := state.New(header.Root, state.NewDatabase(db), nil)
number, err := strconv.Atoi(arg)
if err != nil {
utils.Fatalf("could not create new state: %v", err)
return nil, nil, common.Hash{}, err
}
excludeCode := ctx.Bool(utils.ExcludeCodeFlag.Name)
excludeStorage := ctx.Bool(utils.ExcludeStorageFlag.Name)
includeMissing := ctx.Bool(utils.IncludeIncompletesFlag.Name)
if ctx.Bool(utils.IterativeOutputFlag.Name) {
state.IterativeDump(excludeCode, excludeStorage, !includeMissing, json.NewEncoder(os.Stdout))
if hash := rawdb.ReadCanonicalHash(db, uint64(number)); hash != (common.Hash{}) {
header = rawdb.ReadHeader(db, hash, uint64(number))
} else {
if includeMissing {
fmt.Printf("If you want to include accounts with missing preimages, you need iterative output, since" +
" otherwise the accounts will overwrite each other in the resulting mapping.")
}
fmt.Printf("%v %s\n", includeMissing, state.Dump(excludeCode, excludeStorage, false))
return nil, nil, common.Hash{}, fmt.Errorf("header for block %d not found", number)
}
}
} else {
// Use latest
header = rawdb.ReadHeadHeader(db)
}
if header == nil {
return nil, nil, common.Hash{}, errors.New("no head block found")
}
startArg := common.FromHex(ctx.String(utils.StartKeyFlag.Name))
var start common.Hash
switch len(startArg) {
case 0: // common.Hash
case 32:
start = common.BytesToHash(startArg)
case 20:
start = crypto.Keccak256Hash(startArg)
log.Info("Converting start-address to hash", "address", common.BytesToAddress(startArg), "hash", start.Hex())
default:
return nil, nil, common.Hash{}, fmt.Errorf("invalid start argument: %x. 20 or 32 hex-encoded bytes required", startArg)
}
var conf = &state.DumpConfig{
SkipCode: ctx.Bool(utils.ExcludeCodeFlag.Name),
SkipStorage: ctx.Bool(utils.ExcludeStorageFlag.Name),
OnlyWithAddresses: !ctx.Bool(utils.IncludeIncompletesFlag.Name),
Start: start.Bytes(),
Max: ctx.Uint64(utils.DumpLimitFlag.Name),
}
log.Info("State dump configured", "block", header.Number, "hash", header.Hash().Hex(),
"skipcode", conf.SkipCode, "skipstorage", conf.SkipStorage,
"start", hexutil.Encode(conf.Start), "limit", conf.Max)
return conf, db, header.Root, nil
}

func dump(ctx *cli.Context) error {
stack, _ := makeConfigNode(ctx)
defer stack.Close()

conf, db, root, err := parseDumpConfig(ctx, stack)
if err != nil {
return err
}
state, err := state.New(root, state.NewDatabase(db), nil)
if err != nil {
return err
}
if ctx.Bool(utils.IterativeOutputFlag.Name) {
state.IterativeDump(conf, json.NewEncoder(os.Stdout))
} else {
if conf.OnlyWithAddresses {
fmt.Fprintf(os.Stderr, "If you want to include accounts with missing preimages, you need iterative output, since"+
" otherwise the accounts will overwrite each other in the resulting mapping.")
return fmt.Errorf("incompatible options")
}
fmt.Println(string(state.Dump(conf)))
}
return nil
}
Expand Down
97 changes: 97 additions & 0 deletions cmd/geth/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ package main

import (
"bytes"
"encoding/json"
"errors"
"os"
"time"

"github.com/ethereum/go-ethereum/cmd/utils"
Expand Down Expand Up @@ -142,6 +144,31 @@ verification. The default checking target is the HEAD state. It's basically iden
to traverse-state, but the check granularity is smaller.

It's also usable without snapshot enabled.
`,
},
{
Name: "dump",
Usage: "Dump a specific block from storage (same as 'geth dump' but using snapshots)",
ArgsUsage: "[? <blockHash> | <blockNum>]",
Action: utils.MigrateFlags(dumpState),
Category: "MISCELLANEOUS COMMANDS",
Flags: []cli.Flag{
utils.DataDirFlag,
utils.AncientFlag,
utils.RopstenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
utils.ExcludeCodeFlag,
utils.ExcludeStorageFlag,
utils.StartKeyFlag,
utils.DumpLimitFlag,
},
Description: `
This command is semantically equivalent to 'geth dump', but uses the snapshots
as the backend data source, making this command a lot faster.

The argument is interpreted as block number or hash. If none is provided, the latest
block is used.
`,
},
},
Expand Down Expand Up @@ -430,3 +457,73 @@ func parseRoot(input string) (common.Hash, error) {
}
return h, nil
}

func dumpState(ctx *cli.Context) error {
stack, _ := makeConfigNode(ctx)
defer stack.Close()

conf, db, root, err := parseDumpConfig(ctx, stack)
if err != nil {
return err
}
snaptree, err := snapshot.New(db, trie.NewDatabase(db), 256, root, false, false, false)
if err != nil {
return err
}
accIt, err := snaptree.AccountIterator(root, common.BytesToHash(conf.Start))
if err != nil {
return err
}
defer accIt.Release()

log.Info("Snapshot dumping started", "root", root)
var (
start = time.Now()
logged = time.Now()
accounts uint64
)
enc := json.NewEncoder(os.Stdout)
enc.Encode(struct {
Root common.Hash `json:"root"`
}{root})
for accIt.Next() {
account, err := snapshot.FullAccount(accIt.Account())
if err != nil {
return err
}
da := &state.DumpAccount{
Balance: account.Balance.String(),
Nonce: account.Nonce,
Root: account.Root,
CodeHash: account.CodeHash,
SecureKey: accIt.Hash().Bytes(),
}
if !conf.SkipCode && !bytes.Equal(account.CodeHash, emptyCode) {
da.Code = rawdb.ReadCode(db, common.BytesToHash(account.CodeHash))
}
if !conf.SkipStorage {
da.Storage = make(map[common.Hash]string)

stIt, err := snaptree.StorageIterator(root, accIt.Hash(), common.Hash{})
if err != nil {
return err
}
for stIt.Next() {
da.Storage[stIt.Hash()] = common.Bytes2Hex(stIt.Slot())
}
}
enc.Encode(da)
accounts++
if time.Since(logged) > 8*time.Second {
log.Info("Snapshot dumping in progress", "at", accIt.Hash(), "accounts", accounts,
"elapsed", common.PrettyDuration(time.Since(start)))
logged = time.Now()
}
if conf.Max > 0 && accounts >= conf.Max {
break
}
}
log.Info("Snapshot dumping complete", "accounts", accounts,
"elapsed", common.PrettyDuration(time.Since(start)))
return nil
}
12 changes: 11 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ var (
Name: "exitwhensynced",
Usage: "Exits after block synchronisation completes",
}
IterativeOutputFlag = cli.BoolFlag{
IterativeOutputFlag = cli.BoolTFlag{
Name: "iterative",
Usage: "Print streaming JSON iteratively, delimited by newlines",
}
Expand All @@ -200,6 +200,16 @@ var (
Name: "nocode",
Usage: "Exclude contract code (save db lookups)",
}
StartKeyFlag = cli.StringFlag{
Name: "start",
Usage: "Start position. Either a hash or address",
Value: "0x0000000000000000000000000000000000000000000000000000000000000000",
}
DumpLimitFlag = cli.Uint64Flag{
Name: "limit",
Usage: "Max number of elements (0 = no limit)",
Value: 0,
}
defaultSyncMode = ethconfig.Defaults.SyncMode
SyncModeFlag = TextMarshalerFlag{
Name: "syncmode",
Expand Down
Loading