-
Notifications
You must be signed in to change notification settings - Fork 177
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: Add README #1099
pm: Add README #1099
Conversation
The first part looks pretty good to me. The RNG part feels a little ad hoc / incomplete without some more context around PM. Even though there is a link to the full PM spec, it might not be immediately clear to a new reader where the RNG part fits in and the reasoning for certain behaviors. Eg, from a quick glance, the writeup mentions that winning Not really sure yet how/where to improve this without a closer read of the PM spec. |
|
||
The `abi.encodePacked()` Solidity built-in is used to match the behavior of the contract implementing the `TicketBroker` interface. `senderSig` is a signature produced by `Sender` over the hash of the ticket and `recipientRand` is the pre-image of the `recipientRandHash` that is included in the ticket. | ||
|
||
Before a `Sender` can start creating and sending tickets, it must first fetch ticket parameters from a `Recipient`. When generating ticket parameters, a `Recipient` will generate a random number `recipientRand`, compute the hash of `recipientRand` as `recipientRandHash` and include the hash with the ticket parameters. Once a `Sender` has a set of ticket parameters with a `recipientRandHash`, the `Sender` will use a monontonically increasing `senderNonce` with each new ticket that it creates. |
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.
It might be a good idea to provide some extra context around TicketParams
here , perhaps we can use the commented protobuf definitions to provide more clarity here?
|
||
The `pm` package contains a client implementation of the [Livepeer PM protocol](https://github.com/livepeer/wiki/blob/master/spec/streamflow/pm.md). The main areas of interest are: | ||
|
||
- A `Ticket` type which defines the ticket format that both senders and recipients accept. |
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.
It might be a good idea to provide some extra context around this type as its fieldnames are used extensively in the RNG part of the README. WDYT?
@yondonfu Is this documentation still worth getting merged or can we close the PR? |
Reviving this PR! Updated the |
Codecov Report
@@ Coverage Diff @@
## master #1099 +/- ##
===================================================
+ Coverage 56.63383% 56.64955% +0.01572%
===================================================
Files 88 88
Lines 19084 19084
===================================================
+ Hits 10808 10811 +3
+ Misses 7682 7679 -3
Partials 594 594 see 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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.
This is great, thanks Yondon! I think you also win longest time between PR opening and getting merged 🏆
Made a few small changes:
The above changes align with the convention used for assets in docs seen in |
What does this pull request do? Explain your changes. (required)
This PR adds:
pm
package that references the full PM protocol specification and also highlights a few things that the package implements to ensure fair winning ticket selection.doc/payments.md
that includes links to resources for the PM protocol as well as notes on fee estimationSpecific updates (required)
See above.
How did you test each of these updates (required)
N/A
Checklist:
./test.sh
pass