Commit Graph
100 Commits
Author SHA1 Message Date
Zsolt Felfoldi 0de9f32ae8 les: backported new SendTx cost calculation 2019-04-10 13:12:42 +02:00
Felföldi ZsoltandFelix Lange d9a07fba67 params: new CHTs (#18577) 2019-01-29 17:50:20 +01:00
Felföldi ZsoltandPéter Szilágyi f0515800e6 les: fix fetcher syncing logic (#18072) 2018-11-26 13:34:33 +02:00
Felföldi ZsoltandPéter Szilágyi 9d06b2c5f3 core: use ChainHeadEvent subscription in the chain indexer (#17826) 2018-10-03 17:25:25 +03:00
Felföldi ZsoltandMartin Holst Swende b7bbe66b19 les: limit state ODR retrievals to the last 100 blocks (#17744) 2018-10-01 15:14:53 +02:00
Felföldi ZsoltandPéter Szilágyi ab13cd9924 les: fix invalid delivery handling in retriever (#17727) 2018-09-21 10:59:21 +03:00
Felföldi ZsoltandPéter Szilágyi c37238cae9 les: fix retriever logic (#17705) 2018-09-20 10:46:39 +03:00
Felföldi ZsoltandFelix Lange d4a28a13ca les: fix distReq.sentChn double close bug (#17639) 2018-09-14 22:14:29 +02:00
Felföldi ZsoltandPéter Szilágyi 63352bf424 core: safe indexer operation when syncing starts before the checkpoint (#17511) 2018-08-28 10:31:34 +03:00
Felföldi ZsoltandPéter Szilágyi 355fc47d39 les: fix CHT field in nodeInfo (#17465) 2018-08-21 14:58:10 +03:00
Felföldi ZsoltandPéter Szilágyi 1de9ada401 light: new CHTs (#17448) 2018-08-20 16:49:28 +03:00
Felföldi ZsoltandFelix Lange 2cdf6ee7e0 light: CHT and bloom trie indexers working in light mode (#16534)
This PR enables the indexers to work in light client mode by
downloading a part of these tries (the Merkle proofs of the last
values of the last known section) in order to be able to add new
values and recalculate subsequent hashes. It also adds CHT data to
NodeInfo.
2018-08-15 22:25:46 +02:00
Felföldi ZsoltandFelix Lange b52bb31b76 p2p/discv5: add delay to refresh cycle when no seed nodes are found (#16994) 2018-08-14 22:59:18 +02:00
Felföldi ZsoltandFelix Lange b2ddb1fcbf les: implement client connection logic (#16899)
This PR implements les.freeClientPool. It also adds a simulated clock
in common/mclock, which enables time-sensitive tests to run quickly
and still produce accurate results, and package common/prque which is
a generalised variant of prque that enables removing elements other
than the top one from the queue.

les.freeClientPool implements a client database that limits the
connection time of each client and manages accepting/rejecting
incoming connections and even kicking out some connected clients. The
pool calculates recent usage time for each known client (a value that
increases linearly when the client is connected and decreases
exponentially when not connected). Clients with lower recent usage are
preferred, unknown nodes have the highest priority. Already connected
nodes receive a small bias in their favor in order to avoid accepting
and instantly kicking out clients.

Note: the pool can use any string for client identification. Using
signature keys for that purpose would not make sense when being known
has a negative value for the client. Currently the LES protocol
manager uses IP addresses (without port address) to identify clients.
2018-08-14 22:44:46 +02:00
Felföldi ZsoltandPéter Szilágyi eef65b20fc p2p: use safe atomic operations when changing connFlags (#17325) 2018-08-06 15:46:30 +03:00
Felföldi ZsoltandGitHub c4df67461f Merge pull request #16333 from shazow/addremovetrustedpeer
rpc: Add admin_addTrustedPeer and admin_removeTrustedPeer.
2018-08-06 13:30:04 +02:00
Felföldi ZsoltandPéter Szilágyi 51df1c1f20 les: add announcement safety check to light fetcher (#17034) 2018-07-04 13:40:20 +03:00
Felföldi ZsoltandPéter Szilágyi f524ec4326 light: new CHTs (#17124) 2018-07-04 12:41:17 +03:00
Felföldi ZsoltandFelix Lange 25982375a8 les: fix retriever logic (#16776)
This PR fixes a retriever logic bug. When a peer had a soft timeout
and then a response arrived, it always assumed it was the same peer
even though it could have been a later requested one that did not time
out at all yet. In this case the logic went to an illegal state and
deadlocked, causing a goroutine leak.

Fixes #16243 and replaces #16359.
Thanks to @riceke for finding the bug in the logic.
2018-06-12 15:58:47 +02:00
Felföldi ZsoltandPéter Szilágyi 049f5b3572 core, eth, les: more efficient hash-based header chain retrieval (#16946) 2018-06-12 16:52:54 +03:00
Felföldi ZsoltandPéter Szilágyi 546d42179e les: pass server pool to protocol manager (#16947) 2018-06-12 14:00:52 +03:00
Felföldi ZsoltandPéter Szilágyi 2977538ac0 light: new CHTs for mainnet and ropsten (#16926) 2018-06-11 10:38:05 +03:00
Felföldi ZsoltandPéter Szilágyi a5237a27ea les: add Skip overflow check to GetBlockHeadersMsg handler (#16891) 2018-06-05 10:23:00 +03:00
Felföldi ZsoltandPéter Szilágyi 595b47e535 light: new CHT for mainnet and ropsten (#16736) 2018-05-14 12:23:58 +03:00
Felföldi ZsoltandPéter Szilágyi 92c6d13083 light: new CHTs (#16515) 2018-04-17 09:33:31 +03:00
Felföldi ZsoltandPéter Szilágyi 45bd4fedde light: new CHT for ropsten (#16393) 2018-03-27 10:09:15 +03:00
Felföldi ZsoltandPéter Szilágyi 1488fdaf19 cmd/utils: fix maxpeers vs lightpeers logic (#16125) 2018-03-09 11:55:03 +02:00
Felföldi ZsoltandFelix Lange 5ad7b9123c light: new CHTs (#16233) 2018-03-03 00:52:54 +01:00
Felföldi ZsoltandPéter Szilágyi 1bdde620da les: fix light fetcher database race (#16103)
* les: fix light fetcher database race

* les: lightFetcher comments
2018-02-19 10:41:30 +02:00
Felföldi ZsoltandPéter Szilágyi 8d32c4b990 light: new CHTs (#16074) 2018-02-12 18:03:17 +02:00
Felföldi ZsoltandPéter Szilágyi 2f849ade82 les: fix server panic when discovery disabled (#16055) 2018-02-10 14:33:52 +02:00
Felföldi ZsoltandPéter Szilágyi c4712bf96b p2p/discv5: fix multiple discovery issues (#16036)
* p2p/discv5: add query delay, fix node address update logic, retry refresh if empty

* p2p/discv5: remove unnecessary ping before topic query

* p2p/discv5: do not filter local address from topicNodes

* p2p/discv5: remove canQuery()

* p2p/discv5: gofmt
2018-02-08 19:06:31 +02:00
Felföldi ZsoltandPéter Szilágyi c3f238dd53 les: limit LES peer count and improve peer configuration logic (#16010)
* les: limit number of LES connections

* eth, cmd/utils: light vs max peer configuration logic
2018-02-05 15:41:53 +02:00
Felföldi ZsoltandPéter Szilágyi 6198c53e28 p2p/discv5: fix removeTicketRef cached ticket removal (#15995) 2018-01-30 18:01:22 +02:00
Felföldi ZsoltandPéter Szilágyi 23bca0f374 les: fix TxStatusMsg RLP coding (#15974) 2018-01-26 19:30:45 +02:00
Felföldi ZsoltandPéter Szilágyi c335821479 cmd, params: update discovery v5 bootnodes (#15954) 2018-01-25 12:25:00 +02:00
Felföldi ZsoltandPéter Szilágyi ec96216d16 Chain indexer fix + new CHT (#15934)
* core, light: fix chain indexer bug

* light: add new CHT
2018-01-23 13:10:49 +02:00
Felföldi ZsoltandPéter Szilágyi 397c6cde1e p2p/discv5: fix topic register panic at shutdown (#15946) 2018-01-23 12:53:09 +02:00
Felföldi ZsoltandFelix Lange 92580d69d3 p2p, p2p/discover, p2p/discv5: implement UDP port sharing (#15200)
This commit affects p2p/discv5 "topic discovery" by running it on
the same UDP port where the old discovery works. This is realized
by giving an "unhandled" packet channel to the old v4 discovery
packet handler where all invalid packets are sent. These packets
are then processed by v5. v5 packets are always invalid when
interpreted by v4 and vice versa. This is ensured by adding one
to the first byte of the packet hash in v5 packets.

DiscoveryV5Bootnodes is also changed to point to new bootnodes
that are implementing the changed packet format with modified
hash. Existing and new v5 bootnodes are both running on different
ports ATM.
2018-01-22 13:38:34 +01:00
Felföldi ZsoltandFelix Lange 83d1657444 les: fix les/1 CHT compatibility issue (#15692) 2018-01-09 11:41:59 +01:00
Zsolt Felfoldi 48648bc2f8 contracts/release: do not print error log if les backend has no peers 2017-12-18 16:26:17 +01:00
Felföldi ZsoltandPéter Szilágyi 8d434f6a6f les, core/bloombits: post-LES/2 fixes (#15391)
* les: fix topic ID

* core/bloombits: fix interface conversion
2017-10-27 17:18:53 +03:00
Felföldi ZsoltandFelix Lange ca376ead88 les, light: LES/2 protocol version (#14970)
This PR implements the new LES protocol version extensions:

* new and more efficient Merkle proofs reply format (when replying to
  a multiple Merkle proofs request, we just send a single set of trie
  nodes containing all necessary nodes)
* BBT (BloomBitsTrie) works similarly to the existing CHT and contains
  the bloombits search data to speed up log searches
* GetTxStatusMsg returns the inclusion position or the
  pending/queued/unknown state of a transaction referenced by hash
* an optional signature of new block data (number/hash/td) can be
  included in AnnounceMsg to provide an option for "very light
  clients" (mobile/embedded devices) to skip expensive Ethash check
  and accept multiple signatures of somewhat trusted servers (still a
  lot better than trusting a single server completely and retrieving
  everything through RPC). The new client mode is not implemented in
  this PR, just the protocol extension.
2017-10-24 15:19:09 +02:00
Zsolt Felfoldi 7a7f6a4f29 light: new CHTs for mainnet and ropsten 2017-09-11 23:36:16 +02:00
Zsolt FelfoldiandPéter Szilágyi 451ffdb62b core/bloombits: use general filters instead of addresses and topics 2017-09-06 11:14:21 +03:00
Zsolt FelfoldiandPéter Szilágyi 6ff2c02991 core/bloombits: AddBloom index parameter and fixes variable names 2017-09-06 11:14:20 +03:00
Zsolt FelfoldiandPéter Szilágyi 4ea4d2dc34 core, eth: add bloombit indexer, filter based on it 2017-09-06 11:13:13 +03:00
Felföldi ZsoltandPéter Szilágyi fff6e03a79 les: fix megacheck warnings (#14941)
* les: fix megacheck warnings

* les: fixed testGetProofs
2017-08-08 19:31:08 +03:00
Zsolt FelfoldiandPéter Szilágyi bd74882d83 core: implement ChainIndexer 2017-08-07 17:37:08 +03:00
Felföldi ZsoltandFelix Lange a5d08c893d les: code refactoring (#14416)
This commit does various code refactorings:

- generalizes and moves the request retrieval/timeout/resend logic out of LesOdr
  (will be used by a subsequent PR)
- reworks the peer management logic so that all services can register with
  peerSet to get notified about added/dropped peers (also gets rid of the ugly
  getAllPeers callback in requestDistributor)
- moves peerSet, LesOdr, requestDistributor and retrieveManager initialization
  out of ProtocolManager because I believe they do not really belong there and the
  whole init process was ugly and ad-hoc
2017-06-21 12:27:38 +02:00
Zsolt Felfoldi fd5d51c9ae common/bitutil: added data compression algorithm 2017-05-05 20:24:48 +02:00
Felföldi ZsoltandFelix Lange 18bbe12425 les: allow LES connection to other servers (#13889) 2017-04-11 01:23:39 +02:00
Felföldi ZsoltandPéter Szilágyi 9aca9e6deb cmd, les, eth, eth/gasprice: using new gas price oracle (#13853)
* cmd, les, eth, eth/gasprice: using new gas price oracle

* eth/gasprice: renamed source file

* eth/gasprice: added security checks for gpo params

* eth/gasprice: fixed naming issues

* eth/gasprice: max limit, maxEmpty
2017-04-06 17:20:42 +03:00
Felföldi ZsoltandFelix Lange 525116dbff les: implement request distributor, fix blocking issues (#3660)
* les: implement request distributor, fix blocking issues
* core: moved header validation before chain mutex lock
2017-03-22 20:44:22 +01:00
Zsolt FelfoldiandPéter Szilágyi 0a01f3f607 light: added new CHT 2017-03-14 16:59:42 +02:00
Zsolt Felfoldi a390ca5f30 les, cmd/util: disable topic discovery with --nodiscover 2017-01-27 02:52:45 +01:00
Zsolt Felfoldi 12379c697a les: remove delayed les server starting 2017-01-26 04:23:53 +01:00
Zsolt Felfoldi f5348e17f8 les: add unknown peers to server pool instead of rejecting them 2017-01-26 04:23:49 +01:00
Felföldi ZsoltandFelix Lange 0fa9a8929c les: fixed transaction sending deadlock (#3568) 2017-01-16 10:51:29 +01:00
Zsolt Felfoldi 66979aa468 light: fixed data race in TestTxPool 2017-01-06 04:34:35 +01:00
Zsolt Felfoldi 93f9c023cc les: fixed selectPeer deadlock, improved request distribution
les/flowcontrol: using proper types for relative and absolute times
2017-01-06 04:34:31 +01:00
Zsolt Felfoldi f12f8a6c14 les, light: add block availability check for ODR requests 2016-12-10 09:53:25 +01:00
Zsolt Felfoldi c57c54ce96 eth, les: defer starting LES service until ETH initial sync is finished 2016-12-10 09:53:25 +01:00
Zsolt Felfoldi c8130df1d9 les: using random request IDs 2016-12-10 09:53:25 +01:00
Zsolt Felfoldi af8a742d00 les: improved header fetcher and server statistics 2016-12-10 09:53:08 +01:00
Zsolt Felfoldi e67500aa15 les: fixed light fetcher request ID matching 2016-12-08 13:38:15 +01:00
Zsolt Felfoldi a6d3bf6fc3 p2p/discv5: search and lookup improvement 2016-12-08 13:38:15 +01:00
Zsolt Felfoldi 3e617f3cd6 les: implement light server pool 2016-12-08 13:38:15 +01:00
Felföldi ZsoltandFelix Lange 665bb43a4c light: implemented VMState.Empty() (#3357) 2016-11-28 11:31:15 +01:00
Zsolt Felfoldi b10bcd924b core/types: turn off nonce checking for Call messages 2016-11-14 14:16:06 +01:00
Zsolt Felfoldi d8e2e9a41f light: updated CHTs for mainnet and testnet 2016-11-14 13:22:19 +01:00
Zsolt Felfoldi 1f70b279ba p2p/discv5: added new bootnodes 2016-11-14 13:22:19 +01:00
Zsolt Felfoldi e33e57684f p2p/discv5: fixed bootnode connect issues 2016-11-14 13:22:19 +01:00
Zsolt Felfoldi a0c6649960 les/flowcontrol: fixed locking scheme 2016-11-14 13:22:19 +01:00
Zsolt Felfoldi 323c2d6775 les: add missing nil check and handle quit in findServers 2016-11-11 03:16:46 +01:00
Zsolt Felfoldi 09baeec0da discv5: fixed state machine lockup bug 2016-11-11 03:10:46 +01:00
Zsolt FelfoldiandFelix Lange 49da42983a p2p/discv5: added new topic discovery package 2016-11-09 02:12:53 +01:00
zsfelfoldiandFelix Lange 7db7109a5b cmd, eth: added light client and light server modes 2016-11-09 02:12:53 +01:00
Zsolt FelfoldiandFelix Lange 9f8d192991 les: light client protocol and API 2016-11-09 02:12:53 +01:00
Zsolt FelfoldiandFelix Lange 760fd65487 light: light chain, VM env and tx pool 2016-11-09 02:12:53 +01:00
zsfelfoldi 56efed71b5 eth: fixed chaindb upgrade 2016-07-19 14:32:38 +02:00
zsfelfoldi 00787fe781 core: added CheckNonce() to Message interface 2016-07-11 12:35:23 +02:00
zsfelfoldi 3a97280ae8 eth: separate common and full node-specific API and backend service 2016-06-16 17:36:38 +02:00
zsfelfoldi f9917c8c7b core: improved chainDb using sequential keys 2016-06-07 16:38:56 +02:00
zsfelfoldi 5a458da42a core: chain read/write speed benchmarks 2016-06-06 14:38:28 +02:00
zsfelfoldi 73d21ea6af core: create a header chain structure shared by core.BlockChain and light.LightChain 2016-03-10 14:57:32 +01:00
zsfelfoldi ef422ee1e1 light: implemented odr-capable trie and state structures 2015-12-17 16:07:54 +01:00
zsfelfoldi f3aac71fad rpc/v2: optionally passing context argument to rpc v2 api methods 2015-12-16 03:48:08 +01:00
zsfelfoldi 975c591261 core: tx pool skip price validation for "owned" transactions 2015-12-16 03:21:17 +01:00
zsfelfoldi 52904ae32f trie: added error handling
Created alternate versions of Trie and SecureTrie functions that can return a MissingNodeError (used by ODR services)
2015-12-01 01:38:32 +01:00
zsfelfoldi 49ece3155c GPO update 2015-08-17 15:20:33 +02:00
zsfelfoldiandJeffrey Wilcke 5d9df7348d gpo non-existent block checks 2015-06-29 18:53:04 +02:00
zsfelfoldi 1e3f4877c0 Changed miner and gpo min gas price to 1 szabo 2015-06-15 16:48:59 +02:00
zsfelfoldi b42b70eb5f fixed rpc/api.GasPrice 2015-06-15 15:55:39 +02:00
zsfelfoldi 610adfd83f fixed xeth.gpo = nil bug 2015-06-15 15:55:39 +02:00
zsfelfoldi 3c7b64ce20 removed duplicate function after rebase 2015-06-15 15:55:39 +02:00
zsfelfoldi a977cecbe4 fixed gas price corr. factor 2015-06-15 15:55:38 +02:00
zsfelfoldi 6e212bdc6d fallback for uninitialized GPO config values 2015-06-15 15:55:38 +02:00
zsfelfoldi 2e8016c80d fixed initial base price bug 2015-06-15 15:55:38 +02:00
zsfelfoldi 0930e190a7 added missing source 2015-06-15 15:55:38 +02:00