Commit graph

9865 commits

Author SHA1 Message Date
Balint Gabor
a98c39603c
Merge 9bd2e882e4 into a095b84ec5 2018-03-30 15:41:52 +00:00
Balint Gabor
9bd2e882e4 swarm/...: Integrate encryption into swarm API 2018-03-30 17:19:33 +02:00
Balint Gabor
167159bc3c
Integrate encryption into dpa and chunker (#327)
* swarm: Integrate encryption into dpa and chunker

This is not a fully functional change.
Chunker api changed: it uses Putter and Getter interfaces to put and get
chunks from the store and to do the encryption/decryption if needed. These
putters and getters should also the hashing, so hashing related code
could be removed from chunker.
Some things are temporary, pyramid chunker doesn't work yet (only tree
chunker), and hashing and putting in dpa is not parallelized.

* swarm/storage: Use TreeChunker in DPA

PyramydChunker doesn't work yet with Putter/Getter

* swarm/storage: HasherStore needs a new hasher instance on every chunk
creation

This fixes the tests with pyramid chunker

* swarm/storage: Add back tree/pyramid comparison in chunker test

* swarm: Refactor chunker, new chunker instance is needed for each job

Chunker code is much simpler if all data of the job is stored on the
chunker object itself.

* swarm/storage: Remove commented code

* swarm/storage: Added comments

* cmd/swarm: Remove Branches from config

* swarm/storage: Remove commented code

* swarm/network: Remove chunker from syncer

* swarm/storage: Remove Chunker/Splitter/Joiner interfaces

They are not used anymore

* swarm/storage: Fix comment

* swarm/storage: Reenable chunker_test.TestDataAppend

* swarm/storage: Fix comments

* swarm/storage, cmd/swarm: Add FakeChunkStore

Instead of using a nil ChunkStore in hasherStore when we don't want the
hasherStore to actually store the chunk data, now a FakeChunkStore
instance should be used. Because of this the nil checks of the hasherStore.store
could be removed.

* swarm/storage: Use DefaultChunkSize az constant, not DefaultBranches

The branches what is changing, and it is dependent on chunk size and
hash size

* swarm/storage: Remove unnecessary return statement

* swarm/storage: Rename unfinishedChunk to unfinishedChunkData

* swarm/storage: Move NewTreeSplitterParams to chunker.go

It was in pyramid.go, although TreeSplitter is in chunker.go

* swarm/storage: Minor cleanup

incrementWorkerCount can be moved into runWorker
remove obsolete comment

* swarm/storage: Add TODO comment to chunker depth parameter

Depth can only be 0 because of a bug: https://github.com/ethersphere/go-ethereum/issues/344

* swarm/storage: Fix padding in hasherStore

There was a bug that data was not lengthened to padding

* swarm/storage: Add unit test for hasherStore

* swarm/storage: Decrease initial counter in span encryption

* swarm/storage: Renames in benchmark tests

* swarm/storage: Fixed pyramid benchmark test

* swarm/storage: Convert TestHasherStore to table-driven test

* swarm/storage, cmd/swarm: New MapChunkStore, simple ChunkStore implementation

It is not just the test which needs this kind of implementation

* swarm/storage: Cleanup on hashSize/chunkSize handling
2018-03-30 12:40:43 +02:00
Anton Evangelatov
6d182b8bfc
Merge pull request #350 from samuil/swarm-network-rewrite
storage: wrap closing chunk stored chan in mutex
2018-03-29 14:34:16 +02:00
lash
539806da93
Merge pull request #318 from ethersphere/mutableresources-maxlookup
swarm/storage: Add max period traversal for lookup query
2018-03-29 11:41:23 +02:00
Bartek Borkowski
a344c2fbf6 storage: use pointer to mutex instead of value 2018-03-29 09:29:15 +02:00
Bartek Borkowski
094e71721f storage: remove stale comment 2018-03-28 17:23:06 +02:00
Felix Lange
a095b84ec5 travis.yml: remove sudo requirement for PPA and Azure purge builders (#16404)
This is supposed to fix the FTP upload issue according to
travis-ci/travis-ci#9391.
2018-03-28 15:35:41 +03:00
Bartek Borkowski
bf35da28ac storage: wrap closing chunk stored chan in mutex
This commit fixes issue #341
2018-03-28 14:10:37 +02:00
Anton Evangelatov
4fb66e7cc1
Merge pull request #348 from ethersphere/pss-noversiontest
swarm/pss: Remove go1.7 test workaround
2018-03-28 13:39:04 +02:00
lash
bdef57fd32 swarm/pss: Remove go1.7 test workaround 2018-03-28 12:35:18 +02:00
lash
0d5b951614 swarm/storage, swarm/api, swarm/testutil: Explicit lookup limit params 2018-03-28 12:24:52 +02:00
Jia Chenhui
1a8894b3d5 core/state: uniform parameter style (#16398)
- Uniform code style.
2018-03-28 09:26:37 +03:00
Anton Evangelatov
2acb592647 Merge branch 'master' into swarm-network-rewrite 2018-03-27 18:37:47 +02:00
Guillaume Ballet
80449719bd
whisper: fix issue in topic list copy (#16381)
- Fixes #16271. What was appeneded was a pointer to
an object that changes during the iteration.
- The topic is allocated as a 4-byte array, fill partial topics
with 0s. Partial topics are currently disabled, but would
crash as they rely on the presence of byte number 3.
2018-03-27 17:26:08 +02:00
Felföldi Zsolt
45bd4fedde light: new CHT for ropsten (#16393) 2018-03-27 10:09:15 +03:00
Péter Szilágyi
d763e20d55
Merge pull request #16394 from hydai/fix_typo
core/vm: Fixed typos in core/vm/interpreter.go
2018-03-27 10:08:58 +03:00
hydai
6134990709
core/vm: Fixed typos in core/vm/interpreter.go 2018-03-27 12:29:04 +08:00
Felix Lange
85ea9159d0 params, VERSION: v1.8.4 unstable 2018-03-26 18:09:56 +02:00
Felix Lange
329ac18ef6 params: v1.8.3 stable 2018-03-26 18:09:06 +02:00
Felix Lange
89cc604a50 light: new mainnet CHT (#16390) 2018-03-26 18:02:12 +03:00
Guillaume Ballet
cf799e5eaa
whisper: switch all remaining components from v5 to v6 2018-03-26 16:36:14 +02:00
Péter Szilágyi
c053f1146d
Merge pull request #16388 from hydai/fix_comments
core/vm: Fixed typos
2018-03-26 17:05:35 +03:00
hydai
c3dc814fea
core/vm: Fixed typo in core/vm/evm.go 2018-03-26 21:40:00 +08:00
Zhenguo Niu
db9b2f5405 cmd/puppeth: add constraints to network name (#16336)
* cmd/puppeth: add constraints to network name

* cmd/puppeth: update usage of network arg

* cmd/puppeth: avoid package dependency on utils
2018-03-26 15:21:20 +03:00
Felix Lange
e9b5e22ad1 rpc: limit chunked requests (#16343) 2018-03-26 14:46:37 +03:00
Jia Chenhui
e506d384e9 core/state: fix typo (#16370) 2018-03-26 14:45:34 +03:00
Péter Szilágyi
dd708c1636
Merge pull request #16319 from rjl493456442/dump_preimages
cmd: implement preimage dump and import cmds
2018-03-26 14:45:01 +03:00
Péter Szilágyi
495bdb0c71
cmd: export preimages in RLP, support GZIP, uniform with block export 2018-03-26 14:08:01 +03:00
hydai
7c131f4d6d core/asm: fixed typo (posititon -> position) (#16366) 2018-03-26 13:48:39 +03:00
hydai
84c5db5409 core/vm: remove JIT VM codes (#16362) 2018-03-26 13:48:04 +03:00
David Huie
23ac783332 ecies: drop randomness parameter from PrivateKey.Decrypt (#16374)
The parameter `rand` is unused in `PrivateKey.Decrypt`. Decryption in
the ECIES encryption scheme is deterministic, so randomness isn't
needed.
2018-03-26 13:46:18 +03:00
Péter Szilágyi
e9a1d8de34
Merge pull request #16387 from karalabe/evm-polsihes
core: minor evm polishes and optimizations
2018-03-26 13:44:36 +03:00
rjl493456442
b6b6f52ec8
cmd: implement preimage dump and import cmds 2018-03-26 12:51:46 +03:00
Péter Szilágyi
1fae50a199
core: minor evm polishes and optimizations 2018-03-26 12:28:46 +03:00
Viktor Trón
defc256afe
Merge pull request #336 from ethersphere/more_tracing
deadlock on retrieve chunk + more tracing for internal swarm components
2018-03-25 12:19:14 +02:00
Anton Evangelatov
a1b2b4c5b6 swarm/storage: fixed comment and improved error. cleandb no longer exists 2018-03-23 21:25:04 +01:00
Anton Evangelatov
f03c58336b swarm/storage: remove redundant trace 2018-03-23 17:31:03 +01:00
Anton Evangelatov
61ffbbbe78 swarm/storage: close dbStored when we are retrieving from LevelDB 2018-03-23 17:25:29 +01:00
Guillaume Ballet
3d013c1939 whisper: some components are still using v5, switch to v6 2018-03-22 15:48:52 +01:00
Anton Evangelatov
4ffd38efb7 swarm/storage: tracing for chunk 2018-03-22 11:44:44 +01:00
Anton Evangelatov
b72cd7eb70 swarm/storage: tracing for chunks 2018-03-22 11:44:44 +01:00
Anton Evangelatov
290ff49e1e log: see milliseconds in terminal 2018-03-22 11:44:44 +01:00
Janoš Guljaš
e2ec5801ed
cmd/swarm, swarm/network: dynamic sync streams update
- NewRegistry creates a goroutine that updates sync streams based on changes in kademlia. It calls updateSyncing method to create new and quit unintended sync streams. To early subscriptions are prevented by waiting until no new peers are added for a configured period of time SyncUpdateDelay.

- Implements two new methods on Kademlia:
  - NeighbourhoodDepthC which returns a channel that returns kademlia neighbourhood depth on each change
  - AddressBookSizeC which returns address book size when it changes
  This methods are required for making a decision when to request sync stream subscriptions update in a dynamic network.

- To avoid the parsing of stream strings to distinguish the SYNC ones, Registry now uses Stream structure as the key for clients, servers and clientParams maps. This required that the Stream must be comparable and Key field is changed from []byte to string. The consequence is that key is changed to string in all function signatures that accepted it. Also, new functions FormatSyncBinKey and ParseSyncBinKey are introduced to explicitly handle the parsing and formating of bin numbers that are used as Key values in Stream.

- Implements RegistryOptions that holds optional values for stream Registry initialization. The number of arguments for NewRegistry is a bit high with adding another option SyncUpdateDelay, and optional and required ones are separated with RegistryOptions.

- Range now has constructor NewRange for better initialization and also has the String method for better logging.

- Registry now has the Quit method that sends QuitMsg to the peer to terminate the stream client on its side. This is required to terminate not needed sync streams when kademlia table changes by adding new peers.

- Changes the RequestSubscription to skip the request if the stream is already registered. This ensures that no request subscriptions are made if the server already exists.

- New SyncUpdateDelay cli flag is added to control the delay of syncing update. Default is set to 15s.
2018-03-21 18:35:28 +01:00
Balint Gabor
19d6d59c41 Merge branch 'master' into swarm-network-rewrite 2018-03-21 11:45:29 +01:00
Martin Holst Swende
933972d139
Merge pull request #16256 from epiclabs-io/unpack_one_arg_event
Fix issue unmarshaling single parameter events from abigen generated go code #16208
2018-03-21 10:11:37 +01:00
Felix Lange
b1917ac9a3 build: add GOBIN to PATH for gomobile (#16344)
* build: add GOBIN to PATH for gomobile

* build: install gobind alongside gomobile
2018-03-20 02:00:45 +09:00
Péter Szilágyi
1203c6a237
crypto/bn256: full switchover to cloudflare's code (#16301)
* crypto/bn256: full switchover to cloudflare's code

* crypto/bn256: only use cloudflare for optimized architectures

* crypto/bn256: upstream fallback for non-optimized code

* .travis, build: drop support for Go 1.8 (need type aliases)

* crypto/bn256/cloudflare: enable curve mul lattice optimization
2018-03-20 01:13:54 +09:00
Guillaume Ballet
0965761a45 whisper: Notify Vlad and Guillaume of whisper PRs (#16340) 2018-03-19 22:27:46 +09:00
Martin Holst Swende
faed47b3c5
Merge pull request #15990 from markya0616/sim_backend_block_hash
accounts/abi, core: add AddTxWithChain in BlockGen for simulation
2018-03-19 08:29:54 +01:00