Skip to content

Commit a11f637

Browse files
committedMar 12, 2025·
[Malleability] Header: move ProposerSigData to new Proposal type
1 parent 485e20c commit a11f637

File tree

73 files changed

+643
-435
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+643
-435
lines changed
 

‎cmd/consensus/main.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -793,10 +793,15 @@ func main() {
793793
if !startupTime.IsZero() {
794794
opts = append(opts, consensus.WithStartupTime(startupTime))
795795
}
796-
finalizedBlock, pending, err := recovery.FindLatest(node.State, node.Storage.Headers)
796+
finalizedBlock, pendingOrig, err := recovery.FindLatest(node.State, node.Storage.Headers)
797797
if err != nil {
798798
return nil, err
799799
}
800+
// TODO(tim) proposer signature storage
801+
pending := make([]*flow.Proposal, 0, len(pendingOrig))
802+
for _, p := range pendingOrig {
803+
pending = append(pending, &flow.Proposal{Header: p, ProposerSigData: nil})
804+
}
800805

801806
// initialize hotstuff consensus algorithm
802807
hot, err = consensus.NewParticipant(

‎consensus/follower.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,15 @@ func NewFollower(log zerolog.Logger,
3737
return nil, fmt.Errorf("could not initialize forks: %w", err)
3838
}
3939

40+
// TODO(tim) - proposerSigData storage
41+
// Followers don't need proposer signature (and all headers in storage must have been already verified)
42+
pendingProposals := make([]*flow.Proposal, 0, len(pending))
43+
for _, p := range pending {
44+
pendingProposals = append(pendingProposals, &flow.Proposal{Header: p, ProposerSigData: nil})
45+
}
46+
4047
// recover forks internal state (inserts all pending blocks)
41-
err = recovery.Recover(log, pending, recovery.ForksState(forks))
48+
err = recovery.Recover(log, pendingProposals, recovery.ForksState(forks))
4249
if err != nil {
4350
return nil, fmt.Errorf("could not recover hotstuff follower state: %w", err)
4451
}

0 commit comments

Comments
 (0)
Please sign in to comment.