deroproject / derohe

DERO Homomorphic Encryption Blockchain Protocol
Other
208 stars 82 forks source link

incoming TX check #120

Closed 8lecramm closed 1 year ago

8lecramm commented 1 year ago

Check incoming TXs for build height and ignore if too far in the past (< TX_VALIDITY_HEIGHT)

8lecramm commented 1 year ago

Update: Rejecting all TXs < TX_VALIDITY_HEIGHT still causes high CPU load, especially if these TXs are sent over and over again. It keeps all 4 cores of a Raspberry Pi 4 busy. "Old" transactions are not stored on disk, so the node "forgets" these TXs.

Adding these TXs to a temporarily blacklist can solve the issue. 1) TX deserialization and check of the build height 2) if check fails, add TX hash to blacklist for minutes/hours/whatever 3) TX section in NotifyINV checks if TX hash is blacklisted 4) if blacklisted, don't request TX from remote peer = less CPU and network bandwidth usage

NotifyINV_trace