ava-labs / hypersdk

Opinionated Framework for Building Hyper-Scalable Blockchains on Avalanche
Other
203 stars 112 forks source link

Generalize expiry based de-duplication #1771

Open aaronbuchwald opened 4 days ago

aaronbuchwald commented 4 days ago

The validity window is currently used to de-duplicate transactions for expiry based replay protection in the chain package: https://github.com/ava-labs/hypersdk/blob/main/chain/validity_window.go#L34.

This ticket is to create a general purpose version of it that can be re-used for chunk de-duplication and replay protection within the DSMR package.

This should replace the existing validity window: https://github.com/ava-labs/hypersdk/blob/main/chain/validity_window.go#L20 with an implementation that handles arbitrary containers ie. block of txs or chunks.

aaronbuchwald commented 3 days ago

We should integrate de-duplication into chunk based block building and block execution. Similarly to tx replay protection, chunks that have already been included should not be included in a newly built block and when executing a chunk based block, any duplicate either within the block or across the ancestry of that block should cause that block to fail verification.