Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Create a parathread auction module for collators to bid on parathread slots #1512

Closed
rphmeier opened this issue Jul 31, 2020 · 8 comments
Closed
Labels
I8-refactor Code needs refactoring.

Comments

@rphmeier
Copy link
Contributor

rphmeier commented Jul 31, 2020

This functionality was already implemented as a SignedExtension in the old Registrar prior to #1501. The same logic should be ported over here, except wrapping around the Paras and Scheduler modules. This should live in polkadot-runtime-common as it is "glue" code and not core code.

@rphmeier rphmeier added the I8-refactor Code needs refactoring. label Jul 31, 2020
@rphmeier rphmeier added this to the White Flint milestone Jul 31, 2020
@coriolinus coriolinus self-assigned this Aug 18, 2020
@coriolinus
Copy link
Contributor

As I'm reading through this, I find myself getting more and more confused. What does this line even mean?

if let Call::select_parathread(id, collator, hash) = local_call {

That sure looks like it's using a function call as the receiver of an if let binding, which just doesn't make any sense to me.

@coriolinus
Copy link
Contributor

Guessing that this has to do with macro magic by which Call::select_parathread is somehow simultaneously an enum variant and an actual function. (Apropos of external discussion: this does not feel like responsible use of great power.)

If I'm reading the code properly, the registrar code didn't actually implement any kind of priority queue selection mechanism which would make it an auction; it was more of a first-come, first-served parathread registration thing. This leads to two questions:

  • If I'm reading the code incorrectly, where is the actual auction logic with bids etc?
  • If I'm reading it correctly, should the new module allow competing parathreads to competitively bid on slots, or just do the same registration stuff that the existing code does?

@shawntabrizi
Copy link
Member

shawntabrizi commented Aug 18, 2020

@coriolinus you are correct that this is both an enum variant and a function name. Something that is mostly needed to get a complete list of the possible functions in a module. We then use this information to dispatch a call to the right function. So the extrinsic will say: "Module 1, Extrinsic 3", and we will look at the enum for module 1, and the 3rd item in the enum.

The way the auction works is through the "priority" of the tx. The TX queue order txs by priority, and one direct way a user can increase their priority is including a tip, which is some extra fee that is paid to the blockchain (and split between treasury and block producer).

So users who want to make their way into the auction must have the highest tip, thus forming a 1 block auction.

I talk about this at a high level including the signed extension here: https://youtu.be/95Ji5u0q3AU?t=1004

@coriolinus
Copy link
Contributor

@shawntabrizi Thanks for the link! Watching that now.

@burdges
Copy link
Contributor

burdges commented Aug 19, 2020

oops wrong auction thread for my comment here.. ;)

@coriolinus coriolinus removed their assignment Aug 21, 2020
@rphmeier rphmeier modified the milestones: Medical Center, Tenleytown Feb 16, 2021
@rphmeier
Copy link
Contributor Author

@shawntabrizi still needed?

@shawntabrizi
Copy link
Member

shawntabrizi commented Feb 16, 2021

Yes, it is needed.

I can own this if needed at the appropriate time for implementation.

@rphmeier
Copy link
Contributor Author

paritytech/polkadot-sdk#828 outdates this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I8-refactor Code needs refactoring.
Projects
None yet
Development

No branches or pull requests

4 participants