NethermindEth / near-sffl

https://nffl.nethermind.io/
MIT License
6 stars 3 forks source link

Include signature in message receiving logs #247

Closed Hyodar closed 3 days ago

Hyodar commented 4 weeks ago

We should also log the signatures from received signed task responses and messages - this way, we can also access the individual signature through logs for any debugging process. The current log displays the signature pointer only. This was already implemented in a naive way in testnet-0, but should be revisited.

emlautarom1 commented 1 week ago

This is already implemented:

https://github.com/NethermindEth/near-sffl/blob/8f43707c78ba61820b3d0b18a27c2afe2e930672/aggregator/rpc_server/server.go#L95

https://github.com/NethermindEth/near-sffl/blob/8f43707c78ba61820b3d0b18a27c2afe2e930672/aggregator/rpc_server/server.go#L115

https://github.com/NethermindEth/near-sffl/blob/8f43707c78ba61820b3d0b18a27c2afe2e930672/aggregator/rpc_server/server.go#L133

For example, this is how we're logging messages.SignedCheckpointTaskResponse:

2024-06-24T16:21:34.471-0300    INFO    rpc_server/server_test.go:27    Received signed task response   {"response": "messages.SignedCheckpointTaskResponse{TaskResponse:messages.CheckpointTaskResponse{ReferenceTaskIndex:0x7b, StateRootUpdatesRoot:[32]uint8{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, OperatorSetUpdatesRoot:[32]uint8{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}, BlsSignature:bls.Signature{G1Point:(*bls.G1Point)(0xc000074150)}, OperatorId:types.Bytes32{0xe9, 0xb, 0x7b, 0xce, 0xb6, 0xe7, 0xdf, 0x54, 0x18, 0xfb, 0x78, 0xd8, 0xee, 0x54, 0x6e, 0x97, 0xc8, 0x3a, 0x8, 0xbb, 0xcc, 0xc0, 0x1a, 0x6, 0x44, 0xd5, 0x99, 0xcc, 0xd2, 0xa7, 0xc2, 0xe0}}"}
Hyodar commented 4 days ago

The current log displays the signature pointer only.

This is the issue

emlautarom1 commented 4 days ago

For some reason I confused the bls.Signature pointer with its value. Fixed on #264