Separate worker role from miner/staker#949
Conversation
Codecov Report
@@ Coverage Diff @@
## master #949 +/- ##
==========================================
+ Coverage 84.98% 85.05% +0.07%
==========================================
Files 65 65
Lines 7908 7925 +17
==========================================
+ Hits 6721 6741 +20
+ Misses 1187 1184 -3
Continue to review full report at Codecov.
|
| self.minimum_allowed_locked, # Min amount of tokens that can be locked | ||
| self.maximum_allowed_locked # Max amount of tokens that can be locked | ||
| self.maximum_allowed_locked, # Max amount of tokens that can be locked | ||
| self.minimum_worker_periods # Min amount of periods while a worker can't be changed |
There was a problem hiding this comment.
"Minimum number of periods a contract can be an intermediary "
There was a problem hiding this comment.
Did not get what do you mean,
this value to prevent too often changing of worker, but staker is always an intermediary contract or real address
| seconds_per_period = hours_per_period * 60 * 60 # Seconds in single period | ||
|
|
||
| # Time Constraints | ||
| minimum_worker_periods = 2 |
There was a problem hiding this comment.
Though it seems that this is a pretty minimal attack surface, the "unknown-unknowns" here are really disturbing to me. @szotov tells me a worker history is the solution, but it has some downsides. I really want to think more about this and what effects it can have; I think we don't completely understand all the effects this can have on the network.
Separate worker role from miner/staker
Before this PR a staker can't be an intermediary contract (such as User Escrow) because contract can't sign anything (and we can't slash it).
Now miner/staker can set worker who can confirm activity and doesn't matter how many intermediary contracts between worker and MinersEscrow.
Any suggestions on renaming "worker" are welcome.
MinersEscrowAPI cahnges:lockmethod no longer includesmintandconfirmActivitymethodssetWorker(address)method - necessary to set worker before confirm activitygetWorkerByMiner(address)getMinerByWorker(address)confirmActivity()Also
MiningAdjudicatorusesgetMinerByWorker(address)to get miner for slashing