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

Misc node log fixes #515

Merged
merged 2 commits into from
May 14, 2024
Merged

Misc node log fixes #515

merged 2 commits into from
May 14, 2024

Conversation

jianoaix
Copy link
Contributor

@jianoaix jianoaix commented Apr 23, 2024

Why are these changes needed?

Make sure each exit of batch processing has a log

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@jianoaix jianoaix changed the title Log the reference block at which the batch is validated Misc node log fixes May 13, 2024
@jianoaix jianoaix requested review from dmanc and ian-shim May 13, 2024 23:55
Copy link
Contributor

@dmanc dmanc left a comment

Choose a reason for hiding this comment

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

lgtm just some minor stuff

@@ -350,6 +350,7 @@ func (n *Node) ProcessBatch(ctx context.Context, header *core.BatchHeader, blobs
// revert all the keys for that batch.
result := <-storeChan
if result.keys != nil {
log.Debug("Batch validation failed, rolling back the key/value entries stored in database", "number of entires", len(*result.keys), "batchHeaderHash", batchHeaderHash)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use batchHeaderHashHex instead

Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment for below logs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"batchHeaderHash" is what is used elsewhere, I'm keeping it for consistency

node/node.go Outdated
n.Logger.Debug("Store batch took", "duration:", time.Duration(result.latency*float64(time.Millisecond)))
n.Logger.Debug("Store batch succeeded", "batchHeaderHash", batchHeaderHash, "duration:", time.Duration(result.latency*float64(time.Millisecond)))
} else {
n.Logger.Warn("Store batch skipped because the batch already exists in the store", "batchHeadherHash", batchHeaderHash)
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: batchHeadherHash -> batchHeaderHash

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@jianoaix jianoaix merged commit 3927a96 into Layr-Labs:master May 14, 2024
5 checks passed
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.

2 participants