From f7eace4fc0f84f4c965eb86fc82d15122a477c2f Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Wed, 24 Apr 2024 15:27:36 +0200 Subject: [PATCH] fix(galois): fix trusted validators hash by using the computed one --- galoisd/grpc/server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/galoisd/grpc/server.go b/galoisd/grpc/server.go index 48e9b1a4b2..fde3aa8f4e 100644 --- a/galoisd/grpc/server.go +++ b/galoisd/grpc/server.go @@ -194,7 +194,7 @@ func (p *proverServer) Poll(ctx context.Context, pollReq *grpc.PollRequest) (*gr } } - getInputsHash := func(chainID string, h *types.Header) []byte { + getInputsHash := func(chainID string, h *types.Header, trustedValidatorsHash []byte) []byte { buff := []byte{} var padded [32]byte writeI64 := func(x int64) { @@ -215,12 +215,12 @@ func (p *proverServer) Poll(ctx context.Context, pollReq *grpc.PollRequest) (*gr writeMiMCHash(h.ValidatorsHash) writeMiMCHash(h.NextValidatorsHash) writeHash(h.AppHash) - writeMiMCHash(h.ValidatorsHash) + writeMiMCHash(trustedValidatorsHash) hash := sha256.Sum256(buff) return hash[1:] } - inputsHash := getInputsHash(req.Vote.ChainID, req.UntrustedHeader) + inputsHash := getInputsHash(req.Vote.ChainID, req.UntrustedHeader, trustedValidatorsRoot) log.Printf("Inputs hash: %X\n", inputsHash)