Commit Graph

119 Commits

Author SHA1 Message Date
Felföldi Zsolt
c2003ed63b les, les/flowcontrol: improved request serving and flow control (#18230)
This change

- implements concurrent LES request serving even for a single peer.
- replaces the request cost estimation method with a cost table based on
  benchmarks which gives much more consistent results. Until now the
  allowed number of light peers was just a guess which probably contributed
  a lot to the fluctuating quality of available service. Everything related
  to request cost is implemented in a single object, the 'cost tracker'. It
  uses a fixed cost table with a global 'correction factor'. Benchmark code
  is included and can be run at any time to adapt costs to low-level
  implementation changes.
- reimplements flowcontrol.ClientManager in a cleaner and more efficient
  way, with added capabilities: There is now control over bandwidth, which
  allows using the flow control parameters for client prioritization.
  Target utilization over 100 percent is now supported to model concurrent
  request processing. Total serving bandwidth is reduced during block
  processing to prevent database contention.
- implements an RPC API for the LES servers allowing server operators to
  assign priority bandwidth to certain clients and change prioritized
  status even while the client is connected. The new API is meant for
  cases where server operators charge for LES using an off-protocol mechanism.
- adds a unit test for the new client manager.
- adds an end-to-end test using the network simulator that tests bandwidth
  control functions through the new API.
2019-02-26 12:32:48 +01:00
Matthew Halpern
325334f61a light: enforce camel case variable names (#19054) 2019-02-14 17:18:32 +02:00
Matthew Halpern
6f714ed73e light: make chain receiver names consistent (#18997) 2019-02-07 12:53:45 +02:00
Matthew Halpern
7c339ff442 light: make transaction pool receiver names consistent (#19000) 2019-02-07 12:53:00 +02:00
Felix Lange
684facedb8
light: fix disableCheckFreq locking (#18515)
This change unbreaks the build and removes racy access to
disableCheckFreq. Even though the field is set while holding
the lock, it was read outside of the protected section.
2019-01-24 13:40:37 +01:00
b00ris
769657060e les: implement ultralight client (#16904)
For more information about this light client mode, read
https://hackmd.io/s/HJy7jjZpm
2019-01-24 12:18:26 +01:00
Péter Szilágyi
f25f776c9f
core, light: get rid of the dual mutexes, hard to reason with 2019-01-11 15:27:47 +02:00
Iskander (Alex) Sharipov
da6e6e7971
light: fix duplicated argument in bytes.Equal call
Most probably a copy/paste kind of error.
Found with gocritic `dupArg` checker.
2018-12-10 14:29:34 +03:00
Sheldon
ca228569e4 light: odrTrie tryUpdate should use update (#18107)
TryUpdate does not call t.trie.TryUpdate(key, value) and calls t.trie.TryDelete
instead. The update operation simply deletes the corresponding entry, though
it could retrieve later by odr. However, it adds further network overhead.
2018-11-26 13:27:49 +01:00
Péter Szilágyi
434dd5bc00
cmd, core, eth, light, trie: add trie read caching layer 2018-11-15 12:22:13 +02:00
gary rong
c5d34fc94e les, light: reduce les testing stress (#17867) 2018-10-08 16:52:23 +03:00
Péter Szilágyi
f55c26ae6d
Merge pull request #17719 from karalabe/update-chts
les, light, params: update light client CHTs
2018-09-20 15:10:04 +03:00
gary rong
d6254f827b all: protect self-mined block during reorg (#17656) 2018-09-20 15:09:30 +03:00
Péter Szilágyi
af89093116
les, light, params: update light client CHTs 2018-09-20 14:14:48 +03:00
Péter Szilágyi
0f2ba07c41
common, core, light: add block age into info logs 2018-09-20 12:56:35 +03:00
Felföldi Zsolt
63352bf424 core: safe indexer operation when syncing starts before the checkpoint (#17511) 2018-08-28 10:31:34 +03:00
gary rong
b69476b372 all: make indexer configurable (#17188) 2018-08-28 10:08:16 +03:00
Péter Szilágyi
9f036647e4
consensus/clique, light: light client snapshots on Rinkeby 2018-08-21 15:21:59 +03:00
Felföldi Zsolt
1de9ada401 light: new CHTs (#17448) 2018-08-20 16:49:28 +03:00
Felföldi Zsolt
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
Sheldon
9e24491c65 core/bloombits, light: fix typos (#17235) 2018-07-24 11:24:27 +03:00
Felföldi Zsolt
f524ec4326 light: new CHTs (#17124) 2018-07-04 12:41:17 +03:00
gary rong
a4a2343cdc ethdb, core: implement delete for db batch (#17101) 2018-07-02 11:16:30 +03:00
Felföldi Zsolt
049f5b3572 core, eth, les: more efficient hash-based header chain retrieval (#16946) 2018-06-12 16:52:54 +03:00
Felföldi Zsolt
2977538ac0 light: new CHTs for mainnet and ropsten (#16926) 2018-06-11 10:38:05 +03:00
kiel barry
cbfb40b0aa params: fix golint warnings (#16853)
params: fix golint warnings
2018-06-05 12:31:34 +02:00
Péter Szilágyi
49719e21bc
core, eth: minor txpool event cleanups 2018-05-18 12:08:24 +03:00
rjl493456442
a2e43d28d0
all: collate new transaction events together 2018-05-18 11:46:44 +03:00
Felföldi Zsolt
595b47e535 light: new CHT for mainnet and ropsten (#16736) 2018-05-14 12:23:58 +03:00
gary rong
7beccb29be all: get rid of error when creating memory database (#16716)
* all: get rid of error when create mdb

* core: clean up variables definition

* all: inline mdb definition
2018-05-09 15:24:25 +03:00
Péter Szilágyi
6cf0ab38bd
core/rawdb: separate raw database access to own package (#16666) 2018-05-07 14:35:06 +03:00
Felföldi Zsolt
92c6d13083 light: new CHTs (#16515) 2018-04-17 09:33:31 +03:00
Felföldi Zsolt
45bd4fedde light: new CHT for ropsten (#16393) 2018-03-27 10:09:15 +03:00
Felix Lange
89cc604a50 light: new mainnet CHT (#16390) 2018-03-26 18:02:12 +03:00
Kyuntae Ethan Kim
63687f04e4 core: check transaction/receipt count match when reconstructing blocks (#16272) 2018-03-07 12:05:14 +02:00
Felföldi Zsolt
5ad7b9123c light: new CHTs (#16233) 2018-03-03 00:52:54 +01:00
Martin Holst Swende
f83237573f core: make current*Block atomic, and accessor functions mutex-free (#16171)
* core: make current*Block atomic, and accessor functions mutex-free

* core: fix review concerns

* core: fix error in atomic assignment

* core/light: implement atomic getter/setter for headerchain
2018-02-26 11:53:10 +02:00
Péter Szilágyi
5cf1d35470
eth, les, light: filter on logs only, derive receipts on demand 2018-02-22 19:12:43 +02:00
Felix Lange
a5c0bbb4f4
all: update license information (#16089) 2018-02-14 13:49:11 +01:00
Felföldi Zsolt
8d32c4b990 light: new CHTs (#16074) 2018-02-12 18:03:17 +02:00
Péter Szilágyi
7a0019c63b
les, light: fix CHT trie retrievals (#16039)
* les, light: fix CHT trie retrievals

* les, light: minor polishes, test remote CHT retrievals

* les, light: deterministic nodeset rlp, bloombits test skeleton

* les: add an event emission to the les bloombits test

* les: drop dead tester code
2018-02-11 14:57:46 +02:00
Péter Szilágyi
eb07dbb079
eth, light: minor light client startup cleanups 2018-02-08 07:49:23 +02:00
Péter Szilágyi
55599ee95d core, trie: intermediate mempool between trie and database (#15857)
This commit reduces database I/O by not writing every state trie to disk.
2018-02-05 17:40:32 +01:00
Péter Szilágyi
566d5c0777
core, eth, les, light: get rid of redundant methods 2018-01-30 18:42:00 +02:00
Felföldi Zsolt
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
Péter Szilágyi
6f69cdd109
all: switch gas limits from big.Int to uint64 2018-01-03 14:45:35 +02:00
Péter Szilágyi
f7ca03ae87 eth, les, light: expose chain config in les node info too (#15732) 2017-12-28 14:18:34 +01:00
gary rong
5f8888e116 accounts, consensus, core, eth: make chain maker consensus agnostic (#15497)
* accounts, consensus, core, eth: make chain maker consensus agnostic

* consensus, core: move CalcDifficulty to Engine interface

* consensus: add docs for calcDifficulty function

* consensus, core: minor comment fixups
2017-12-22 14:37:50 +02: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 Zsolt
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