Skip to content

Commit 7241fdf

Browse files
committed
sim-rs: validate TXs during voting
1 parent 84edd5f commit 7241fdf

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

sim-rs/sim-core/src/model.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ pub enum NoVoteReason {
214214
ExtraIB,
215215
MissingIB,
216216
MissingEB,
217+
ExtraTX,
217218
UncertifiedEBReference,
218219
}
219220

sim-rs/sim-core/src/sim/node.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,6 +1462,12 @@ impl Node {
14621462
let expected_ib_pipelines: HashSet<u64> =
14631463
self.pipelines_for_ib_references(eb.pipeline).collect();
14641464

1465+
for tx in &eb.txs {
1466+
if !matches!(self.txs.get(tx), Some(TransactionView::Received(_))) {
1467+
return Err(NoVoteReason::ExtraTX);
1468+
}
1469+
}
1470+
14651471
for ib in &eb.ibs {
14661472
if !matches!(self.leios.ibs.get(ib), Some(InputBlockState::Received(_))) {
14671473
return Err(NoVoteReason::MissingIB);

0 commit comments

Comments
 (0)