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

Use block state slot to get fork type #2440

Merged
merged 3 commits into from Apr 27, 2021
Merged

Conversation

dapplion
Copy link
Contributor

Motivation

A simpler strategy to handling multi-fork types is to deserialize the slot of the type first. This approach allows to store everything in the same bucket and allows and has almost no complexity cost.

It makes sense conceptually, you want to encode the type of the blob in the value not the key. The key should be the indexer (slot, root) which is independent of the type. A valid approach would be to encode the type as

[ForkNamePrefix] [SerializedBlock]

insteadin this approach we do

[SerializedBlock(0:100)] [ForkNamePrefix] [SerializedBlock(100:..)]

This way we are backwards compatible and have to store no extra data.

Description

Reverts #2320 and adds some methods to get the slot from a block or state blob.

@github-actions github-actions bot added Api scope-networking All issues related to networking, gossip, and libp2p. labels Apr 27, 2021
@dapplion dapplion changed the title Dapplion/slot fork key Use block state slot to get fork type Apr 27, 2021
@codeclimate
Copy link

codeclimate bot commented Apr 27, 2021

Code Climate has analyzed commit 0fc41f9 and detected 5 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Duplication 4

View more on Code Climate.

@wemeetagain wemeetagain merged commit caf0f4a into master Apr 27, 2021
@wemeetagain wemeetagain deleted the dapplion/slot-fork-key branch April 27, 2021 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope-networking All issues related to networking, gossip, and libp2p.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants