-
Notifications
You must be signed in to change notification settings - Fork 231
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
relax BlockRef
database assumptions
#3472
Conversation
daf4993
to
8df2abb
Compare
* remove `getForkedBlock(BlockRef)` which assumes block data exists but doesn't support archive/backfilled blocks * fix REST `/eth/v1/beacon/headers` request not returning archive/backfilled blocks * avoid re-encoding in REST block SSZ requests (using `getBlockSSZ`)
@@ -198,7 +198,7 @@ func toBlockSlotId*(bs: BlockSlot): BlockSlotId = | |||
|
|||
func isProposed*(bid: BlockId, slot: Slot): bool = | |||
## Return true if `bid` was proposed in the given slot | |||
bid.slot == slot | |||
bid.slot == slot and not bid.root.isZero |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a test for that? Or in which situation do we get a 0 block id (backfill?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zero is returned if the block is not found (should probably change that to Option at some point but .. ) - there were tests but they didn't cover zero
data.signature.toRaw() != signed_beacon_block.signature.toRaw(): | ||
return errIgnore("BeaconBlock: already proposed in the same slot") | ||
let curBlock = dag.getForkedBlock(slotBlock.blck.bid) | ||
if curBlock.isOk(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing happens if the curBlock is an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing - we don't have the block so there's nothing to compare with (should typically not happen, except in weird timing scenarios)
getForkedBlock(BlockRef)
which assumes block data exists butdoesn't support archive/backfilled blocks
/eth/v1/beacon/headers
request not returningarchive/backfilled blocks
getBlockSSZ
)