Skip to content

Collator proto revamp: Picking an advertisement to fetch doesn't take into account the lookahead value #10932

@tdimitrov

Description

@tdimitrov

When launching fetch requests we examine pending candidate fetches/seconded candidates and based on the claim queue we make a list of assignments (ParaIds) which we need to make a fetch for. However when building the assignment list we don't take into account the position of the assignment in the claim queue.

Due to this we can end up in the following situation:

lookahead = 3
claim queue state:

block_state=[
	ClaimInfo { hash: Some(0x7c9b8a6d207fda4d22ce0f0c641111a3e5ce73a65efd7427d2250d8e602d43b7), claim: Some(1000), claim_queue_len: 3, claimed: Seconded(0x66ee09778b68a2541c1de649be0d54afb562ec0b83b3ac93d5ab96b5c50ae7a3) }, 	// 64
	ClaimInfo { hash: Some(0xfbdf9156264ac83f9e910b2f82a14357c81f16654dc826619233434b77dcbd0a), claim: Some(1000), claim_queue_len: 3, claimed: Pending(Some(0x3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e)) }, //65
	ClaimInfo { hash: Some(0x7c870a0cb9e0531d437598cea565be97ff1cc6125a329a50f46f58d4289d9a41), claim: Some(1000), claim_queue_len: 3, claimed: Pending(Some(0x7b2c6c2353cff5eed11ea58ed4aa40e7b683124c228656c77db877dd8e6b008a)) }] //66
future_blocks=[
	ClaimInfo { hash: None, claim: Some(1000), claim_queue_len: 1, claimed: Pending(Some(0x3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e3e)) }, 
	ClaimInfo { hash: None, claim: Some(1000), claim_queue_len: 1, claimed: Free }

In this case we have got one free position in the claim queue (in future blocks) and we need to make a fetch for it. However when we pick the best advertisement to fetch we don't take into account it's relay parent.

For example in the case above, we can't fetch a candidate with RP 0x7c9b8a6d207fda4d22ce0f0c641111a3e5ce73a65efd7427d2250d8e602d43b7 (first entry) because the free claim is not within its view. However pick_best_advertisement does exactly that and as a result we fail to claim a slot for it (here) and we skip the slot.

Metadata

Metadata

Assignees

Labels

I2-bugThe node fails to follow expected behavior.T8-polkadotThis PR/Issue is related to/affects the Polkadot network.

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions