-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Downgrade duplicate nonce logs to debug #4933
Downgrade duplicate nonce logs to debug #4933
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't change the grouping of imports.
Also, what exactly does this fix?
Should have been printed, not printed |
chain/messagepool/messagepool.go
Outdated
log.Infof("add with duplicate nonce. message from %s with nonce %d already in mpool,"+ | ||
" increase GasPremium to %s from %s to trigger replace by fee: %w", | ||
m.Message.From, m.Message.Nonce, minPrice, m.Message.GasPremium, | ||
ErrRBFTooLowPremium) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no reason to construct a wrapped error for this log, just log what you need; Also note you are repeating the information from the error, which will get logged together with the previous log message.
So I don't see this as adding anything.
I don't think this pr adds anything! |
chain/messagepool/messagepool.go
Outdated
"newpremium", m.Message.GasPremium, "addr", m.Message.From, "nonce", m.Message.Nonce) | ||
} else { | ||
log.Info("add with duplicate nonce") | ||
log.Debugf("add with duplicate nonce. message from %s with nonce %d already in mpool,"+ | ||
" increase GasPremium to %s from %s to trigger replace by fee: %w", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this %w
formatting directive is invalid in the log, it's only valid in the error wrapping function; it should be %s
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @vyzo thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI to all, the best format to use for errors is %v
, or if you want detailed info %+v
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not necessary here - it's not a structured error.
Can we squash this down to one commit? It's really messy for something that changes two incosequential lines of code. |
* add messagepool duplicate nonce print info * update log.Info to log.debug and go fmt * recover the grouping of imports * update print from info to debug * print format %w to %s
fix #4932