This repository has been archived by the owner on Aug 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 110
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nonsense
reviewed
Jul 11, 2019
nonsense
reviewed
Jul 11, 2019
holisticode
reviewed
Jul 15, 2019
holisticode
reviewed
Jul 15, 2019
holisticode
reviewed
Jul 15, 2019
holisticode
reviewed
Jul 15, 2019
holisticode
reviewed
Jul 15, 2019
holisticode
reviewed
Jul 15, 2019
holisticode
reviewed
Jul 15, 2019
holisticode
reviewed
Jul 15, 2019
nonsense
reviewed
Jul 17, 2019
nonsense
reviewed
Jul 17, 2019
nonsense
reviewed
Jul 17, 2019
nonsense
reviewed
Jul 17, 2019
holisticode
reviewed
Jul 22, 2019
mortelli
changed the title
Incentives
api, swarm, main, chequebook, contract, swap, network, stream, protocols, state, testutil: first working SWAP version
Jul 26, 2019
zelig
reviewed
Jul 27, 2019
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.
jusy some preliminary comments as i went through quickly
acud
suggested changes
Jul 27, 2019
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.
so... first pass from my side. there's a lot of code here. I'm not a big fan of these huge PRs and I am still adamant that this could have been broken into smaller pieces of work that are easier to reason about and that could be merged directly into master
.
Comments in a nutshell are:
- lots of aesthetic changes that need to be done, mostly in the realms of logging and error handling (i.e. dont log errors then return them).
- Probably unnecessary use of pointer semantics in some cases (do you need to change params on-the-fly?)
- Passing private keys around - I am not a big fan of this. I'd rather see this functionality in some core component that handles the keys
- You have generated bindings but the solidity files are not here - why? and where's the tooling to keep both on par? I suggest you add the solidity files to be in the same repository
- Some unwanted full-database-scan functionality on the state store - I explicitly don't like it. you should know what you're querying for. and if you don't - you should at least construct correct indexes that would allow you to iterate over the keys you KNOW you want to have.
leveldb
is not aSQL
database. please bear that in mind, and by the looks of it - the usage of that functionality might cause us trouble. If you're unsure on what is being requested of you - please ask and we will kindly guide you to the correct solution.
mortelli
commented
Jul 29, 2019
holisticode
changed the title
api, swarm, main, chequebook, contract, swap, network, stream, protocols, state, testutil: first working SWAP version
all: first working SWAP version
Jul 29, 2019
zelig
suggested changes
Jul 30, 2019
This was referenced Jul 30, 2019
* swap: add getLastChequeValues function * swap: iterate getLastChequeValues function * swap: refactor createCheque * swap: update comment for cheque Sign function * swap: update cheque Sign function comment * swap: add err check in getLastChequeValues function
* swap: refactor createCheque and sendCheque functions to receive *Peer variables instead of IDs * swap: rename peerID variables to peer for consistency in swap.go * swap: change error message when failing to get peer in Add function, simplify swapPeer.Peer.ID() calls
…ivedCheque function
* swap: fix race condition in tests
holisticode
force-pushed
the
incentives
branch
from
August 27, 2019 17:45
6915f76
to
564f53d
Compare
This was referenced Aug 28, 2019
Closed
This was referenced Sep 2, 2019
chadsr
added a commit
to chadsr/swarm
that referenced
this pull request
Sep 23, 2019
* '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)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains a first working but experimental implementation of SWAP incentive system which aims to ensure fair use of bandwidth in the Swarm network.
The system works as follows: Swarm nodes communication and data exchange is tracked and recorded into balance books. As nodes cross hardcoded balance thresholds, signed cheques are sent to the remote peers and cached out on chain through chequebook smart contracts.
This first implementation in general assumes a happy flow. Next steps will be to refine it on several aspects and to better address error scenarios.
TODO:
resetBalance
SimpleSwap
naming (either rename the smart contracts or refactor thecontractReference.Instance
)log
calls to be following our style (log.<Level>(msg, key1, val1, key2, val2,...)
)should be
INFO
vsDEBUG
vsTRACE
. We don't have concrete rules, but probably best to avoid usingINFO
for debug messages. ReviewERROR
s - everyERROR
in our gateways nodes should be reviewed by a developer, once code goes to production. We should strive for very few/no errors.