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

Boot Contract type from Budget #1501

Merged
merged 5 commits into from
Oct 18, 2018
Merged

Conversation

garious
Copy link
Contributor

@garious garious commented Oct 15, 2018

In the old bank (before the contract engine), Contract wasn't specific
to Budget. It provided the same service as what is now called
SystemProgram::Move, but without requiring a separate account.

This PR migrates to SystemProgram::Move so that the client doesn't need to trust
BudgetProgram.

@garious garious added the work in progress This isn't quite right yet label Oct 15, 2018
@garious
Copy link
Contributor Author

garious commented Oct 15, 2018

This is an alternative to #1481. We should go with one or the other, but not both.

In the old bank (before the contract engine), Contract wasn't specific
to Budget. It provided the same service as what is now called
SystemProgram::Move, but without requiring a separate account.
Debits no longer need to be applied before credits. Instead, we
lock any accounts we'd debit and so error out on the second attempt
to lock the same account.
Budget now assumes the source account holds all tokens the program
should spend.

Note: the static guarantees implied by verify_plan() are meaningless
under the new contract engine. The bank no longer calls it. This
serves as a nice example of where comparing code coverage between
integration tests and unit tests would have shown us where a
change rendered unit tests meaningless.
The test is showing how you can sneak by verify_plan() but not
verify_signature().
@garious garious removed the work in progress This isn't quite right yet label Oct 18, 2018
@garious garious assigned mvines and unassigned mvines Oct 18, 2018
@garious garious requested a review from mvines October 18, 2018 05:59
@mvines mvines mentioned this pull request Oct 18, 2018
@garious garious merged commit 856c485 into solana-labs:master Oct 18, 2018
wen-coding pushed a commit to wen-coding/solana that referenced this pull request May 28, 2024
Typo in `solana-keygen grind`
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.

2 participants