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

Log batch header hash in hex instead of bytes #594

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (n *Node) Start(ctx context.Context) error {
if n.Config.RegisterNodeAtStart {
n.Logger.Info("Registering node on chain with the following parameters:", "operatorId",
n.Config.ID.Hex(), "hostname", n.Config.Hostname, "dispersalPort", n.Config.DispersalPort,
"retrievalPort", n.Config.RetrievalPort, "churnerUrl", n.Config.ChurnerUrl, "quorumIds", n.Config.QuorumIDList)
"retrievalPort", n.Config.RetrievalPort, "churnerUrl", n.Config.ChurnerUrl, "quorumIds", fmt.Sprint(n.Config.QuorumIDList))
socket := string(core.MakeOperatorSocket(n.Config.Hostname, n.Config.DispersalPort, n.Config.RetrievalPort))
privateKey, err := crypto.HexToECDSA(n.Config.EthClientConfig.PrivateKeyString)
if err != nil {
Expand Down Expand Up @@ -355,7 +355,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)
log.Debug("Batch validation failed, rolling back the key/value entries stored in database", "number of entires", len(*result.keys), "batchHeaderHash", batchHeaderHashHex)
if deleteKeysErr := n.Store.DeleteKeys(ctx, result.keys); deleteKeysErr != nil {
log.Error("Failed to delete the invalid batch that should be rolled back", "batchHeaderHash", batchHeaderHashHex, "err", deleteKeysErr)
}
Expand All @@ -368,14 +368,14 @@ func (n *Node) ProcessBatch(ctx context.Context, header *core.BatchHeader, blobs
// Before we sign the batch, we should first complete the batch storing successfully.
result := <-storeChan
if result.err != nil {
log.Error("Store batch failed", "batchHeaderHash", batchHeaderHash, "err", result.err)
log.Error("Store batch failed", "batchHeaderHash", batchHeaderHashHex, "err", result.err)
return nil, err
}
if result.keys != nil {
n.Metrics.RecordStoreChunksStage("stored", batchSize, result.latency)
n.Logger.Debug("Store batch succeeded", "batchHeaderHash", batchHeaderHash, "duration:", result.latency)
n.Logger.Debug("Store batch succeeded", "batchHeaderHash", batchHeaderHashHex, "duration:", result.latency)
} else {
n.Logger.Warn("Store batch skipped because the batch already exists in the store", "batchHeaderHash", batchHeaderHash)
n.Logger.Warn("Store batch skipped because the batch already exists in the store", "batchHeaderHash", batchHeaderHashHex)
}

// Sign batch header hash if all validation checks pass and data items are written to database.
Expand Down
2 changes: 1 addition & 1 deletion node/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func RegisterOperator(ctx context.Context, operator *Operator, transactor core.T
return nil
}

logger.Info("Quorums to register for", "quorums", quorumsToRegister)
logger.Info("Quorums to register for", "quorums", fmt.Sprint(quorumsToRegister))

// register for quorums
shouldCallChurner := false
Expand Down
Loading