Skip to content

Commit b67367d

Browse files
committed
fix: remove tasks table and add status to proofs table
1 parent 0f1c0d9 commit b67367d

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

aggregation_mode/batcher/src/db.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,22 @@ impl Db {
5555
proof: &[u8],
5656
program_commitment: &[u8],
5757
merkle_path: Option<&[u8]>,
58-
task_id: Option<Uuid>,
5958
) -> Result<Uuid, sqlx::Error> {
6059
sqlx::query_scalar::<_, Uuid>(
6160
"INSERT INTO proofs (
6261
address,
6362
proving_system_id,
6463
proof,
6564
program_commitment,
66-
merkle_path,
67-
task_id
68-
) VALUES ($1, $2, $3, $4, $5, $6)
65+
merkle_path
66+
) VALUES ($1, $2, $3, $4, $5)
6967
RETURNING proof_id",
7068
)
7169
.bind(address)
7270
.bind(proving_system_id)
7371
.bind(proof)
7472
.bind(program_commitment)
7573
.bind(merkle_path)
76-
.bind(task_id)
7774
.fetch_one(&self.pool)
7875
.await
7976
}

aggregation_mode/batcher/src/server/http.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ impl BatcherServer {
148148
&data.message.proof,
149149
&data.message.program_vk_commitment,
150150
None,
151-
None,
152151
)
153152
.await
154153
{

aggregation_mode/db/migrations/001_init.sql

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
CREATE TYPE task_status AS ENUM ('pending', 'verified');
2-
3-
CREATE TABLE tasks (
4-
task_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
5-
status task_status DEFAULT 'pending'
6-
);
1+
CREATE TYPE proof_status AS ENUM ('pending', 'processing', 'verified');
72

83
CREATE TABLE proofs (
94
proof_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
@@ -12,7 +7,7 @@ CREATE TABLE proofs (
127
proof BYTEA,
138
program_commitment BYTEA,
149
merkle_path BYTEA,
15-
task_id UUID REFERENCES tasks(task_id)
10+
status proof_status DEFAULT 'pending'
1611
);
1712

1813
CREATE TABLE payment_events (

0 commit comments

Comments
 (0)