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

Add ExecutionReceiptSignatures and ResultApprovalSignatures to BlockSeal #170

Merged
merged 2 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions block.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,16 @@ type BlockPayload struct {
Seals []*BlockSeal
}

// BlockSeal is the attestation by verification nodes that the transactions in a previously
// executed block have been verified.
type BlockSeal struct {
BlockID Identifier
ExecutionReceiptID Identifier
// TODO: ExecutionReceiptSignatures
// TODO: ResultApprovalSignatures
// The ID of the block this Seal refers to (which will be of lower height than this block)
BlockID Identifier

// The ID of the execution receipt generated by the Verifier nodes; the work of verifying a
// block produces the same receipt among all verifying nodes
ExecutionReceiptID Identifier

ExecutionReceiptSignatures [][]byte
ResultApprovalSignatures [][]byte
}
16 changes: 8 additions & 8 deletions client/convert/protobuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ func CollectionGuaranteeToMessage(g flow.CollectionGuarantee) *entities.Collecti

func BlockSealToMessage(g flow.BlockSeal) *entities.BlockSeal {
return &entities.BlockSeal{
BlockId: g.BlockID.Bytes(),
ExecutionReceiptId: g.ExecutionReceiptID.Bytes(),
// TODO: ExecutionReceiptSignatures
// TODO: ResultApprovalSignatures
BlockId: g.BlockID.Bytes(),
ExecutionReceiptId: g.ExecutionReceiptID.Bytes(),
ExecutionReceiptSignatures: g.ExecutionReceiptSignatures,
ResultApprovalSignatures: g.ResultApprovalSignatures,
}
}

Expand All @@ -291,10 +291,10 @@ func MessageToBlockSeal(m *entities.BlockSeal) (flow.BlockSeal, error) {
}

return flow.BlockSeal{
BlockID: flow.BytesToID(m.BlockId),
ExecutionReceiptID: flow.BytesToID(m.ExecutionReceiptId),
// TODO: ExecutionReceiptSignatures
// TODO: ResultApprovalSignatures
BlockID: flow.BytesToID(m.BlockId),
ExecutionReceiptID: flow.BytesToID(m.ExecutionReceiptId),
ExecutionReceiptSignatures: m.ExecutionReceiptSignatures,
ResultApprovalSignatures: m.ResultApprovalSignatures,
}, nil
}

Expand Down
6 changes: 4 additions & 2 deletions test/entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@ func BlockSealGenerator() *BlockSeals {

func (g *BlockSeals) New() *flow.BlockSeal {
return &flow.BlockSeal{
BlockID: g.ids.New(),
ExecutionReceiptID: g.ids.New(),
BlockID: g.ids.New(),
ExecutionReceiptID: g.ids.New(),
ExecutionReceiptSignatures: [][]byte{},
ResultApprovalSignatures: [][]byte{},
}
}

Expand Down