-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Remove create_account bandaid now that to's signature is required
#7776
Remove create_account bandaid now that to's signature is required
#7776
Conversation
58b7bcc to
f10a5c3
Compare
to requires signatureto requires signature
Codecov Report
@@ Coverage Diff @@
## master #7776 +/- ##
========================================
- Coverage 81.8% 81.8% -0.1%
========================================
Files 239 242 +3
Lines 51203 51236 +33
========================================
+ Hits 41932 41959 +27
- Misses 9271 9277 +6 |
f10a5c3 to
e130bfe
Compare
t-nelson
left a comment
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!
to requires signatureto's signature is required
sdk/src/system_instruction.rs
Outdated
| ) -> Instruction { | ||
| let account_metas = vec![ | ||
| AccountMeta::new(*from_pubkey, true), | ||
| AccountMeta::new(*from_pubkey, lamports != 0), // no signature required if no transfer |
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.
What's the point of this feature exactly? And if you use it, why require from_pubkey?
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.
I could round out system program with another set of functions/instructions that don't require a from, but I think they'd only manifest as system_instruction.rs entry points, as so many things funnel down.
My next PR makes clear the value of this feature. Stay tuned!
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.
Something still smells funny here. Is it possible that CreateAccount shouldn't have from or lamports parameters at all?
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.
your new issue nicely describes what I'm going for here
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.
Good to hear! So baby steps, how about we leave CreateAccount alone and instead add the proposed Allocate instruction in this PR?
e130bfe to
f4b4842
Compare
Pull request has been modified.
garious
left a comment
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.
Well played, Sir
Problem(s)
create_account() checks
tobalance, but shouldn't as long asthere's no existing data and the system account is the owner (redundant with
verify_account_changes(), but no biggie)Summary of Changes
remove the balance check for
toFixes #