From 7da34db285c4d480ea77f31f888ef12e6b28db9e Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Thu, 12 Sep 2024 15:54:44 +0300 Subject: [PATCH] context: enable anti-MEV extension starting from specified height Processing block should be taken into account while checking anti-MEV extension enabling height. Signed-off-by: Anna Shaleva --- CHANGELOG.md | 1 + context.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a6a11c1..2c16a54a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,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) + * enable anti-MEV extension with respect to the current block index (#132) ## [0.3.0] (01 August 2024) diff --git a/context.go b/context.go index c580349c..1a046cfe 100644 --- a/context.go +++ b/context.go @@ -360,7 +360,7 @@ func (c *Context[H]) CreatePreBlock() PreBlock[H] { // isAntiMEVExtensionEnabled returns whether Anti-MEV dBFT extension is enabled // at the currently processing block height. func (c *Context[H]) isAntiMEVExtensionEnabled() bool { - return c.Config.AntiMEVExtensionEnablingHeight >= 0 && uint32(c.Config.AntiMEVExtensionEnablingHeight) < c.BlockIndex + return c.Config.AntiMEVExtensionEnablingHeight >= 0 && uint32(c.Config.AntiMEVExtensionEnablingHeight) <= c.BlockIndex } // MakeHeader returns half-filled block for the current epoch.