-
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
Move nonce into system program #7645
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7645 +/- ##
========================================
+ Coverage 81.6% 81.7% +<.1%
========================================
Files 245 243 -2
Lines 50230 50383 +153
========================================
+ Hits 41021 41176 +155
+ Misses 9209 9207 -2 |
@@ -621,6 +771,31 @@ mod tests { | |||
); | |||
} | |||
|
|||
#[test] | |||
fn test_assign_from_nonce_account_fail() { |
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.
glad you're checking, but I think that verify_instruction also guards against this...
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.
Mind pointing to where you're talking about? git grep
is failing me
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.
ah, was renamed to verify_account_changes()
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.
Looks like it. The !is_zeroed()
check gets us. So I guess what we're buying here is a bit of accuracy for the return code, InvalidArgument
vs. ModifiedProgramId
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.
verify_account_changes()
can be really explicit, have a ton of errors, all part of the base set. the rules apply to all programs, not just system. lean on it and make a followup PR?
legal under the current rules: the stake program can change account.owner
if it first zeros the state memory. that's pretty cool and correct, right?
let res = accounts.load_accounts( | ||
&ancestors, | ||
&[tx], | ||
None, | ||
vec![(Ok(()), Some(HashAgeKind::Extant))], | ||
&hash_queue, | ||
error_counters, | ||
&rent_collector, | ||
rent_collector, |
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.
whoa! CC @ParthDesai
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.
nevermind, is part of tests ;)
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.
looking good, some important questions outstanding (see above)
also: where's the "refund the fee if the Nonce instruction fails" code? in here yet?
🙏
Next changeset. I wanted to pump the brakes on this one since the relocation blew up the diff so badly |
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.
nits, but otherwise lgtm
Pull request has been modified.
move to system program prereq
e4831a7
to
5053407
Compare
Rebased and ready to go by my eye |
@rob-solana 5053407?w=1 look ok? |
automerge (cherry picked from commit 7e94cc2) # Conflicts: # cli/src/nonce.rs # runtime/src/accounts.rs # runtime/src/system_instruction_processor.rs
Problem
The durable nonce feature being its own program adds complexity leading to issues like #7443 and complicating their resolution.
Summary of Changes
This will probably be easier to review by commit...
Toward #7443