This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Feature: TransactionContext, InstructionContext and BorrowedAccount#21706
Merged
Lichtso merged 3 commits intosolana-labs:masterfrom Dec 27, 2021
Merged
Feature: TransactionContext, InstructionContext and BorrowedAccount#21706Lichtso merged 3 commits intosolana-labs:masterfrom
Lichtso merged 3 commits intosolana-labs:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21706 +/- ##
=========================================
- Coverage 81.2% 81.2% -0.1%
=========================================
Files 519 520 +1
Lines 145734 145929 +195
=========================================
+ Hits 118448 118534 +86
- Misses 27286 27395 +109 |
jackcmay
reviewed
Dec 8, 2021
jackcmay
reviewed
Dec 8, 2021
jackcmay
reviewed
Dec 8, 2021
jackcmay
reviewed
Dec 8, 2021
jackcmay
reviewed
Dec 8, 2021
jackcmay
reviewed
Dec 8, 2021
jackcmay
reviewed
Dec 8, 2021
jackcmay
reviewed
Dec 8, 2021
jackcmay
reviewed
Dec 8, 2021
acb3c90 to
32c1f80
Compare
This was referenced Dec 14, 2021
32c1f80 to
920c7eb
Compare
…ontext. Also use the types declared in transaction_context.rs everywhere.
920c7eb to
ea7ab2a
Compare
ea7ab2a to
5de6b8c
Compare
This was referenced Jan 3, 2022
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#21882 and #21927 are preparations for this PR to remove the
RcfromRefcell<AccountSharedData>in the program-runtime becauseRccan not be serialized.Problem
KeyedAccountdoes not validateself.is_writable()before modificationKeyedAccountworks by usingPubkeyinstead of an index (in instruction and in transaction)KeyedAccountandAccountInfoare two redundant implementations of nearly the same interfaceSummary of Changes
As proposed for ABIv2 (#19191):
TransactionContextto outsource theaccounts,invoke_stackandreturn_dataproperties ofInvokeContextInstructionContextwhich will replaceinvoke_context::StackFrameBorrowedAccountwhich will replace onlyKeyedAccountat first and later alsoAccountInfoaccountsinInvokeContextthroughTransactionContext.TransactionAccountandInstructionAccountintotransaction_context.rs.Replacement of other runtime structs and the encoding and the new BPF loader will come later.
This is only about the interfaces for the runtime and program tests for now, so that we can start migrating them.
Open issues / up to discussion:
BorrowedAccountis aRefMut, so the user won't be able to borrow the same account multiple times even if they don't want to modify any. But of course, the user can have multiple references to oneBorrowedAccountand also wrap it in aRefCell. I don't think that introducing aBorrowedAccountReadonlyis necessary.AccountInfo?Fixes #