Improve block-selection strategy#10727
Conversation
client/beefy/src/worker.rs
Outdated
| C::Api: BeefyApi<B>, | ||
| C::Api: BeefyApi<B, NumberFor<B>>, | ||
| { | ||
| /// Return `true`, if we should vote on block `number` |
There was a problem hiding this comment.
| /// Return `true`, if we should vote on block `number` | |
| /// Return `true`, if we should vote on block with `header` |
client/beefy/src/worker.rs
Outdated
| let session_start = if let Some(session_boundary) = session_boundary { | ||
| session_boundary | ||
| } else { | ||
| debug!(target: "beefy", "🥩 Could not retrieve session boundary- won't vote for: {:?}", number); |
There was a problem hiding this comment.
I think at least warning here:
| debug!(target: "beefy", "🥩 Could not retrieve session boundary- won't vote for: {:?}", number); | |
| warn!(target: "beefy", "🥩 Could not retrieve session boundary - won't vote for: {:?}", number); |
| fn should_vote_on(&self, header: &B::Header) -> bool { | ||
| let number = *header.number(); | ||
| let at = BlockId::hash(header.hash()); | ||
| let session_boundary = self.client.runtime_api().get_session_boundary(&at).ok(); |
There was a problem hiding this comment.
We might want to open an enhancement issue to cache session boundary in the worker and not have to call runtime api for every block here.
There was a problem hiding this comment.
I'll keep that in mind.
client/beefy/src/worker.rs
Outdated
| // if the session_start as a mandatory block does not have a beefy justification yet, we vote on | ||
| // it |
There was a problem hiding this comment.
nit:
| // if the session_start as a mandatory block does not have a beefy justification yet, we vote on | |
| // it | |
| // if the session_start as a mandatory block does not have a beefy justification yet, | |
| // we vote on it |
| /// Minimal delta between blocks, BEEFY should vote for | ||
| pub min_block_delta: u32, |
There was a problem hiding this comment.
Let's not remove this. You can still use it on top of your changes as described in beefy.md #L224.
… david/beefy-round-selection
…bstrate into david/beefy-round-selection
|
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Bump |
|
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Alternative PR #10882 merged |
Fixes paritytech/grandpa-bridge-gadget#16
Round selection formula updated to match
as outlined in https://github.com/paritytech/grandpa-bridge-gadget/blob/td-docs/docs/beefy.md#round-selection
Session boundary API that is used here is already implemented in #10669