Skip to content

Commit 090f0dd

Browse files
authored
Merge pull request #513 from Fibonacci747/fix/submitter-requeue-on-size-overflow
fix: prevent block loss on transaction size overflow in submitter
2 parents e588a71 + fd44f58 commit 090f0dd

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

timeboost-builder/src/submit.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,21 @@ impl Sender {
181181
continue;
182182
}
183183
let n = minicbor::len(&b);
184-
if size + n < self.size_limit {
184+
if n > self.size_limit {
185+
error!(
186+
node = %self.label,
187+
block = %b.cert().data().num(),
188+
size = %n,
189+
limit = %self.size_limit,
190+
"block exceeds max transaction size; dropping"
191+
);
192+
continue;
193+
}
194+
if size + n <= self.size_limit {
185195
size += n;
186196
transaction.push(b)
187197
} else {
198+
outbox.push_front(b);
188199
break;
189200
}
190201
}

0 commit comments

Comments
 (0)