From 36ff4828516593a849c6e17fd3055c9f05b070fc Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Tue, 22 Aug 2023 10:01:47 +0200 Subject: [PATCH] fix stack overflow --- .../bindings/test_formats/verify_blob_kzg_proof_batch.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bindings/rust/src/bindings/test_formats/verify_blob_kzg_proof_batch.rs b/bindings/rust/src/bindings/test_formats/verify_blob_kzg_proof_batch.rs index 62ac36e05..98e196662 100644 --- a/bindings/rust/src/bindings/test_formats/verify_blob_kzg_proof_batch.rs +++ b/bindings/rust/src/bindings/test_formats/verify_blob_kzg_proof_batch.rs @@ -14,7 +14,12 @@ pub struct Input { impl Input { pub fn get_blobs(&self) -> Result, Error> { - self.blobs.iter().map(|blob| Blob::from_hex(blob)).collect() + // TODO: `iter.map.collect` overflows the stack + let mut v = Vec::with_capacity(self.blobs.len()); + for blob in &self.blobs { + v.push(Blob::from_hex(blob)?); + } + Ok(v) } pub fn get_commitments(&self) -> Result, Error> {