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

fix bug #1584

Merged
merged 1 commit into from
Oct 6, 2023
Merged

fix bug #1584

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
24 changes: 16 additions & 8 deletions go/enclave/rpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,16 @@ func (s *RPCServer) GetBatch(_ context.Context, request *generated.GetBatchReque
}

encodedBatch, encodingErr := batch.Encoded()
return &generated.GetBatchResponse{
Batch: encodedBatch,
SystemError: &generated.SystemError{
var sysErr *generated.SystemError
if encodingErr != nil {
sysErr = &generated.SystemError{
ErrorCode: 2,
ErrorString: encodingErr.Error(),
},
}
}
return &generated.GetBatchResponse{
Batch: encodedBatch,
SystemError: sysErr,
}, err
}

Expand All @@ -329,12 +333,16 @@ func (s *RPCServer) GetBatchBySeqNo(_ context.Context, request *generated.GetBat
}

encodedBatch, encodingErr := batch.Encoded()
return &generated.GetBatchResponse{
Batch: encodedBatch,
SystemError: &generated.SystemError{
var sysErr *generated.SystemError
if encodingErr != nil {
sysErr = &generated.SystemError{
ErrorCode: 2,
ErrorString: encodingErr.Error(),
},
}
}
return &generated.GetBatchResponse{
Batch: encodedBatch,
SystemError: sysErr,
}, err
}

Expand Down
2 changes: 1 addition & 1 deletion go/host/enclave/guardian.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ func (g *Guardian) periodicRollupProduction() {
// estimate the size of a compressed rollup
availBatchesSumSize, err := g.calculateNonRolledupBatchesSize(fromBatch)
if err != nil {
g.logger.Error("Unable to estimate the size of the current rollup", log.ErrKey, err)
g.logger.Error("Unable to estimate the size of the current rollup", log.ErrKey, err, "from_batch", fromBatch)
// todo - this should not happen. Is it worth continuing?
availBatchesSumSize = 0
}
Expand Down
Loading