From 3b0a52287b5ba8853191b51b758b81b6266190f7 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 28 Aug 2024 13:41:30 +0300 Subject: [PATCH] send: construct PreBlock instead of PreHeader to create PreCommit PreHeader is not enough to create PreCommit because PreCommit requires the whole set of transactions to be available for PreCommit data calculations. This bug leads to the fact that Primary node can't properly construct valid PreCommit message because block's transactions are not yet filled by dBFT by this moment. Signed-off-by: Anna Shaleva --- CHANGELOG.md | 1 + send.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1603e272..b892cc72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Improvements: Bugs fixed: * context-bound PreBlock and PreHeader are not reset properly (#127) + * PreHeader is constructed instead of PreBlock to create PreCommit message (#128) ## [0.3.0] (01 August 2024) diff --git a/send.go b/send.go index 5b25e4e1..cc9c5082 100644 --- a/send.go +++ b/send.go @@ -104,7 +104,7 @@ func (c *Context[H]) makePreCommit() ConsensusPayload[H] { return msg } - if preB := c.MakePreHeader(); preB != nil { + if preB := c.CreatePreBlock(); preB != nil { var preData []byte if err := preB.SetData(c.Priv); err == nil { preData = preB.Data()