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

refactor(dr): remove seq number in commit and reveal hash #179

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

mariocao
Copy link
Member

Motivation

Most contract transactions include a hashed value derived from variables like dr_id, block_height, and sequence_number. This approach helps protect transactions from replay attacks, where a malicious user could resend previous transactions to perform actions such as staking, unstaking, and withdrawing.

For consistency, this mechanism was also applied to data_request transactions. However, because identities might submit multiple commit and reveal transactions simultaneously, including the sequence_number adds complexity and affects the performance of an executor node using the same identity for multiple data requests. The dr_id and block_height variables are sufficient to protect data request transactions.

Explanation of Changes

Remove the sequence_number from the hash value in contract transactions.

Testing

Remove the sequence_number from the hash value in contract transactions.

@mariocao mariocao requested review from gluax and FranklinWaller June 26, 2024 12:57
@mariocao mariocao merged commit ccdd564 into main Jun 26, 2024
2 checks passed
@mariocao mariocao deleted the ref/remove-dr-seq-num branch June 26, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants