Commit Graph

1130 Commits

Author SHA1 Message Date
Péter Szilágyi
a90cc66f3c
eth: check propagated block malformation on receiption 2020-01-13 14:23:54 +02:00
Péter Szilágyi
b211742e5f
Revert "eth: refactor creation of EthAPIBackend (#20476)" (#20536)
This reverts commit a1bc0e3cb6.
2020-01-09 13:26:37 +02:00
Jonathan Gimeno
a1bc0e3cb6 eth: refactor creation of EthAPIBackend (#20476) 2020-01-07 18:12:27 +01:00
Ryan Schneider
c4b7fdd27e eth, internal/web3ext: add optional first and last arguments to the admin_exportChain RPC. (#20107) 2019-12-17 12:10:14 +01:00
Felix Lange
d90d1db609
eth/filters: remove use of event.TypeMux for pending logs (#20312) 2019-12-10 12:39:14 +01:00
Martin Holst Swende
bc01593afb consensus/ethash, params: eip-2384: bump difficulty bomb (#20347)
* consensus/ethash, params: implement eip-2384: bump difficulty bomb

* params: EIP 2384 compat checks

* consensus, params: add Muir Glacier block number (mainnet,ropsten) + official name

* core/forkid: forkid tests for muir glacier

* params/config: address review concerns

* params, core/forkid: review nitpicks

* cmd/geth,eth,les: add override option for muir glacier

* params: nit fix
2019-12-06 11:36:40 +02:00
Guillaume Ballet
f5a68a40bf eth/tracers: fix staticcheck warnings (#20379) 2019-11-24 21:06:06 +01:00
Guillaume Ballet
de2259d27c travis: enable test suite on ARM64 (#20219)
* travis: Enable ARM support

* Include fixes from 20039

* Add a trace to debug the invalid lookup issue

* Try increasing the timeout to see if the arm test passes

* Investigate the resolver issue

* Increase arm64 timeout for clique test

* increase timeout in tests for arm64

* Only test the failing tests

* Review feedback: don't export epsilon

* Remove investigation tricks+include fjl's feeback

* Revert the retry ahead of using the mock resolver

* Fix rebase errors
2019-11-08 10:58:57 +02:00
Martin Holst Swende
b566cfdffd core/evm: avoid copying memory for input in calls (#20177)
* core/evm, contracts: avoid copying memory for input in calls + make ecrecover not modify input buffer

* core/vm: optimize mstore a bit

* core/vm: change Get -> GetCopy in vm memory access
2019-11-04 11:31:09 +02:00
Péter Szilágyi
64571f9379
eth: eth/64 - extend handshake packet with fork id 2019-10-29 18:04:39 +02:00
Péter Szilágyi
e306304414
Merge pull request #20204 from holiman/fix_downloader_race
eth/downloader: fix data race in downloader
2019-10-29 17:10:44 +02:00
Martin Holst Swende
3eca7b5d27
eth/downloader: fix data race in downloader 2019-10-29 14:32:45 +01:00
gary rong
ecdbb402ee trie: remove node ordering slice in sync batch (#19929)
When we flush a batch of trie nodes into database during the state
sync, we should guarantee that all children should be flushed before
parent.

Actually the trie nodes commit order is strict by: children -> parent.
But when we flush all ready nodes into db, we don't need the order
anymore since

    (1) they are all ready nodes (no more dependency)
    (2) underlying database provides write atomicity
2019-10-28 18:50:11 +01:00
Ryan Schneider
ad03d9801c internal/ethapi: support block number or hash on state-related methods (#19491)
This change adds support for EIP-1898.
2019-09-26 10:47:31 +02:00
Nguyen Kien Trung
52a967cfab eth: remove unused field (#20049) 2019-09-11 01:38:42 +03:00
Martin Holst Swende
292cf7c649
eth: disallow overwrite files via admin.exportChain 2019-08-30 10:39:29 +02:00
Péter Szilágyi
e39b2a2bde
acmd, core, eth, les: support --override.istanbul 2019-08-23 12:09:27 +03:00
Piotr Dyraga
2890f060b7
core/vm, crypto/blake2b: add BLAKE2b compression func at 0x09
The precompile at 0x09 wraps the BLAKE2b F compression function:
https://tools.ietf.org/html/rfc7693#section-3.2

The precompile requires 6 inputs tightly encoded, taking exactly 213
bytes, as explained below.

- `rounds` - the number of rounds - 32-bit unsigned big-endian word
- `h` - the state vector - 8 unsigned 64-bit little-endian words
- `m` - the message block vector - 16 unsigned 64-bit little-endian words
- `t_0, t_1` - offset counters - 2 unsigned 64-bit little-endian words
- `f` - the final block indicator flag - 8-bit word

[4 bytes for rounds][64 bytes for h][128 bytes for m][8 bytes for t_0]
[8 bytes for t_1][1 byte for f]

The boolean `f` parameter is considered as `true` if set to `1`.
The boolean `f` parameter is considered as `false` if set to `0`.
All other values yield an invalid encoding of `f` error.

The precompile should compute the F function as specified in the RFC
(https://tools.ietf.org/html/rfc7693#section-3.2) and return the updated
state vector `h` with unchanged encoding (little-endian).

See EIP-152 for details.
2019-08-21 13:09:15 +03:00
gary rong
8812c4d3f9 eth, graphql, internal/ethapi, les: polish and improve graphql (#19886) 2019-07-25 09:29:53 +03:00
gary rong
530f78e22d eth, internal, les: add getHeaderBy* APIs (#19669)
* eth, interal, les: add getHeaderBy* APIs

* internal: address the comment

* eth, internal, les: getHeader nits, missing TD, console callable
2019-07-23 16:52:24 +03:00
Christian Muehlhaeuser
a32a2b933a cmd, contracts, eth, p2p, signer, whisper: fixed ineffectual assignments (#19869)
Fixed assigning values to variables we don't end up using.
2019-07-22 13:34:41 +03:00
Kitten King
cc3ef1e4f4 cmd, crypto, eth, internals: fix Typos (#19868) 2019-07-22 10:34:33 +03:00
大彬
4ac04ae0fe all: replace fmt.Print* calls with t.Log* in tests (#19670) 2019-07-17 13:20:24 +02:00
jwasinger
6bd896a97f eth: add debug_accountRange (#17438)
This adds the debug_accountRange method which returns all accounts in
the state for a given block and transaction index.
2019-07-13 15:48:55 +02:00
cdetrio
49a7ee460e eth: fix storageRangeAt for empty blocks (#18076) 2019-07-12 17:43:07 +02:00
gary rong
252150918c cmd, eth: fix dump config issue (#19825)
* eth: fix error when dump config with nil checkpoint

* cmd/utils: ignore default datadir if it's already set.
2019-07-11 14:37:08 +03:00
Péter Szilágyi
c705aac826
cmd, eth, les: make les flags conform to dotted style 2019-07-10 09:12:07 +03:00
Péter Szilágyi
213690cdfd
cmd, eth, les: fix up ultra light config integration 2019-07-09 20:34:42 +03:00
Péter Szilágyi
a966425a1d
core: kill off managed state, use own tiny noncer for txpool 2019-07-09 10:42:09 +03:00
Péter Szilágyi
983f92368b
core/forkid: implement the forkid EIP, announce via ENR (#19738)
* eth: chain config (genesis + fork) ENR entry

* core/forkid, eth: protocol independent fork ID, update to CRC32 spec

* core/forkid, eth: make forkid a struct, next uint64, enr struct, RLP

* core/forkid: change forkhash rlp encoding from int to [4]byte

* eth: fixup eth entry a bit and update it every block

* eth: fix lint

* eth: fix crash in ethclient tests
2019-07-08 18:53:47 +03:00
Martin Holst Swende
cdfe9a3a2a eth, les: add sanity checks for unbounded block fields (#19573)
This PR adds some hardening in the lower levels of the protocol stack, to bail early on invalid data. Primarily, attacks that this PR protects against are on the "annoyance"-level, which would otherwise write a couple of megabytes of data into the log output, which is a bit resource intensive.
2019-07-08 11:42:22 +02:00
Péter Szilágyi
22411919da
cmd, eth, les, param: drop --override.constantinople 2019-07-02 14:14:59 +03:00
gary rong
f7cdea2bdc all: on-chain oracle checkpoint syncing (#19543)
* all: implement simple checkpoint syncing

cmd, les, node: remove callback mechanism

cmd, node: remove callback definition

les: simplify the registrar

les: expose checkpoint rpc services in the light client

les, light: don't store untrusted receipt

cmd, contracts, les: discard stale checkpoint

cmd, contracts/registrar: loose restriction of registeration

cmd, contracts: add replay-protection

all: off-chain multi-signature contract

params: deploy checkpoint contract for rinkeby

cmd/registrar: add raw signing mode for registrar

cmd/registrar, contracts/registrar, les: fixed messages

* cmd/registrar, contracts/registrar: fix lints

* accounts/abi/bind, les: address comments

* cmd, contracts, les, light, params: minor checkpoint sync cleanups

* cmd, eth, les, light: move checkpoint config to config file

* cmd, eth, les, params: address comments

* eth, les, params: address comments

* cmd: polish up the checkpoint admin CLI

* cmd, contracts, params: deploy new version contract

* cmd/checkpoint-admin: add another flag for clef mode signing

* cmd, contracts, les: rename and regen checkpoint oracle with abigen
2019-06-28 10:34:02 +03:00
gary rong
fd072c2fd1 eth: fix sync bloom panic (#19757)
* eth: fix sync bloom panic

* eth: delete useless test cases
2019-06-26 11:00:21 +03:00
Martin Holst Swende
1da5e0ebb0 core/state, cmd/geth: streaming json output for dump command (#15475)
* core/state, cmd/geth: streaming json output dump cmd + optional code+storage

* dump: add option to continue even if preimages are missing

* core, evm: lint nits

* cmd: use local flags for dump, omit empty code/storage

* core/state: fix state dump test
2019-06-24 17:16:44 +03:00
Péter Szilágyi
fc4fee8649
eth: enforce stricter known limits on idle peers 2019-06-12 12:30:06 +03:00
gary rong
c0a034ec89 eth, les: reject stale request (#19689)
* eth, les: reject stale request

* les: reuse local head number
2019-06-11 10:40:32 +03:00
Péter Szilágyi
b02958b9c5
core, ethdb, metrics, p2p: expose various counter metrics for grafana 2019-06-11 09:49:13 +03:00
Nguyen Kien Trung
2823ce0086 eth: check for DefaultConfig.NetworkId in test (#17599)
This makes the test work if NetworkId is changed in forks of go-ethereum.
2019-06-06 10:49:35 +02:00
gary rong
7641bbe535 eth/downloader: make syncing error more obvious (#19413) 2019-06-05 14:00:46 +02:00
gary rong
4e0c1a1a6b eth, les: reject light client connection is server is not synced (#19616)
* eth, les: reject light client connection is server is not synced

* eth, les: rename function and variables

* les: format
2019-05-26 19:15:05 +03:00
Péter Szilágyi
f35975ea21
core/rawdb, eth/downloader: align 64bit atomic fields 2019-05-17 01:45:05 +03:00
Péter Szilágyi
536b3b416c
cosensus, core, eth, params, trie: fixes + clique history cap 2019-05-16 10:39:35 +03:00
gary rong
37d280da41
core, cmd, vendor: fixes and database inspection tool (#15)
* core, eth: some fixes for freezer

* vendor, core/rawdb, cmd/geth: add db inspector

* core, cmd/utils: check ancient store path forceily

* cmd/geth, common, core/rawdb: a few fixes

* cmd/geth: support windows file rename and fix rename error

* core: support ancient plugin

* core, cmd: streaming file copy

* cmd, consensus, core, tests: keep genesis in leveldb

* core: write txlookup during ancient init

* core: bump database version
2019-05-16 10:39:34 +03:00
gary rong
80469bea0c
all: integrate the freezer with fast sync
* all: freezer style syncing

core, eth, les, light: clean up freezer relative APIs

core, eth, les, trie, ethdb, light: clean a bit

core, eth, les, light: add unit tests

core, light: rewrite setHead function

core, eth: fix downloader unit tests

core: add receipt chain insertion test

core: use constant instead of hardcoding table name

core: fix rollback

core: fix setHead

core/rawdb: remove canonical block first and then iterate side chain

core/rawdb, ethdb: add hasAncient interface

eth/downloader: calculate ancient limit via cht first

core, eth, ethdb: lots of fixes

* eth/downloader: print ancient disable log only for fast sync
2019-05-16 10:39:32 +03:00
Péter Szilágyi
006c21efc7
cmd, core, eth, les, node: chain freezer on top of db rework 2019-05-16 10:39:29 +03:00
Péter Szilágyi
9effd64290
core, eth, trie: bloom filter for trie node dedup during fast sync (#19489)
* core, eth, trie: bloom filter for trie node dedup during fast sync

* eth/downloader, trie: address review comments

* core, ethdb, trie: restart fast-sync bloom construction now and again

* eth/downloader: initialize fast sync bloom on startup

* eth: reenable eth/62 until we properly remove it
2019-05-13 15:28:01 +03:00
Felföldi Zsolt
40cdcf8c47 les, light: implement ODR transaction lookup by hash (#19069)
* les, light: implement ODR transaction lookup by hash

* les: delete useless file

* internal/ethapi: always use backend to find transaction

* les, eth, internal/ethapi: renamed GetCanonicalTransaction to GetTransaction

* light: add canonical header verification to GetTransaction
2019-05-13 14:41:10 +03:00
Péter Szilágyi
85726fdb02
eth/downloader: fix header delays during chain dedup 2019-05-07 16:09:11 +03:00
Martin Holst Swende
5036992b06 eth, les: add error when accessing missing block state (#18346)
This change makes getBalance, getCode, getStorageAt, getProof,
call, getTransactionCount return an error if the block number in
the request doesn't exist. getHeaderByNumber still returns null
for missing headers.
2019-05-02 14:50:23 +02:00