FuelLabs / fuel-core

Rust full node implementation of the Fuel v2 protocol.
Other
57.96k stars 2.79k forks source link

Remove use of `Option<BlockHeight>` as a query for blocks #2005

Open MitchTurner opened 4 months ago

MitchTurner commented 4 months ago

There are a number of places we use Option<BlockHeight> to represent the block, where None is the genesis block. This is confusing, as it's implicit what None means without looking at the code.

Instead, we should introduce some type with the same cardinality, but with explicit names:

something like

enum BlockQuery {
    Specific(BlockHeight),
    Genesis,
}
abdegenius commented 3 weeks ago

Hey @MitchTurner i can work on this issue.. should i go ahead and take it up?!

MitchTurner commented 3 weeks ago

@abdegenius Hey! I believe that @matt-user has already dug into this here. It looks like it's still blocked on some reviews.

abdegenius commented 3 weeks ago

Oh ok then, let me know if it is still a problem so i can jump on it.