Skip to content

Commit

Permalink
feat: Add decode Tx Sanity Check (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM authored and Stefan-Ethernal committed Sep 17, 2024
1 parent 2420cea commit d8212b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
File renamed without changes.
6 changes: 6 additions & 0 deletions sequencesender/sequencesender.go
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,12 @@ func (s *SequenceSender) handleReceivedDataStream(entry *datastreamer.FileEntry,
entry.Number, l2Tx.L2BlockNumber, l2Tx.Index, s.entryTypeToString(prevEntryType), s.prevStreamEntry.Number)
}

// Sanity check: tx should be decodable
_, err = state.DecodeTx(common.Bytes2Hex(l2Tx.Encoded))
if err != nil {
log.Fatalf("error decoding tx during sanity check: %v", err)
}

// Add tx data
s.addNewBlockTx(l2Tx)

Expand Down

0 comments on commit d8212b9

Please sign in to comment.