-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add skeleton types types for auctions #1472
Conversation
I'm probably going off on a limb, but its easier for me to think about the types if there is some logic tying them together. Ultimately I think we will expose a function to an event handler that will make the gears turn. I believe `ViewNumber` can be passed in, and I'm guessing `BidTx` we be as well.
// - needs to be configured in genesis block | ||
// - needs to be updatable | ||
/// Configuration for the auction system | ||
struct AuctionConfig { |
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.
I can see in a very generic way why we need this information, but I'm having trouble reasoning about how we will actually use it. I feel like we will need to receive an event announcing the start of a phase. And from there we can use this to calculate the view at which that phase will end. Are there indeterminate spans between phases? if the end of one phase == start of next then we would only need the start of the first phase on the chain, which could just be a constant (or come from config).
fn recv_bid(&self, view: ViewNumber, bid: BidTx) { | ||
self.update(view); | ||
match self.phase.kind { | ||
AuctionPhaseKind::Bid => self.send_txn(bid.as_txn()), |
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.
Rereading, I think the actions that will actually occur are validation and persistence.
Closes #1471
TODO
This PR:
This is a very early sketch based on the notion document for discussion and experimentation.
This PR does not:
Implement anything.