Skip to content

Commit 15f1bc8

Browse files
Add nonce to the post proof query
1 parent b29e4d7 commit 15f1bc8

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

aggregation_mode/batcher/src/db.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,25 @@ impl Db {
108108
proof: &[u8],
109109
program_commitment: &[u8],
110110
merkle_path: Option<&[u8]>,
111+
nonce: i64,
111112
) -> Result<Uuid, sqlx::Error> {
112113
sqlx::query_scalar::<_, Uuid>(
113114
"INSERT INTO tasks (
114115
address,
115116
proving_system_id,
116117
proof,
117118
program_commitment,
118-
merkle_path
119-
) VALUES ($1, $2, $3, $4, $5)
119+
merkle_path,
120+
nonce
121+
) VALUES ($1, $2, $3, $4, $5, $6)
120122
RETURNING task_id",
121123
)
122124
.bind(address.to_lowercase())
123125
.bind(proving_system_id)
124126
.bind(proof)
125127
.bind(program_commitment)
126128
.bind(merkle_path)
129+
.bind(nonce)
127130
.fetch_one(&self.pool)
128131
.await
129132
}

aggregation_mode/batcher/src/server/http.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ impl BatcherServer {
150150
&data.message.proof,
151151
&data.message.program_vk_commitment,
152152
None,
153+
count,
153154
)
154155
.await
155156
{

aggregation_mode/db/migrations/001_init.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CREATE TABLE tasks (
88
program_commitment BYTEA,
99
merkle_path BYTEA,
1010
status task_status DEFAULT 'pending',
11-
nonce BIGINT
11+
nonce BIGINT NOT NULL
1212
);
1313

1414
CREATE TABLE payment_events (

0 commit comments

Comments
 (0)