Replies: 1 comment
-
List of Things we need to addressList related issues here instead of creating one for each. Scheduled Commits should be ignored if Transaction Fails
Problem Example: Transaction includes two Instructions
What should happen here is the following:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Avoid passing Seeds
In order to not require the user to pass seeds for the PDAs he wants to commit we would not rely on the PDAs being signer.
Instead we would check that the program that performed the CPI call of our instruction (to schedule a commit) is the owner of all the PDAs being committed.
This is less safe, but we could not come up with a reason why this could be exploited up to this point.
However the challenge is to determine the following about the instruction that invoked us via CPI.
So far I could not encounter a way to determine 2. and include the related docs below.
Declare Process Instruction
Light wrapper around
solana_rbpf::declare_builtin_function!
to unify built-in programs andsyscalls interface.
Macro Definition
Example Macro Use
calls
solana_rbpf::declare_builtin_function
Declare Builtin Function
Generates an adapter for a BuiltinFunction between the Rust and the VM interface
Invoke Context
Each processing function is passed an
InvokeContext
.LoadedProgramsForTxBatch are not interesting here as they just provide information about the
programs in general, but not related to our transaction.
The only interesting bit is thus the
TransactionContext
.Transaction Context
The TransactionAccounts don't provide any indicator as to what program invoked us as they
look like this.
data
,owner
,lamports
,rent_epoch
,executable
The
InstructionContext
is the interesting part of theTransactionContext
.Instruction Context
instruction_trace: Vec<InstructionContext>
should allow us to determinewho is our parent
currentIndex - 1
with nestingcurrentNesting - 1
)relative to ours, i.e. sibling before/after, etc.
program_accounts
list all program account indexes, i.e. we don't know which of them was theprogram executing the instrucion
instruction_accounts
provide information about all accounts in an instructionInstruction Account
index_in_caller
of a program account would bepinpoint which one of the program accounts it is
Beta Was this translation helpful? Give feedback.
All reactions