Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include signature in message receiving logs #264

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

emlautarom1
Copy link
Contributor

Current Behavior

Currently, when logging messages that contain a bls.Signature we're logging a pointer address rather than its contents.

New Behavior

Whenever we log these messages we log their value rather that their representation

Breaking Changes

This change should not introduce any breaking changes.

Observations

The original code used fmt.Sprintf("%#v", ...) in the log calls which did not dereference the pointers. This behavior is present since #12 but there is no clear indication on why it was done that way.

@emlautarom1 emlautarom1 linked an issue Jul 1, 2024 that may be closed by this pull request
@Hyodar
Copy link
Contributor

Hyodar commented Jul 1, 2024

Great! Can you include a snippet of the logs right now?

@emlautarom1
Copy link
Contributor Author

It will look something like this:

2024-07-01T13:31:40.252-0300    INFO    rest_server/log_test.go:23      Received signed operator set update message     {"message": {"Message":{"Id":100,"Timestamp":200,"Operators":[{"Pubkey":{"X":3,"Y":4},"Weight":5}]},"BlsSignature":{"g1_point":{"X":1,"Y":2}},"OperatorId":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}}

To get a better representation we could use something like BlsSignature.Serialize() which looks like the following:

2024-07-01T13:33:32.477-0300    INFO    rest_server/log_test.go:23      Received signed operator set update message     {"message": {"Message":{"Id":100,"Timestamp":200,"Operators":[{"Pubkey":{"X":3,"Y":4},"Weight":5}]},"BlsSignature":{"g1_point":{"X":1,"Y":2}},"OperatorId":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}, "signature": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=="}

@Hyodar
Copy link
Contributor

Hyodar commented Jul 1, 2024

That's all right really. Usually these signatures are represented as E(x, y) indeed, without hex.

@Hyodar
Copy link
Contributor

Hyodar commented Jul 1, 2024

It's fine as it is IMO

@emlautarom1
Copy link
Contributor Author

Merging and closing #247

@emlautarom1 emlautarom1 merged commit 3bd142d into main Jul 1, 2024
5 checks passed
@Hyodar Hyodar deleted the fix/log-pointer-deref branch October 3, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include signature in message receiving logs
3 participants