-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PM Ticket Expiration #267
Comments
I'm not sure that the max 48 hour expiration window is such a negative. The default behavior for O is still to cash in a winner as quickly as possible, and therefore if B has dramatically overspent, the likelihood is that they would be exposed very quickly. If they've only mildly overspent, well, their penalty escrow should cover that. The 2 round option feels ok to me. The only attack/downside that I immediately see would be the "oscillating Orchestrator" who shows up, attracts stake with attractive params, changes those params causing D's to leave, then cashes payments in the next round. If D's prioritize any sense of history or longevity in nodes, or are patient enough to ride out two rounds, they get their fees anyway. The attack seems like more work/cost than it's worth. |
Just another data point in favor of expiration: a variation of the first point can be used by O as a form of squeezing to grief Bs. In particular, O could accumulate just enough tickets to ensure that B would be slashed. Having an expiration minimizes the "float" that B has at risk. At some point, B should probably maintain an internal approximation of its estimated outstanding float if O does not cooperate in notifying B of a winning ticket. The only drawback to using a round mapping is that it depends on global round initialization. I'm keen on minimizing any requirement for such (tragedy-of-the-commons for mainnet, and has been unreliable on testnets). One thought is to use earlier winning tickets to ratchet the expiration, as long as the blockhash (or perhaps just a block number) is accessible somewhere in that data. This has a bit of a bootstrapping problem, but I think we should be able to use any winning ticket for this, not just O's own winning tickets. Orchestrators already should be listening for winning ticket events, to monitor the deposit balance of active Bs. Could we do something similar with |
To clarify, do you mean something like upon receiving a winning ticket in the TicketBroker contract, we would simply add to our mapping of all historic winning tickets the block info, and that would be our "clock"? If so, I think that's very interesting. One advantage we have from using rounds relates to B's need to get the "last recorded blockhash" to provide the best expiration data for tickets. Using rounds, we can construct the contract mapping for easier lookup, i.e. roundNumber -> blockhash, because round numbers increment more slowly. If we used winning tickets as the triggering event, what would the mapping look like? Ideas:
wdyt? |
A few thoughts:
|
The (potentially) increased granularity from using winning tickets seemed to be a nice aspect, but I suppose it can go either way.
Ah, I was thinking O sets the expiry as part of the PM parameters to alleviate B of the need for blockchain monitoring. This also dovetails with expiring the data that O is required to cache per Having B set the expiry has some nice properties: the expiration could ratchet as the stream goes on. This is one benefit for the increased granularity offered by using winning tickets as they come in from the network. In any case, if we can look up the block hash and/or block number from any on-chain metadata that's available when doing a ticket lookup, without incurring additional storage writes, then we could use that. Otherwise, we'd have to write to a storage slot -- which I agree is expensive. We could also write to a storage slot during the Again, my motive for suggesting all this is to mitigate the requirement for a global
Burning the escrow is a good approach. Otherwise we incentivize squeezing attacks on B, where O hoards tickets in hopes of triggering that big slash and reaping a disproportionate reward. |
Here is an update on the current proposed roadmap for this feature based on this thread and an offline discussion between @eladmallel and I: We prefer not to use the approach of storing block hashes on winning ticket redemption because:
We prefer not to directly rely on block numbers i.e. attach a block hash and a block number to a ticket and the Broker checks if the block hash is valid for the block number and use a maximum ticket validity period of 256 blocks which is around 1 hour given ~15 second block times (since contracts cannot look up block hashes past
We propose the use of round initialization to store block hashes that can be used to prove the existence of a block at the time of ticket creation. The workflow for B would be as follows:
The upsides of this approach are:
The downsides of this approach are:
Our conclusion is that while using round initialization to store block hashes might not be the most ideal solution, it still beats out the other available solutions at the moment. If anyone has any additional thoughts/concerns we please continue the discussion here! If there are no additional thoughts/concerns, we can proceed with the following plan:
|
Thanks for taking the time to dissect alternatives so thoroughly. Is round initialization anticipated to be used for anything other than storing the block hash? If the block hash is the only reason for round initialization, then it might be nice to continue exploring other avenues to avoid round initialization. Performing global round initialization to accommodate an incidental effect of the payment mechanism feels heavy. One possible approach is to set the block hash during the first |
Why do we want ticket expiration?
recipientRand
value, which happens upon redemption on-chain. With no bound on when O redeems tickets, B can easily hand out winning tickets of a value greater than B's deposit and accidentally double spend.(for more background on some of these issues see livepeer/prob-pay#5 and livepeer/prob-pay#6).
Assuming we've established that we want to have an expiration mechanism, moving on to its design.
Ticket expiration design
Initial solution approach:
Round-based expirations challenges
Rounds are currently about 24-hours long. This granularity presents us with a few challenges:
As mentioned, the ideal solution would be to rely on block hashes, and there are EIPs that present such a possibility, but we have no certainty on if and when they will be included in a mainnet Ethereum version.
What is the best compromise for now?
The text was updated successfully, but these errors were encountered: