From 2b5a3f85dcb274d99099cd161b2ea4f0e8fe79b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Tr=C4=85d?= Date: Tue, 30 Apr 2024 18:06:48 +0200 Subject: [PATCH] Add more logging during loading (#63) --- prover/marshal.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/prover/marshal.go b/prover/marshal.go index 4f26cfc..7ea23b5 100644 --- a/prover/marshal.go +++ b/prover/marshal.go @@ -8,6 +8,7 @@ import ( "io" "math/big" "os" + "worldcoin/gnark-mbu/logging" "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark/backend/groth16" @@ -289,6 +290,7 @@ func (ps *ProvingSystem) UnsafeReadFrom(r io.Reader) (int64, error) { var totalRead int64 = 0 var intBuf [4]byte + logging.Logger().Debug().Msg("Reading tree depth") read, err := io.ReadFull(r, intBuf[:]) totalRead += int64(read) if err != nil { @@ -296,6 +298,7 @@ func (ps *ProvingSystem) UnsafeReadFrom(r io.Reader) (int64, error) { } ps.TreeDepth = binary.BigEndian.Uint32(intBuf[:]) + logging.Logger().Debug().Msg("Reading batch size") read, err = io.ReadFull(r, intBuf[:]) totalRead += int64(read) if err != nil { @@ -303,6 +306,7 @@ func (ps *ProvingSystem) UnsafeReadFrom(r io.Reader) (int64, error) { } ps.BatchSize = binary.BigEndian.Uint32(intBuf[:]) + logging.Logger().Debug().Msg("Reading proving key") ps.ProvingKey = groth16.NewProvingKey(ecc.BN254) keyRead, err := ps.ProvingKey.UnsafeReadFrom(r) totalRead += keyRead @@ -310,6 +314,7 @@ func (ps *ProvingSystem) UnsafeReadFrom(r io.Reader) (int64, error) { return totalRead, err } + logging.Logger().Debug().Msg("Reading verifying key") ps.VerifyingKey = groth16.NewVerifyingKey(ecc.BN254) keyRead, err = ps.VerifyingKey.UnsafeReadFrom(r) totalRead += keyRead @@ -317,6 +322,7 @@ func (ps *ProvingSystem) UnsafeReadFrom(r io.Reader) (int64, error) { return totalRead, err } + logging.Logger().Debug().Msg("Reading constraint system") ps.ConstraintSystem = groth16.NewCS(ecc.BN254) keyRead, err = ps.ConstraintSystem.ReadFrom(r) totalRead += keyRead