Skip to content
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

WIP: thoughts on apis needed for mining process #10

Merged
merged 1 commit into from
Jul 10, 2019

Conversation

whyrusleeping
Copy link
Member

thinking through (with code, obv) what the api surface a miner needs is.

It gets a little tricky when you try to have the miner actually create the block, as doing that requires full access to a blocks state tree (potentially hundreds of GBs) and the ability to execute VM state transitions. So this sketch chooses to just assume the miner doesnt have to do that, and the api can take care of it.

In this mode, the miner is responsible for keeping track of what the best tip to mine on is, checking if they are winners, selecting the messages to go in their blocks, and then making sure blocks get made at the right times.

@whyrusleeping
Copy link
Member Author

considerations:

  • Private keys needed for signing.
    • The election proof needs the bls private key associated with the miner actor
    • The 'create block' process will also need this key unless it passes an unsigned block back to the caller of 'CreateBlock'.
  • this should be able to be adapted to multiple miner actors

@whyrusleeping
Copy link
Member Author

Also not accounted for here: What to do if we receive a new better tipset while mining? Curious on peoples thoughts about the api there, should i just get a channel of 'new best tipsets' ?


// returns a set of messages that havent been included in the chain as of
// the given tipset
PendingMessages(base *chain.TipSet) ([]*chain.SignedMessage, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be very large, probably better to do sth like iterator/paging/lazy loadinf

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could return a channel here, implementing those over RPC should be easy

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, when this is made into a subscription, we'll also need to subscribe to incoming blocks to keep track of which messages we care about

It's probably easier to keep it this way for now, and fix when we actually have some miner code

@magik6k magik6k mentioned this pull request Jul 9, 2019
Copy link
Contributor

@Kubuxu Kubuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGWM


// returns a set of messages that havent been included in the chain as of
// the given tipset
PendingMessages(base *chain.TipSet) ([]*chain.SignedMessage, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could return a channel here, implementing those over RPC should be easy


// returns a set of messages that havent been included in the chain as of
// the given tipset
PendingMessages(base *chain.TipSet) ([]*chain.SignedMessage, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, when this is made into a subscription, we'll also need to subscribe to incoming blocks to keep track of which messages we care about

It's probably easier to keep it this way for now, and fix when we actually have some miner code

// TODO: Not sure this feels right (including the messages api). Miners
// will likely want to have more control over exactly which blocks get
// mined on, and which messages are included.
GetBestTipset() (*chain.TipSet, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's what chain head would return, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, for the most part that should be the same operation. I don't have a good enough reason for them to be different yet

@whyrusleeping whyrusleeping merged commit 67bf8c1 into master Jul 10, 2019
@whyrusleeping whyrusleeping deleted the feat/mining-interface branch July 10, 2019 15:32
magik6k pushed a commit that referenced this pull request Jul 22, 2020
magik6k pushed a commit that referenced this pull request Aug 10, 2020
Update proofs to v25 parameters, win PoSt
magik6k pushed a commit that referenced this pull request Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants