Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Add get_processed_sibling_instruction syscall#22956

Merged
jackcmay merged 1 commit intosolana-labs:v1.9from
jackcmay:sibling-instruction-v1.9
Feb 8, 2022
Merged

Add get_processed_sibling_instruction syscall#22956
jackcmay merged 1 commit intosolana-labs:v1.9from
jackcmay:sibling-instruction-v1.9

Conversation

@jackcmay
Copy link
Copy Markdown
Contributor

@jackcmay jackcmay commented Feb 4, 2022

Problem

There are scenarios where instructions (top-level or via CPI) would like to know what the last instruction processed was. Some examples are verification of assert instructions or to check for memo instructions. Programs can already check tx level instructions via the Sysvar1nstructions1111111111111111111111111 but there is no way to get information about what inner instructions have been processed.

Summary of Changes

Add a syscall that allows a program to query what sibling instructions have been successfully processed.

/// Returns a sibling instruction from the processed sibling instruction list.
///
/// The processed sibling instruction list is a reverse-ordered list of
/// successfully processed sibling instructions. For example, given the call flow:
///
/// A
/// B -> C -> D
/// B -> E
/// B -> F
///
/// Then B's processed sibling instruction list is: [A]
/// Then F's processed sibling instruction list is: [E, C]

Summary of Changes

Backport of #22859

Fixes #

@jackcmay jackcmay force-pushed the sibling-instruction-v1.9 branch 2 times, most recently from df2e6bd to 19ee0a2 Compare February 4, 2022 23:13
@CriesofCarrots
Copy link
Copy Markdown
Contributor

Just gave this a whirl on https://github.com/CriesofCarrots/solana-program-library/commits/finish-memo-extension
Worked great

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 5, 2022

Codecov Report

Merging #22956 (c1729ee) into v1.9 (c3890ad) will decrease coverage by 0.0%.
The diff coverage is 40.7%.

@@            Coverage Diff            @@
##             v1.9   #22956     +/-   ##
=========================================
- Coverage    81.2%    81.1%   -0.1%     
=========================================
  Files         531      531             
  Lines      147632   147930    +298     
=========================================
+ Hits       119987   120108    +121     
- Misses      27645    27822    +177     

@jackcmay jackcmay force-pushed the sibling-instruction-v1.9 branch from 19ee0a2 to 3f9ccfa Compare February 7, 2022 17:39
@jackcmay jackcmay force-pushed the sibling-instruction-v1.9 branch from 3f9ccfa to c1729ee Compare February 7, 2022 19:39
@jackcmay jackcmay merged commit d05b5b0 into solana-labs:v1.9 Feb 8, 2022
@jackcmay jackcmay deleted the sibling-instruction-v1.9 branch February 8, 2022 17:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants