-
Notifications
You must be signed in to change notification settings - Fork 165
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
core,net,pm,server: O sends expected TicketExpirationParams to B along with TicketParams #1428
Conversation
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.
While the pmTicketParams() helper in db_discovery.go
doesn't need to populate the expiration params field since those fields are not accessed within the file at the moment, it might be a good idea to populate the field anyways for consistency.
Some thoughts on implications of this change below: Since B always uses the creation round (and block hash - when I say creation round in this comment I also refer to block hash associated with the creation round) that it receives, O is able to set the creation round in the range Why would O set the creation round to anything less than the current round? One possible reason is to control the fee pool that fees are sent to. Recall that an O has a fee pool for each round and fees sent to a fee pool for round N are distributed to delegators that were staked to O in round N. In this case, O can choose to send fees to the fee pool for any round in the range I don't think this is a big problem in practice because:
|
Good points you raise, I didn't consider those. But I think it would also require the O to not call reward itself then, otherwise it would have already called it for that EarningsPool, which would be visible in the explorer and might deter delegates as well. Plus there is always the possibility of an orchestrator trying such shenanigans coming under community scrutiny. fixups in cb323b0 |
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.
While the pmTicketParams() helper in db_discovery.go doesn't need to populate the expiration params field since those fields are not accessed within the file at the moment, it might be a good idea to populate the field anyways for consistency.
Bump on the above comment.
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.
Changes look good - let's rebase.
8776282
to
7125e3c
Compare
rebased ! |
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.
LGTM 🚢
What does this pull request do? Explain your changes. (required)
The orchestrator sends along TicketExpirationParams as ExpectedExpirationParams with TicketParams. The broadcaster then uses these values for the ticket CreationRound and AuxData instead of relying on the TimeWatcher (view of the current chain for B). Both CreationRound and CreationRoundBlockHash are added to the HMAC scheme to validate these values were advertised by the Orchestrator.
Two considerable benefits:
Downsides:
Specific updates (required)
TicketExpirationParams
inTicketParams
protobuf messagepm.TicketExpirationParams
field topm.TicketParams
Recipient
reads last initialized round and its blockhash from memory whenrecipient.TicketParams()
is called and the values are used for theExpectedExpirationParams
to send to BCreationRound
andCreationRoundBlockHash
torecipientRand
generation and thus ticket validationvalidateCreationRound()
and its usage in ticket validationExpectedExpirationParams
provided in theTicketParams
from O to populate the values forCreationRound
andCreationRoundBlockHash
when creating ticketsHow did you test each of these updates (required)
Added unit tests
Ran nodes with devtool
Does this pull request close any open issues?
Fixes #1187
Checklist:
./test.sh
pass