Skip to content

Commit

Permalink
feat(tasks): add README & return the latest status only from POST 'pr…
Browse files Browse the repository at this point in the history
…oof/report' (#319)

* bd latest status

* Update README.md
  • Loading branch information
CeciliaZ030 authored Jul 16, 2024
1 parent 9568634 commit f7cab97
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ Look into `prove-block.sh` for the available options or run the script without i
./script/prove-block.sh taiko_a7 native sync
```

### Task Management
The script `prove-block.sh` always sends a POST request to Raiko server and enqueue a proving task. If you repeately send the same request, it will pull the latest status of the task and return the proof if ready.
To check the progress of all tasks:

```shell
curl --location --request POST 'http://localhost:8080/proof/report'
```

To prune all tasks (the cancellation feature that kills prover is still WIP):

```shell
curl --location --request POST 'http://localhost:8080/proof/prune'
```

## Provers

For all host programs, you can enable CPU optimization through exporting `CPU_OPT=1`.
Expand Down
3 changes: 2 additions & 1 deletion tasks/src/mem_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ impl InMemoryTaskDb {
.enqueue_task
.iter()
.flat_map(|(descriptor, statuses)| {
// Return the latest status
statuses
.iter()
.last()
.map(|status| TaskReport(descriptor.clone(), status.0))
})
.collect())
Expand Down

0 comments on commit f7cab97

Please sign in to comment.