Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize expiry based de-duplication #1771

Open
aaronbuchwald opened this issue Nov 13, 2024 · 1 comment
Open

Generalize expiry based de-duplication #1771

aaronbuchwald opened this issue Nov 13, 2024 · 1 comment
Assignees
Labels

Comments

@aaronbuchwald
Copy link
Collaborator

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
Copy link
Collaborator Author

aaronbuchwald commented Nov 14, 2024

We should integrate de-duplication into chunk based block building and block execution.

Modify the DSMR node block building function signature to the DSMR equivalent of https://github.com/ava-labs/hypersdk/blob/35fc59b6d39e94760064f0438f989158c2ca4c56/chain/builder.go#L99C1-L99C97 and utilize general purpose validity window to skip any duplicate chunks gathered from the mempool: https://github.com/ava-labs/hypersdk/blob/main/chain/builder.go#L175. We should apply the same check over chunk certificates to potentially include within a block here: https://github.com/ava-labs/hypersdk/blob/main/x/dsmr/node.go#L183.

Additionally, we should verify there are no duplicates included internal to the block or in its ancestry when executing (verifying) a block: https://github.com/ava-labs/hypersdk/pull/1800/files#r1848400598.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants