From 242c38021841ac418ebe7ef4895c7a2eb3252ed9 Mon Sep 17 00:00:00 2001 From: kaleofduty <59616916+kaleofduty@users.noreply.github.com> Date: Tue, 8 Apr 2025 15:07:41 +0200 Subject: [PATCH] Hotfix: - downgrade go-ethereum to v1.15.3 - re-add missing code in outcome generation Based on a1b823f6dc40edaa950158e15aa454bfd71dd49b --- go.mod | 2 +- go.sum | 4 ++-- .../ocr3/protocol/outcome_generation_leader.go | 12 ++++++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 75b65517..5df5acaf 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.23.0 toolchain go1.23.6 require ( - github.com/ethereum/go-ethereum v1.15.6 + github.com/ethereum/go-ethereum v1.15.3 github.com/leanovate/gopter v0.2.11 github.com/mr-tron/base58 v1.2.0 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 84039d59..d0671025 100644 --- a/go.sum +++ b/go.sum @@ -59,8 +59,8 @@ github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRk github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/ethereum/c-kzg-4844 v1.0.3 h1:IEnbOHwjixW2cTvKRUlAAUOeleV7nNM/umJR+qy4WDs= github.com/ethereum/c-kzg-4844 v1.0.3/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.15.6 h1:jgLoUM6/pNjp0uEnXyWcWikDwa4j1wZlcqkX8Pm8A+I= -github.com/ethereum/go-ethereum v1.15.6/go.mod h1:+S9k+jFzlyVTNcYGvqFhzN/SFhI6vA+aOY4T5tLSPL0= +github.com/ethereum/go-ethereum v1.15.3 h1:OeTWAq6r8iR89bfJDjmmOemE74ywArl9DUViFsVj3Y8= +github.com/ethereum/go-ethereum v1.15.3/go.mod h1:jMXlpZXfSar1mGs/5sB0aEpEnPsiE1Jn6/3anlueqz8= github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8= github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= github.com/ferranbt/fastssz v0.1.2 h1:Dky6dXlngF6Qjc+EfDipAkE83N5I5DE68bY6O0VLNPk= diff --git a/offchainreporting2plus/internal/ocr3/protocol/outcome_generation_leader.go b/offchainreporting2plus/internal/ocr3/protocol/outcome_generation_leader.go index 5104b99b..bd09055f 100644 --- a/offchainreporting2plus/internal/ocr3/protocol/outcome_generation_leader.go +++ b/offchainreporting2plus/internal/ocr3/protocol/outcome_generation_leader.go @@ -79,7 +79,7 @@ func (outgen *outcomeGenerationState[RI]) messageEpochStartRequest(msg MessageEp return } - notBadCount := 0 // Note: just because a request is not bad does not mean it's good. Tertium datur! + notBadCount := 0 // Note: just because a request is not marked bad does not mean it's good. Tertium datur! for _, epochStartRequest := range outgen.leaderState.epochStartRequests { if epochStartRequest.bad { continue @@ -91,18 +91,26 @@ func (outgen *outcomeGenerationState[RI]) messageEpochStartRequest(msg MessageEp return } + // The not-bad entries in epochStartRequests here are guaranteed to be + // nonempty due to definition of ByzQuorumSize. var maxSender *commontypes.OracleID for sender, epochStartRequest := range outgen.leaderState.epochStartRequests { + if epochStartRequest.bad { + continue + } if maxSender != nil { maxTimestamp := outgen.leaderState.epochStartRequests[*maxSender].message.HighestCertified.Timestamp() if !maxTimestamp.Less31(epochStartRequest.message.HighestCertified.Timestamp()) { continue } } - maxSender = &sender } + if maxSender == nil { + return + } + maxRequest := outgen.leaderState.epochStartRequests[*maxSender] if !maxRequest.message.HighestCertified.Timestamp().Equal(maxRequest.message.SignedHighestCertifiedTimestamp.HighestCertifiedTimestamp) {