This repository has been archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
[VDB-751 VDB-754] Bugfix null pointer panic and improve logging #119
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m0ar
requested review from
yaoandrew,
elizabethengelman,
rmulhol,
aaizuss,
Gslaughl and
i-norden
July 16, 2019 12:07
m0ar
force-pushed
the
watcher-bugfix-and-better-logging
branch
from
July 16, 2019 12:09
517c688
to
5f70c6c
Compare
m0ar
force-pushed
the
watcher-bugfix-and-better-logging
branch
from
July 16, 2019 12:23
5f70c6c
to
968d0f1
Compare
i-norden
reviewed
Jul 17, 2019
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's a typo blocking the tests from passing but besides that I think everything looks good, and I agree that this is a huge improvement in the log output!
@@ -120,6 +124,7 @@ func (watcher *EventWatcher) Execute(recheckHeaders constants.TransformerExecuti | |||
|
|||
transformErr := watcher.transformLogs(logs, header) | |||
if transformErr != nil { | |||
logrus.Errorf("Could not transform logs: ", transformErr) |
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.
Looks like this is missing a formatting directive.
@@ -129,6 +129,9 @@ func (blockChain *BlockChain) GetTransactions(transactionHashes []common.Hash) ( | |||
|
|||
func (blockChain *BlockChain) LastBlock() (*big.Int, error) { | |||
block, err := blockChain.ethClient.HeaderByNumber(context.Background(), nil) | |||
if err != nil { | |||
return big.NewInt(0), err |
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.
💯
i-norden
approved these changes
Jul 17, 2019
grizz
pushed a commit
that referenced
this pull request
Oct 7, 2019
* VDB-751 VDB-754 Bugfix null pointer panic and improve logging * Fix typo
grizz
pushed a commit
that referenced
this pull request
Dec 22, 2019
* VDB-751 VDB-754 Bugfix null pointer panic and improve logging * Fix typo
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a possible null pointer panic that occurs when wrong/no
ipcpath
is set, and improves our logging a bit.I took the liberty of turning on including method in log entries, and enabled pretty printing. They look this this now, which IMO is a huge improvement since we can at a glance see the method etc.
Also learned that we can actually add more fields when we log, instead of churning it all into the same line! Keep this in mind :)