Skip to content

Commit 1c3470b

Browse files
authored
prover add debug log (#845)
1 parent 4a7d840 commit 1c3470b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

vm/payload.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package vm
22

33
import (
44
_ "embed"
5+
"log/slog"
56

67
"github.com/consensys/gnark-crypto/ecc"
78
"github.com/consensys/gnark/frontend"
@@ -242,9 +243,19 @@ func encodeSumPayload(tasks []*task.Task, projectConfig *project.Config) ([]byte
242243
}
243244
assignment.EthAddress = crypto.PubkeyToAddress(*pubkey).Big()
244245

246+
slog.Debug("sum payload", "lastTimestamp", lastTimestamp, "lastValue", lastValue, "lastSig", lastSig,
247+
"curTimestamp", curTimestamp, "curValue", curValue, "curSig", curSig, "lastPayloadHash", lastPayloadHash,
248+
"curPayloadHash", curPayloadHash)
249+
245250
witness, err := frontend.NewWitness(&assignment, ecc.BN254.ScalarField())
246251
if err != nil {
247-
return nil, err
252+
return nil, errors.Wrap(err, "failed to new witness")
248253
}
249-
return witness.MarshalBinary()
254+
255+
data, err := witness.MarshalBinary()
256+
if err != nil {
257+
return nil, errors.Wrap(err, "failed to marshal witness binary")
258+
}
259+
260+
return data, nil
250261
}

0 commit comments

Comments
 (0)