--- tags: Proposals --- # Etc Materials Proposal V3 ## Notes Jakob (to be deleted before discussing with Streamr) Review: Need some logic for what a review looks like (defined query?) **(added to DD)** Vote: For now simple question of "Is this peer relaying stream data?" - "Yes / No" Vote result: Majority Yes / No If Majority Yes: The PR staked funds are divided by number of Yes votes and sent to respective yes voters If Majority No: The malicious broker is slashed and the funds are divided by all No votes +1, and sent to no voters and the neighbor that flagged and started review process. PR staked funds are returned. The malicious broker is also removed from the stream. TBD: When are brokers assigned their peers? **(added to DD)** - When they initially join the network (topology changes could leave some brokers uncovered) - At certain intervals (overhead) - When a Peer Review process starts (might need to check whether we can notify brokers of that process, or whether everyone listens to this? Maybe a stream that every broker needs to subscribe to where we send through data on this PR that started?) How many peers is each broker assigned? **(Sean: Leave as a parameter in the system to toggle)** - 1 only works if they are assigned when a Peer Review starts. Otherwise, topology changes could leave uneven/no coverage - 5+ would probably be fine: There is not much overhead, as this process is probably not happening too often. This would give better coverage, even if some brokers might be assigned to three, one, or even 0 still-live peers Who can start the Peer Review process by flagging and staking funds? - Neighbor brokers should be the main entity to do this. - Sponsors could additionally have the right to do so, as a backup (and to give sponsors more rights, without duty) How much should be staked with a flag? **(added to DD and could be additional research)** - The staked funds need to cover the rewards in case the Peer Review finds no wrong-doing. How much reward should there be? - For voting to be unbiased, in the absence of punishment for incorrect voting, the rewards should be the same no matter the outcome - While we might not want to punish incorrect voting, we can give reward only if you voted for the majority decision. - Rewards can come from two sources: - 1. Staked by the flagging neighbor (should be lower than full stake of broker, small enough not to disincentivize the process, large enough not to be abused) - 2. Original Stake by the suspected broker (Rewards paid from this should go to all majority voters and the flagging neighbor. Remainder can either be returned to broker, burned, go to stream, or to some general fund) What does the Review Process look like? - Assuming that a broker knows which peers he is assigned to, he also needs to know - where to find out whether one of his peers is flagged - how to do the performance review - how much time he has for performance review - how to vote - how much time he has for voting - If a broker does not vote at all, should he be punished? Voting: - "Is this peer relaying stream data?" - Simple majority yes/no - Basecase for now one-round voting Consequences: - Majority Yes: - Staked PR funds by flagging neighbor are used for rewards - Flagged broker stays in stream - Rewards go to: Peer Review Yes voters - Majority No: - Flagged broker is slashed and these funds used for rewards - Flagged broker is removed from stream - Rewards go to: Flagging neighbor, Peer Review No voters - Flagging neighbor gets his stake back Process: - Out-of-Bounds: - When a broker joins the network (could be another event, or per review process, but then brokers might not know they are assigned), he gets n-peer(s) assigned randomly (if everyone has one peer, topology changes can break coverage, with n-peers we can reasonably assume coverage even if there are differing amounts of brokers assigned to one peer) - When a peer is flagged, the broker checks if he is staked in the same bounty as the peer - Design Goal: No incentives for malicious voting - If they do not share a bounty, broker gets peer review duty of checking his peer's performance in the specific stream / wherever - assumptions: If a broker does not do his work in one bounty, he could still do his work in other bounty. (It's low probability they are in the same and even if there should be more than one verification. Maybe I will put this in as a due diligence Q) - After checking performance, all brokers who had this peer assigned vote on performance - After vote, we could still give sponsors a final veto (Sean will add this as a due diligence question. Might make sense to allow them to veto (but not kick anyone) as they are the ones paying. But this is an extension from the basic model, so let's see streamr thoughts on it) - Brokers that are assigned peer review duty but: - Do not vote: Slashed - Do not vote honestly (how to check?): Slashed (Could do 2-round voting if first round is not unanimous; I.e. if someone flags someone and then everyone agrees in round 2 they are doing their work there could be slashing. ) - Do not check performance?: Believe it or not, slashed - Out-of-Bounds voting: - Peer-review contract has funds staked in and broker indicated (how) - Option 1: Global peer review contract, where there is a pool and any registered broker needs to do the work - Option 2: A segregated account in each stream from some of the stake that was added. In this case, the brokers would be expected to check in proportion to their number of streams they are in, and each stream would track them doing it. - Everyone who has that peer assigned is now on active duty - They review performance and vote - If vote comes out as guilty: - Suspected broker is slashed in that bounty - Slashed funds go to peer review contract - Slashed funds go to peers doing the reviewing - If vote comes out as not-guilty: - Suspected broker stays in bounty - Peer review funds go to peers doing the reviewing -Note for Design: In order not to bias peers for voting, their rewards should be the same no matter the outcome (however this could incentivize random voting? maybe some majority vote where only those who are in majority agreement share the rewards?) The stake for calling a peer review should be: Low enough not to discourage calling for peer review, high enough to not be used inflationary, same as reward for peer reviewers. (If we slash a guilty suspect completely, and the slashing is higher, the excess funds are either burned or go somewhere else, but should not stay in that bounty I think) - In-Bounds: When a broker joins a bounty, they start listening to all other brokers (this could be hard, since topology seems to be based on 4 neighbours? Can we even make every broker listen to every other broker?) - When a broker suspects another broker in the same bounty to not do their job, they can: - Option 1 (suboptimal, complexity): call for a review (suboptimal, seems gameable, leaving for review) - When a review is called, every broker in the same bounty votes on their experience with this broker - If majority of in-bounty brokers vote **'sus'**, the suspected broker gets flagged for external peer review - **Option 2:** (main option) call for peer review - Broker stakes some funds into a peer review contract - Suspected broker gets flagged - Out-of-Bounds process starts and pre-assigned peers need to vote on verdict