Rearchitected state sync with hpfs. (#96)

This commit is contained in:
Ravin Perera
2020-06-10 20:51:45 +05:30
committed by GitHub
parent 9ee09bebb7
commit b89dbe0a2c
32 changed files with 1383 additions and 867 deletions

View File

@@ -56,13 +56,12 @@ namespace sc
LOG_ERR << "Contract process exited with non-normal status code: " << presult;
goto failure;
}
if (stop_hpfs_rw_session(state_hash) != 0)
goto failure;
}
else if (pid == 0)
{
// Contract process.
util::unmask_signal();
// Set up the process environment and overlay the contract binary program with execv().
// Close all fds unused by SC process.
@@ -106,6 +105,7 @@ namespace sc
ret = -1;
success:
stop_hpfs_rw_session(state_hash);
cleanup_fdmap(ctx.userfds);
cleanup_vectorfds(ctx.hpscfds);
cleanup_vectorfds(ctx.nplfds);
@@ -254,6 +254,8 @@ namespace sc
int fetch_outputs(const contract_exec_args &args)
{
util::mask_signal();
while (true)
{
if (ctx.should_deinit)