-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Reject durable nonce transactions not signed by authority #25831
Reject durable nonce transactions not signed by authority #25831
Conversation
14c46fb
to
eb33803
Compare
791f825
to
95fcae6
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.
lgtm
@@ -21,13 +24,13 @@ pub fn create_account(lamports: u64) -> RefCell<AccountSharedData> { | |||
} | |||
|
|||
// TODO: Consider changing argument from Hash to DurableNonce. |
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 // TODO: ...
was not a good idea. Since you are changing this area, maybe remove this as well.
Ok(State::Initialized(ref data)) => hash == &data.blockhash(), | ||
_ => false, | ||
Ok(State::Initialized(data)) => (hash == &data.blockhash()).then(|| data), | ||
_ => None, |
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.
Since you are changing this line, might be good to make this _ => ...
more explicit, and avoid bugs in the future if State
ever has a 3rd variant. Something like:
Ok(State::Initialized(data)) => ...
Ok(State::Uninitialized) => None,
Err(_) => None,
(cherry picked from commit b2b426d) # Conflicts: # runtime/src/bank.rs # runtime/src/nonce_keyed_account.rs # sdk/program/src/message/sanitized.rs # sdk/src/feature_set.rs # send-transaction-service/src/send_transaction_service.rs
(cherry picked from commit b2b426d) # Conflicts: # runtime/src/nonce_keyed_account.rs
…25831) (#25849) * Reject durable nonce transactions not signed by authority (#25831) (cherry picked from commit b2b426d) # Conflicts: # runtime/src/bank.rs # runtime/src/nonce_keyed_account.rs # sdk/program/src/message/sanitized.rs # sdk/src/feature_set.rs # send-transaction-service/src/send_transaction_service.rs * resolve conflicts Co-authored-by: Justin Starry <justin@solana.com>
Problem
A transaction should only be processed as a durable nonce transaction if the used nonce account's authority signed the transaction.
Summary of Changes
Feature Gate Issue: #25835