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

[do not merge] fix: Catch Batch C1 exceptions #359

Closed
wants to merge 1 commit into from
Closed
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
46 changes: 27 additions & 19 deletions extern/supraseal/sealing/supra_seal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,29 +207,37 @@ int c1(size_t block_offset, size_t num_sectors, size_t sector_slot,
const uint8_t* ticket, const char* cache_path,
const char* parents_filename, const char* replica_path,
size_t sector_size) {
size_t qpair = sealing_ctx->topology->c1_qpair;
int node_reader_core = sealing_ctx->topology->c1_reader;
const char* output_dir = cache_path;
try {
size_t qpair = sealing_ctx->topology->c1_qpair;
int node_reader_core = sealing_ctx->topology->c1_reader;
const char* output_dir = cache_path;

init_ctx(sector_size);
init_ctx(sector_size);

#define CALL_C1(C) \
{ \
streaming_node_reader_t<C> reader(sealing_ctx->controllers, qpair, \
block_offset, node_reader_core, \
sealing_ctx->topology->c1_sleep_time); \
return do_c1<C>(reader, \
num_sectors, sector_slot, \
replica_id, seed, \
ticket, cache_path, \
parents_filename, replica_path, \
output_dir); \
}
#define CALL_C1(C) \
{ \
streaming_node_reader_t<C> reader(sealing_ctx->controllers, qpair, \
block_offset, node_reader_core, \
sealing_ctx->topology->c1_sleep_time); \
return do_c1<C>(reader, \
num_sectors, sector_slot, \
replica_id, seed, \
ticket, cache_path, \
parents_filename, replica_path, \
output_dir); \
}

SECTOR_PARAMS_TABLE(SECTOR_CALL_TABLE(CALL_C1));
#undef CALL_C1
SECTOR_PARAMS_TABLE(SECTOR_CALL_TABLE(CALL_C1));
#undef CALL_C1

return 0;
return 0;
} catch (const std::exception& e) {
fprintf(stderr, "Exception in c1: %s\n", e.what());
std::terminate();
} catch (...) {
fprintf(stderr, "Unknown exception in c1\n");
std::terminate();
}
}

template<class C>
Expand Down
Loading