Skip to content

Commit 2b21071

Browse files
committed
feat: add user_nonce on batch response
1 parent b04ce50 commit 2b21071

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

batcher/aligned-batcher/src/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub(crate) async fn send_batch_inclusion_data_responses(
2323
batch_merkle_tree: &MerkleTree<VerificationCommitmentBatch>,
2424
) -> Result<(), BatcherError> {
2525
for (vd_batch_idx, entry) in finalized_batch.iter().enumerate() {
26-
let batch_inclusion_data = BatchInclusionData::new(vd_batch_idx, batch_merkle_tree);
26+
let batch_inclusion_data = BatchInclusionData::new(vd_batch_idx, batch_merkle_tree, entry.nonced_verification_data.nonce);
2727
let response = ResponseMessage::BatchInclusionData(batch_inclusion_data);
2828

2929
let serialized_response = cbor_serialize(&response)

batcher/aligned-sdk/src/core/types.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,14 @@ pub struct BatchInclusionData {
197197
pub batch_merkle_root: [u8; 32],
198198
pub batch_inclusion_proof: Proof<[u8; 32]>,
199199
pub index_in_batch: usize,
200+
pub user_nonce: U256,
200201
}
201202

202203
impl BatchInclusionData {
203204
pub fn new(
204205
verification_data_batch_index: usize,
205206
batch_merkle_tree: &MerkleTree<VerificationCommitmentBatch>,
207+
user_nonce: U256,
206208
) -> Self {
207209
let batch_inclusion_proof = batch_merkle_tree
208210
.get_proof_by_pos(verification_data_batch_index)
@@ -212,6 +214,7 @@ impl BatchInclusionData {
212214
batch_merkle_root: batch_merkle_tree.root,
213215
batch_inclusion_proof,
214216
index_in_batch: verification_data_batch_index,
217+
user_nonce: user_nonce,
215218
}
216219
}
217220
}

0 commit comments

Comments
 (0)