-
Notifications
You must be signed in to change notification settings - Fork 992
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
Stateful replay protection #1405
Conversation
c221e9b
to
ae79f1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good in my 👀
@@ -648,6 +651,55 @@ where | |||
response | |||
} | |||
|
|||
/// Checks that neither the wrapper nor the inner transaction have already |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be based on the commit that introduced the bug; if that isn't identifiable, then the closest possible thing (like the replay protection branch).
replay_protection::get_tx_hash_key(&wrapper.tx_hash); | ||
if temp_wl_storage | ||
.has_key(&inner_hash_key) | ||
.expect("Error while checking inner tx hash key in storage") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect()
s should say something like "expected [invariant you expected to hold]"
@@ -1236,8 +1198,8 @@ mod test_process_proposal { | |||
assert_eq!( | |||
response[1].result.info, | |||
format!( | |||
"Inner transaction hash {} already in storage, replay \ | |||
attempt", | |||
"Transaction replay attempt: Inner transaction hash \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we want to rewrite strings let's do that in its own branch, not en passant
ae79f1b
to
1480727
Compare
…1405) into maint-0.15 * namada/grarco/bugfix-replay-prepare: Adds replay protection checks in prepare_proposal
6f65fe8
to
52f803c
Compare
Namada 0.15.4 * tag 'v0.15.4': Namada 0.15.4 changelog: add #1407 Fixes e2e tests changelog: add #1399 Tendermint consensus params settable in Namada config Updates `InternalStats` display changelog: add #1405 process_proposal: fix typos in test names prepare_proposal: add replay protection tests Adds replay protection checks in prepare_proposal Logs validation error in `process_proposal`
Namada 0.15.4 * tag 'v0.15.4': Namada 0.15.4 changelog: add #1407 Fixes e2e tests changelog: add #1399 Tendermint consensus params settable in Namada config Updates `InternalStats` display changelog: add #1405 process_proposal: fix typos in test names prepare_proposal: add replay protection tests Adds replay protection checks in prepare_proposal Logs validation error in `process_proposal`
Implements stateful replay protection in
prepare_proposal
to avoid adding the same transaction more than once in a block