-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[DO NOT MERGE] Use RLNC for block propagation #14813
Draft
potuz
wants to merge
16
commits into
develop
Choose a base branch
from
rlnc
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
340d4bd
add committer
potuz 22f4234
Add chunks and message verifying
potuz e0be8c3
Add echelon form and addRow
potuz 81d3f2f
Add node, receive and prepare message functions
potuz 8ac7986
Add decoding and tests.
potuz e634aea
Add feature flag
potuz 693439f
Handle incoming chunks on the P2P layer
potuz b067248
Add a cache for incoming chunks
potuz d0ed0b0
prune the chunk cache every 10 minutes
potuz 2d1d11c
Handle the block when it can be recovered
potuz 36a13c3
Add chunk broadcasting
potuz 2a6e408
Add Ristretto trusted setup
potuz 5ac6059
remove signature check
potuz e2d6c6f
Add endpoint to propose blocks
potuz 8edc6dd
Add the signatures over the commitments to the block before processin…
potuz a34838a
Do not check blob signature
potuz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
load("@prysm//tools/go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = ["signature.go"], | ||
importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/chunks", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//beacon-chain/core/signing:go_default_library", | ||
"//beacon-chain/state:go_default_library", | ||
"//config/params:go_default_library", | ||
"//consensus-types/interfaces:go_default_library", | ||
"//consensus-types/primitives:go_default_library", | ||
"//network/forks:go_default_library", | ||
"//time/slots:go_default_library", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package chunks | ||
|
||
import ( | ||
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/signing" | ||
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state" | ||
"github.com/prysmaticlabs/prysm/v5/config/params" | ||
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" | ||
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" | ||
"github.com/prysmaticlabs/prysm/v5/network/forks" | ||
"github.com/prysmaticlabs/prysm/v5/time/slots" | ||
) | ||
|
||
// VerifyChunkSignature verifies the proposer signature of a beacon block chunk. | ||
func VerifyChunkSignature(beaconState state.ReadOnlyBeaconState, | ||
proposerIndex primitives.ValidatorIndex, | ||
sig []byte, | ||
rootFunc func() ([32]byte, error)) error { | ||
currentEpoch := slots.ToEpoch(beaconState.Slot()) | ||
domain, err := signing.Domain(beaconState.Fork(), currentEpoch, params.BeaconConfig().DomainBeaconProposer, beaconState.GenesisValidatorsRoot()) | ||
if err != nil { | ||
return err | ||
} | ||
proposer, err := beaconState.ValidatorAtIndex(proposerIndex) | ||
if err != nil { | ||
return err | ||
} | ||
proposerPubKey := proposer.PublicKey | ||
return signing.VerifyBlockSigningRoot(proposerPubKey, sig, domain, rootFunc) | ||
} | ||
|
||
// VerifyChunkSignatureUsingCurrentFork verifies the proposer signature of a beacon block chunk. This differs | ||
// from the above method by not using fork data from the state and instead retrieving it | ||
// via the respective epoch. | ||
func VerifyChunkSignatureUsingCurrentFork(beaconState state.ReadOnlyBeaconState, chunk interfaces.ReadOnlyBeaconBlockChunk) error { | ||
currentEpoch := slots.ToEpoch(chunk.Slot()) | ||
fork, err := forks.Fork(currentEpoch) | ||
if err != nil { | ||
return err | ||
} | ||
domain, err := signing.Domain(fork, currentEpoch, params.BeaconConfig().DomainBeaconProposer, beaconState.GenesisValidatorsRoot()) | ||
if err != nil { | ||
return err | ||
} | ||
proposer, err := beaconState.ValidatorAtIndex(chunk.ProposerIndex()) | ||
if err != nil { | ||
return err | ||
} | ||
proposerPubKey := proposer.PublicKey | ||
sig := chunk.Signature() | ||
return signing.VerifyBlockSigningRoot(proposerPubKey, sig[:], domain, func() ([32]byte, error) { | ||
return chunk.HeaderRoot(), nil | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This needs to be implemented like mentioned on gossip: instead of calling broadcast for a single message, each peer needs to get a different chunk.