Commit Graph

403 Commits

Author SHA1 Message Date
Artem Vorotnikov
2148885637
Simplify ChangeSet implementation and tests (#1878)
* Move storage changeset code into one file

* Simplify storage changeset tests

* simplify more

* more

* more

* more

* move account changeset into one file

* simplify account changeset test

* NewStorageChangesetPlain -> NewStorageChangeSet

* EncodeStoragePlain -> EncodeStorage

* StorageChangeSetPlain -> StorageChangeSet

* AccountChangeSetPlain -> AccountChangeSet

* more

* more

* more

* Simplify EncodeStorage

* more

* Simplify FromDBFormat

* more rename

* rename changeset buckets (constant names only)
2021-05-04 13:34:08 +01:00
ledgerwatch
79055c760e
Fix for NPE in eth_getBlockByNumber (#1841)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
2021-04-29 12:34:00 +01:00
Alex Sharov
904c9148f6
rpcdaemon_panic_no_chain_id (#1813) 2021-04-26 16:47:59 +07:00
ledgerwatch
12cde41772
Aleut support (Eip1559) (#1704)
* Where I am at

* Refactoring of transaction types

* More refactoring

* Use Homested signer in rpc daemon

* Unified signer

* Continue unified signer

* A bit more

* Fixes and down the rabbit hole...

* More tx pool fixes

* More refactoring fixes

* More fixes'

* more fixes

* More fixes

* More compile fixes

* More RLP hand-writing

* Finish RLP encoding/decoding of transactions

* Fixes to header encoding, start on protocol packets

* Transaction decoding

* Use DecodeTransaction function

* Decoding BlockBodyPacket

* Encode and decode for pool txs

* Start fixing tests

* Introduce SigningHash

* Fixes to SignHash

* RLP encoding fixes

* Fixes for encoding/decoding

* More test fixes

* Fix more tests

* More test fixes

* More test fixes

* Fix core tests

* More fixes for signer

* Fix for tx

* Fixes to string encoding/size

* Fix eip2930 test

* Fix rest of ./tests

* More fixes

* Fix compilation

* More test fixes

* More test fixes

* Test fixes

* More fixes

* Reuse EncodingSize in EncodeRLP for accessList

* Rearrange things in dynamic fee tx

* Add MarshalBinary

* More fixes

* Make V,R,S non-pointers

* More NPE fixes

* More fixes

* Receipt fixes

* Fix core/types

* Fix ./eth

* More compile fixes for tests

* More test fixes

* More test fixes

* Try to see lint errors better

* Try to see lint errors better

* Fix lint

* Debugging eip1559 test

* Fix TestEIP1559Transition test

* Fix NewBlockPacket encoding/decoding

* Fix calculation of TxHash

* Fix perf problem with senders

* Update aleut config values

* Try adding static peers

* Add staticpeers to defaul flags

* Change aleut networkID

* Fix test

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-04-22 18:11:37 +01:00
Alex Sharov
5019610cfb
remove database field from Ethereum object (#1750) 2021-04-19 14:56:44 +07:00
Artem Vorotnikov
dbc0db0856
Nuke old miner and mux (#1666) 2021-04-03 13:09:31 +07:00
Alex Sharov
9a9c5b298a
bitmapdb to use rwtx (#1661) 2021-04-03 08:52:45 +07:00
Alex Sharov
fbfc43da7e
etl to use rwtx (#1660) 2021-04-02 18:22:25 +07:00
Alex Sharov
b4a2d823c4
old loader remove v1 (#1641) 2021-03-31 14:43:12 +07:00
Alex Sharov
930b9ae37c
infinite gas cap for gas estimate (#1638) 2021-03-31 11:03:52 +07:00
Artem Vorotnikov
9b8cdc0f22
Fix lints and remove more unused code (#1621) 2021-03-29 10:58:45 +07:00
Artem Vorotnikov
afe551ba1c
Remove puppeth & account management (#1610) 2021-03-26 21:05:42 +03:00
alex.sharov
e7034c0eba revert 2021-03-21 17:50:05 +07:00
alex.sharov
970c7e93a8 remove old flags 2021-03-21 17:05:42 +07:00
Alexey Sharp
1ff525e6a3 Fix lints 2021-03-18 08:00:21 +00:00
Igor Mandrigin
0a55895b33 Merge branch 'master' into geth-1-10-1 2021-03-17 16:50:20 +01:00
Igor Mandrigin
9f04cfa058 fix internal/guide tests 2021-03-16 14:16:13 +01:00
Alexey Sharp
a486baa0a0 Fixes 2021-03-15 09:50:41 +00:00
Alexey Sharp
519b19f8aa Compilation fixes 2021-03-14 08:00:37 +00:00
Alex Sharov
3f305673aa
Trie: add invariant - first level of trie must be in DB (to ensure having 100% trie structure in trie_account table) (#1522) 2021-03-13 09:30:54 +07:00
Felföldi Zsolt
d785b18d0f les: move server pool to les/vflux/client (#22377)
* les: move serverPool to les/vflux/client

* les: add metrics

* les: moved ValueTracker inside ServerPool

* les: protect against node registration before server pool is started

* les/vflux/client: fixed tests

* les: make peer registration safe
# Conflicts:
#	les/client.go
#	les/client_handler.go
#	les/peer.go
#	les/vflux/client/queueiterator_test.go
#	les/vflux/client/serverpool.go
#	les/vflux/client/serverpool_test.go
#	les/vflux/client/valuetracker.go
#	les/vflux/client/valuetracker_test.go
2021-03-12 15:41:13 +01:00
lightclient
50d975302d all: add support for EIP-2718, EIP-2930 transactions (#21502)
This adds support for EIP-2718 typed transactions as well as EIP-2930
access list transactions (tx type 1). These EIPs are scheduled for the
Berlin fork.

There very few changes to existing APIs in core/types, and several new APIs
to deal with access list transactions. In particular, there are two new
constructor functions for transactions: types.NewTx and types.SignNewTx.
Since the canonical encoding of typed transactions is not RLP-compatible,
Transaction now has new methods for encoding and decoding: MarshalBinary
and UnmarshalBinary.

The existing EIP-155 signer does not support the new transaction types.
All code dealing with transaction signatures should be updated to use the
newer EIP-2930 signer. To make this easier for future updates, we have
added new constructor functions for types.Signer: types.LatestSigner and
types.LatestSignerForChainID.

This change also adds support for the YoloV3 testnet.

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
# Conflicts:
#	accounts/abi/bind/backends/simulated.go
#	cmd/evm/internal/t8ntool/execution.go
#	cmd/evm/internal/t8ntool/transition.go
#	cmd/geth/main.go
#	cmd/geth/usage.go
#	core/bench_test.go
#	core/state/statedb.go
#	core/state_prefetcher.go
#	core/state_processor.go
#	core/state_transition.go
#	core/tx_pool.go
#	core/types/block.go
#	core/types/derive_sha.go
#	core/types/gen_tx_json.go
#	core/types/receipt.go
#	core/types/receipt_test.go
#	core/types/transaction.go
#	core/types/transaction_signing.go
#	core/types/transaction_test.go
#	ethclient/ethclient.go
#	ethclient/signer.go
#	graphql/graphql.go
#	internal/ethapi/api.go
#	internal/guide/guide_test.go
#	les/benchmark.go
#	les/odr_test.go
#	light/odr_test.go
#	light/txpool.go
#	miner/worker.go
#	miner/worker_test.go
#	signer/core/api.go
#	tests/state_test_util.go
#	trie/stacktrie_test.go
#	turbo/stages/blockchain_test.go
2021-03-12 15:40:24 +01:00
Marius van der Wijden
96a424ee84 internal/ethapi: reject non-replay-protected txs over RPC (#22339)
This PR prevents users from submitting transactions without EIP-155 enabled. This behaviour can be overridden by specifying the flag --rpc.allow-unprotected-txs=true.
# Conflicts:
#	cmd/geth/main.go
#	eth/backend.go
#	les/api_backend.go
#	les/client.go
#	node/config.go
2021-03-10 17:00:47 +01:00
Martin Holst Swende
fc0778d1f9 cmd/geth: add db commands stats, compact, put, get, delete (#22014)
This PR introduces:

- db.put to put a value into the database
- db.get to read a value from the database
- db.delete to delete a value from the database
- db.stats to check compaction info from the database
- db.compact to trigger a db compaction

It also moves inspectdb to db.inspect.
# Conflicts:
#	cmd/geth/chaincmd.go
#	cmd/geth/main.go
#	cmd/utils/flags.go
#	core/rawdb/database.go
#	ethdb/leveldb/leveldb.go
2021-03-10 16:57:59 +01:00
Sina Mahmoodi
09650bcf2b internal/debug: add switch to format logs with json (#22207)
adds a flag --log.json which if enabled makes the client format logs with JSON.
# Conflicts:
#	internal/debug/flags.go
2021-03-10 10:59:55 +01:00
Marius van der Wijden
da73189b00 internal/ethapi: fix typo in comment (#22271) 2021-03-10 10:26:47 +01:00
Marius van der Wijden
27e1102b52 internal/ethapi: comment nitpick (#22270) 2021-03-10 10:08:57 +01:00
Alex Sharov
060f3b9a60
Grafana: add Btree metrics (#1547) 2021-03-10 10:58:57 +07:00
Péter Szilágyi
951ba14b7e internal/ethapi: print tx details when submitting (#22170)
This adds more info about submitted transactions in log messages.

Co-authored-by: Felix Lange <fjl@twurst.com>
2021-03-09 12:46:49 +01:00
ligi
a7b9ff7243 cmd, geth: CLI help fixes (#22220)
* cmd, geth: Reflect command being optional - closes 22218

* cmd, geth: Set current year to 2021
2021-03-09 12:33:40 +01:00
Marius van der Wijden
9c22ecdeb8 internal/ethapi: restore net_version RPC method (#22061)
During the snap and eth refactor, the net_version rpc call was falsely deprecated.
This restores the net_version RPC handler as most eth2 nodes and other software
depend on it.
# Conflicts:
#	eth/backend.go
#	les/client.go
2021-03-09 10:05:52 +01:00
Alex Sharov
4fe019a099
add periodical db statistic metrics (#1545) 2021-03-09 13:34:13 +07:00
Péter Szilágyi
693459073e core, eth: split eth package, implement snap protocol (#21482)
This commit splits the eth package, separating the handling of eth and snap protocols. It also includes the capability to run snap sync (https://github.com/ethereum/devp2p/blob/master/caps/snap.md) , but does not enable it by default.

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Martin Holst Swende <martin@swende.se>
# Conflicts:
#	cmd/geth/misccmd.go
#	cmd/utils/flags.go
#	core/blockchain.go
#	core/blockchain_snapshot_test.go
#	core/forkid/forkid.go
#	core/rawdb/accessors_snapshot.go
#	core/rawdb/schema.go
#	core/state/snapshot/generate.go
#	core/state/statedb.go
#	eth/api_test.go
#	eth/backend.go
#	eth/downloader/downloader.go
#	eth/downloader/downloader_test.go
#	eth/downloader/modes.go
#	eth/downloader/queue.go
#	eth/downloader/statesync.go
#	eth/gen_config.go
#	eth/handler.go
#	eth/handler_test.go
#	eth/helper_test.go
#	eth/peer.go
#	eth/protocol.go
#	eth/protocol_test.go
#	eth/sync.go
#	eth/sync_test.go
#	ethstats/ethstats.go
#	les/client.go
#	les/enr_entry.go
#	les/handler_test.go
#	les/peer.go
#	les/server_handler.go
#	tests/block_test_util.go
#	trie/proof.go
#	trie/proof_test.go
#	trie/trie.go
#	turbo/trie/notary.go
#	turbo/trie/sync_bloom.go
2021-03-08 17:07:38 +01:00
Martin Holst Swende
544b92d9cd trie, rpc, cmd/geth: fix tests on 32-bit and windows + minor rpc fixes (#21871)
* trie: fix tests to work on 32-bit systems

* les: make test work on 32-bit platform

* cmd/geth: fix windows-issues on tests

* trie: improve balance

* cmd/geth: make account tests less verbose + less mem intense

* rpc: make debug-level log output less verbose

* cmd/geth: lint
# Conflicts:
#	cmd/geth/accountcmd_test.go
#	cmd/geth/les_test.go
#	cmd/geth/run_test.go
#	trie/trie_test.go
2021-03-08 12:28:54 +01:00
Alex Sharov
6d0d84cda6
log git branch and git commit (#1523) 2021-03-01 11:02:06 +07:00
Alex Sharov
f1ee8d507e
New Trie db layout - store trie structure info and multiple hashes per record (#1500)
* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* squash

* SE

* SE

* SE

* SE

* SE

* SE

* SE

* SE

* SE

* SE

* SE

* SE

* SE

* SE

* SE
2021-02-21 18:41:59 +00:00
ledgerwatch
7c81e9198d
Fixes to trace_call, trace_callMany, dual RPC daemon mode (#1491)
* Fixes to trace_call, trace_callMany, dual RPC daemon mode

* Fix compile error

* Fix compile error

* Compile error fix

* Compile error fix

* Fix typo

* Fix discrepancy when trace is empty

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2021-02-12 16:47:32 +00:00
Artem Vorotnikov
91f7798c4a
Remove hashed changesets (#1464)
* Remove hashed changesets

* try this

* oops

* simplify

* better diagnostics

* don't hash account key and use bitmap 64 to check history index

* update docs of bucket

Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
2021-02-04 12:59:04 +03:00
Alex Sharov
58c4e03861
Revert "Remove hashed changesets (#1444)" (#1446)
This reverts commit aadb6e47cc.
2021-01-20 14:16:20 +07:00
Artem Vorotnikov
aadb6e47cc
Remove hashed changesets (#1444) 2021-01-19 17:42:26 +07:00
ledgerwatch
2cc36dac87
further cleanup, unit tests for RPC daemon and tracing improvements (#1392)
* Cleanup and rpcdaemon unit tests

* Fix

* Fix

* Fix lint

* Test for debug_traceTransaction

* Add NoRefunds option

* Compile fix, test for no refunds

* Fix compile

* Add poly contract, fix compile errors

* No refunds now work

* Fix NPE in rpcdaemon

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2020-12-09 18:24:08 +00:00
Igor Mandrigin
63ec2ec9f1 post-rebase fixes 2020-12-03 18:59:17 +01:00
Felix Lange
8812a67585 build: add -dlgo flag in ci.go (#21824)
This new flag downloads a known version of Go and builds with it. This
is meant for environments where we can't easily upgrade the installed Go
version.

* .travis.yml: remove install step for PR test builders

We added this step originally to avoid re-building everything
for every test. go test has become much smarter in recent go
releases, so we no longer need to install anything here.
# Conflicts:
#	build/checksums.txt
#	build/ci.go
#	internal/build/util.go
2020-12-03 18:59:17 +01:00
Felix Lange
6dee5bbdb5 cmd/devp2p, internal/utesting: implement TAP output (#21760)
TAP is a text format for test results. Parsers for it are available in many languages,
making it easy to consume. I want TAP output from our protocol tests because the
Hive wrapper around them needs to know about the test names and their individual
results and logs. It would also be possible to just write this info as JSON, but I don't
want to invent a new format.

This also improves the normal console output for tests (when running without --tap).
It now prints -- RUN lines before any output from the test, and indents the log output
by one space.
# Conflicts:
#	cmd/devp2p/discv4cmd.go
#	cmd/devp2p/discv5cmd.go
#	cmd/devp2p/rlpxcmd.go
2020-12-03 18:59:17 +01:00
Marius van der Wijden
4f2558be98 common: remove ToHex and ToHexArray (#21610)
ToHex was deprecated a couple years ago. The last remaining use
was in ToHexArray, which itself only had a single call site.

This just moves ToHexArray near its only remaining call site and
implements it using hexutil.Encode. This changes the default behaviour
of ToHexArray and with it the behaviour of eth_getProof. Previously we
encoded an empty slice as 0, now the empty slice is encoded as 0x.
# Conflicts:
#	common/bytes.go
#	internal/ethapi/api.go
2020-12-03 18:59:17 +01:00
Alex Sharov
b3f1915d09
ChangeSets dupsort (#1342)
* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* change_set_dup

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* working version

* aa

* aa

* aa

* aa

* aa

* aa

* aa

* aa

* aa

* aa

* aa

* aa

* aa

* aa

* aa

* squash

* squash

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* history_early_stop

* history_early_stop

* vmConfig with ReadOnly false

* auto_increment

* auto_increment

* rebase master

Co-authored-by: Alexey Akhunov <akhounov@gmail.com>
2020-11-16 12:08:28 +00:00
Felix Lange
0c54d2e649 p2p/discover: implement v5.1 wire protocol (#21647)
This change implements the Discovery v5.1 wire protocol and
also adds an interactive test suite for this protocol.
# Conflicts:
#	cmd/devp2p/discv5cmd.go
#	p2p/discover/v5_encoding.go
#	p2p/discover/v5_encoding_test.go
#	p2p/discover/v5_udp.go
#	p2p/discover/v5_udp_test.go
#	p2p/discover/v5wire/session.go
2020-10-26 17:16:00 +01:00
mr_franklin
57817f3159 internal/web3ext: improve some web3 apis (#21639)
* imporve some web3-ext apis

* Update web3ext.go

Co-authored-by: Felix Lange <fjl@twurst.com>
2020-10-26 17:16:00 +01:00
mr_franklin
bcf31729f7 cmd/bootnode,internal/debug: fix some comments (#21623) 2020-10-26 17:16:00 +01:00
mr_franklin
141b59de6d internal/web3ext: improve eth_getBlockByNumber and eth_getBlockByHash console api (#21608) 2020-10-26 17:16:00 +01:00