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

Replay protection #1017

Merged
merged 35 commits into from
Apr 13, 2023
Merged

Replay protection #1017

merged 35 commits into from
Apr 13, 2023

Conversation

grarco
Copy link
Collaborator

@grarco grarco commented Jan 12, 2023

Addresses #1009

Based on #1051 for TempWlStorage

Implements hash-based replay protection

  • Updates specs
  • Adds an internal address for replay protection
  • Adds a native VP to prevent any writing to the hash subspace
  • Changes WrapperTx commit to be computed on the hash of the unsigned inner tx
  • Adds mempool_validate checks
  • Adds process_proposal checks and rejects block on most errors
  • Updates finalize_block to store the hash of txs
  • Unit tests

@grarco grarco mentioned this pull request Jan 12, 2023
3 tasks
@grarco grarco force-pushed the grarco/replay-protection-impl branch 2 times, most recently from b2a4067 to 3b56dee Compare January 13, 2023 09:50
@grarco
Copy link
Collaborator Author

grarco commented Jan 13, 2023

pls update wasm

grarco added a commit that referenced this pull request Jan 13, 2023
@grarco grarco marked this pull request as ready for review January 13, 2023 11:16
@grarco grarco requested a review from tzemanovic January 13, 2023 11:16
replay_protection::get_tx_hash_key(&wrapper.tx_hash);
if self
.storage
.has_key(&inner_hash_key)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could actually use StorageRead::has_key here an everywhere else since, for the moment, I'm not interested in the gas used

@cwgoes cwgoes added this to the 0.14 milestone Jan 16, 2023
grarco added a commit that referenced this pull request Jan 20, 2023
@grarco grarco force-pushed the grarco/replay-protection-impl branch 2 times, most recently from 721162b to c2b06ea Compare January 20, 2023 20:55
grarco added a commit that referenced this pull request Jan 20, 2023
@grarco grarco force-pushed the grarco/replay-protection-impl branch from c2b06ea to 7e1dacc Compare January 20, 2023 22:36
grarco added a commit that referenced this pull request Jan 24, 2023
@grarco grarco force-pushed the grarco/replay-protection-impl branch from 77685b6 to c030da0 Compare January 24, 2023 10:59
@grarco
Copy link
Collaborator Author

grarco commented Jan 24, 2023

pls update wasm

@grarco grarco force-pushed the grarco/replay-protection-impl branch from 78a13f9 to 47ee165 Compare January 24, 2023 11:43
@grarco grarco mentioned this pull request Feb 2, 2023
@grarco grarco force-pushed the grarco/replay-protection-impl branch 2 times, most recently from fce297e to 074b98a Compare February 6, 2023 12:34
@tzemanovic tzemanovic modified the milestones: 0.14, 0.15 Feb 8, 2023
@grarco grarco force-pushed the grarco/replay-protection-impl branch from 42147a1 to 42e056d Compare February 10, 2023 20:54
@grarco
Copy link
Collaborator Author

grarco commented Feb 10, 2023

pls update wasm

@grarco grarco force-pushed the grarco/replay-protection-impl branch from 2700b5f to 48bcb8c Compare February 10, 2023 21:32
Copy link
Member

@tzemanovic tzemanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good amount of testing!

juped added a commit that referenced this pull request Mar 16, 2023
…nto draft-0.15

evil: wl_storage gains a 'static

* namada/grarco/replay-protection-impl:
  [ci] wasm checksums update
  Updates fees in replay protection specs
  Brings back sig check in `finalize_block`
  Fixes fee error code
  [ci] wasm checksums update
  Fixes fee in unit tests
  Fmt
  Refactors replay protection logic
  Removes wal from replay protection specs
  Removes unnecessary clones
  Fixes tx unsigned hash
  Replay protection VP always rejects
  Fixes typos
  changelog: add #1017
  [ci] wasm checksums update
  Clippy
  Fmt
  Updates `process_proposal` unit tests
  Fixes `finalize_block` and adds unit test
  Updates replay protection specs with protocol txs
  Updates `process_proposal` unit tests
  Removes tx hash from storage in `finalize_block`
  Fixes error codes
  Refactors `process_proposal`
  Replay protection checks in `process_proposal`
  Fixes replay protection specs
  Refactors `unsigned_hash_tx`
  Unit test `mempool_validate`
  Wrapper commit hash on unsigned inner tx
  Adds tx hash check in mempool validate
  Updates replay protections specs with governance and unsigned inner hash
  Adds replay protection internal address and vp
  Updates replay protection specs
  changelog: add #1051
  core: added `TempWlStorage` for ABCI++ prepare/process proposal
juped added a commit that referenced this pull request Mar 16, 2023
…nto draft-0.15

evil: wl_storage gains a 'static

* namada/grarco/replay-protection-impl:
  [ci] wasm checksums update
  Updates fees in replay protection specs
  Brings back sig check in `finalize_block`
  Fixes fee error code
  [ci] wasm checksums update
  Fixes fee in unit tests
  Fmt
  Refactors replay protection logic
  Removes wal from replay protection specs
  Removes unnecessary clones
  Fixes tx unsigned hash
  Replay protection VP always rejects
  Fixes typos
  changelog: add #1017
  [ci] wasm checksums update
  Clippy
  Fmt
  Updates `process_proposal` unit tests
  Fixes `finalize_block` and adds unit test
  Updates replay protection specs with protocol txs
  Updates `process_proposal` unit tests
  Removes tx hash from storage in `finalize_block`
  Fixes error codes
  Refactors `process_proposal`
  Replay protection checks in `process_proposal`
  Fixes replay protection specs
  Refactors `unsigned_hash_tx`
  Unit test `mempool_validate`
  Wrapper commit hash on unsigned inner tx
  Adds tx hash check in mempool validate
  Updates replay protections specs with governance and unsigned inner hash
  Adds replay protection internal address and vp
  Updates replay protection specs
  changelog: add #1051
  core: added `TempWlStorage` for ABCI++ prepare/process proposal
grarco added a commit that referenced this pull request Mar 23, 2023
tzemanovic added a commit that referenced this pull request Mar 31, 2023
* grarco/replay-protection-impl:
  [ci] wasm checksums update
  Updates fees in replay protection specs
  Brings back sig check in `finalize_block`
  Fixes fee error code
  [ci] wasm checksums update
  Fixes fee in unit tests
  Fmt
  Refactors replay protection logic
  Removes wal from replay protection specs
  Removes unnecessary clones
  Fixes tx unsigned hash
  Replay protection VP always rejects
  Fixes typos
  changelog: add #1017
  [ci] wasm checksums update
  Clippy
  Fmt
  Updates `process_proposal` unit tests
  Fixes `finalize_block` and adds unit test
  Updates replay protection specs with protocol txs
  Updates `process_proposal` unit tests
  Removes tx hash from storage in `finalize_block`
  Fixes error codes
  Refactors `process_proposal`
  Replay protection checks in `process_proposal`
  Fixes replay protection specs
  Refactors `unsigned_hash_tx`
  Unit test `mempool_validate`
  Wrapper commit hash on unsigned inner tx
  Adds tx hash check in mempool validate
  Updates replay protections specs with governance and unsigned inner hash
  Adds replay protection internal address and vp
  Updates replay protection specs
@tzemanovic tzemanovic mentioned this pull request Mar 31, 2023
grarco added a commit that referenced this pull request Mar 31, 2023
Fraccaman pushed a commit that referenced this pull request Apr 3, 2023
Fraccaman pushed a commit that referenced this pull request Apr 3, 2023
Fraccaman pushed a commit that referenced this pull request Apr 3, 2023
Fraccaman pushed a commit that referenced this pull request Apr 3, 2023
@juped juped merged commit 9667343 into main Apr 13, 2023
@juped juped deleted the grarco/replay-protection-impl branch April 13, 2023 06:07
bengtlofgren pushed a commit that referenced this pull request May 11, 2023
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.

4 participants