-
Notifications
You must be signed in to change notification settings - Fork 110
pss: Modularize crypto and remove Whisper. Step 1 - isolate whisper code #1698
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take it that the API defined here is entirely temporary, just tailored to fit the whisper that's been extracted?
We will need to go through a SWIP process to define the actual new API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I think I'm going to encapsulate all uses of |
Yes, I also think that defining the crypto API should not be part of this stage. Anyway, in order to have a good view of the necessary methods I'm going to include all the uses of |
Created Message and Envelope Types similar to whisper ones. Create a new CryptoBackend interface and default implementation using Whisper
Separated crypto utilities for tests in CryptoUtils
* 'master' of github.com:ethersphere/swarm: pss: Modularize crypto and remove Whisper. Step 1 - isolate whisper code (ethersphere#1698) pss: Improve pressure backstop queue handling - no mutex (ethersphere#1695) cmd/swarm-snapshot: if 2 nodes to create snapshot use connectChain (ethersphere#1709) network: Add API for Capabilities (ethersphere#1675) pss: fixed flaky test that was using a global variable instead of a local one (ethersphere#1702) pss: Port tests to `network/simulation` (ethersphere#1682) storage: fix hasherstore seen check to happen when error is nil (ethersphere#1700) vendor: upgrade go-ethereum to 1.9.2 (ethersphere#1689) bzzeth: initial support for bzz-eth protocol (ethersphere#1571) network/stream: terminate runUpdateSyncing on peer quit (ethersphere#1696) all: first working SWAP version (ethersphere#1554) version: update to v0.5.0 unstable (ethersphere#1694) chunk, storage: storage with multi chunk Set method (ethersphere#1684) chunk, storage: add HasMulti to chunk.Store (ethersphere#1686) chunk, shed, storage: chunk.Store GetMulti method (ethersphere#1691) api, chunk: progress bar support (ethersphere#1649)
We want to modularize crypto and stop depending on
whisper
. Issue #1655 describe several steps to achive this. The goal of this PR is just a small fraction of that first step.This PR isolates all usages of whisper into two new files:
crypto.go
: contains all the whisper usages related to keys managementmessage.go
: contains the data model related to envelopes and messages that we were using fromwhisper
.This PR is only a refactor of code, we are not changing anything so all the new methods and types are delegating into the old whisper methods and types.
The only minor thing done was removing unused fields from
whisper.ReceivedMessage
andwhisper.Envelope
.In
crypto.go
we have created and interface of the methods needed by keystore and also created a default implementation delegating to whisper.We also isolated code calling
github.com/ethereum/go-ethereum/crypto
intocrypto.go
.There are some crypto utilities used only by tests. Instead of adding those methods to the crypto interface, we created
CryptoUtils.go
and add them there.CryptoUtils
is intended to be used only in tests.