Skip to content

chainparams: do not log signet startup messages for other chains - #20048

Merged
maflcko merged 1 commit into
bitcoin:masterfrom
jonatack:signet-startup-logging-bugfix
Oct 1, 2020
Merged

maflcko merged 1 commit into
bitcoin:masterfrom
jonatack:signet-startup-logging-bugfix

Conversation

@jonatack

@jonatack jonatack commented Sep 30, 2020 •

Copy link
Copy Markdown
Member

The following signet startup messages are printed to the debug log immediately on node startup for all chains. This behavior occurs on master as a side effect after the merge of #20014. This PR removes the first message and moves the signet derived magic logging to init.cpp.

$ ./src/bitcoind
2020-09-30T14:25:15Z Using default signet network
2020-09-30T14:25:15Z Signet derived magic (message start): 0a03cf40
2020-09-30T14:25:15Z Bitcoin Core version v0.20.99.0 ...

@maflcko

maflcko commented Sep 30, 2020

Copy link
Copy Markdown
Member

Seems odd for a constructor to log anyway. I'd say to remove them or move them elsewhere

@jonatack

Copy link
Copy Markdown
Member Author

Makes sense, but I didn't move them because they are related to the values being set, and because the first message interrelates with the other -signetchallenge messages and value settings. Pinging @kallewoof for thoughts.

@practicalswift

Copy link
Copy Markdown
Contributor

Concept ACK

Agree with MarcoFalke regarding removing them from the ctor.

@hebasto

hebasto commented Sep 30, 2020

Copy link
Copy Markdown
Member

Concept ACK.

@kallewoof kallewoof left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept and utACK

@kallewoof

Copy link
Copy Markdown
Contributor

Removing is fine, but they're useful esp for custom signets since you need the magic for external software.

@maflcko

maflcko commented Oct 1, 2020

Copy link
Copy Markdown
Member

The magic is logged unconditionally in the constructor. If needed, it can be logged unconditionally in the startup-sequence, e.g. init.cpp

and move signet network magic logging from chainparams.cpp to init.cpp
@jonatack
jonatack force-pushed the signet-startup-logging-bugfix branch from 8fdcadb to 6fccad7 Compare October 1, 2020 09:27
@jonatack

jonatack commented Oct 1, 2020

Copy link
Copy Markdown
Member Author

Updated proposal: removed the first message and moved the signet network magic message to init.cpp.

@kallewoof kallewoof left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 6fccad7

@hebasto hebasto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 6fccad7

Maybe also add testing for not appearing signet messages in the log if not on signet?

@maflcko

maflcko commented Oct 1, 2020

Copy link
Copy Markdown
Member

ACK 6fccad7

@maflcko
maflcko merged commit 9fc2f01 into bitcoin:master Oct 1, 2020
@jonatack
jonatack deleted the signet-startup-logging-bugfix branch October 1, 2020 11:34
@jonatack

jonatack commented Oct 1, 2020

Copy link
Copy Markdown
Member Author

Maybe also add testing for not appearing signet messages in the log if not on signet?

TBH was tempted but thought even the one added test might be overkill.

@maflcko

maflcko commented Oct 1, 2020

Copy link
Copy Markdown
Member

Maybe also add testing for not appearing signet messages in the log if not on signet?

I just tested this manually, and it seems unlikely and low-risk to regress

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants