Skip to content

Commit

Permalink
fix(galois): fix trusted validators hash by using the computed one (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-aitlahcen authored Apr 24, 2024
2 parents 9fe822b + f7eace4 commit 03bf5a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions galoisd/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)

Expand Down

0 comments on commit 03bf5a7

Please sign in to comment.