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

Bail on all CPI errors #14500

Merged
merged 2 commits into from
Jan 9, 2021
Merged

Conversation

jackcmay
Copy link
Contributor

@jackcmay jackcmay commented Jan 8, 2021

Problem

A program called via CPI might call other programs and then fail gracefully. If that happens the original caller will not have the updated account data from the other called programs and thus will fail runtime checks when it returns.

Summary of Changes

Bail immediately on all failed CPI invocations.

Fixes #

@jackcmay jackcmay added v1.4 automerge Merge this Pull Request automatically once CI passes labels Jan 8, 2021
@mergify mergify bot removed the automerge Merge this Pull Request automatically once CI passes label Jan 8, 2021
@mergify
Copy link
Contributor

mergify bot commented Jan 8, 2021

automerge label removed due to a CI failure

@jackcmay jackcmay force-pushed the bail-on-all-cpi-errors branch from 960b534 to 7b89a58 Compare January 9, 2021 00:11
@jackcmay jackcmay force-pushed the bail-on-all-cpi-errors branch from 7b89a58 to 9313311 Compare January 9, 2021 00:24
@jackcmay jackcmay added the automerge Merge this Pull Request automatically once CI passes label Jan 9, 2021
@codecov
Copy link

codecov bot commented Jan 9, 2021

Codecov Report

Merging #14500 (9313311) into master (638f225) will decrease coverage by 0.0%.
The diff coverage is 14.2%.

@@            Coverage Diff            @@
##           master   #14500     +/-   ##
=========================================
- Coverage    80.4%    80.3%   -0.1%     
=========================================
  Files         401      401             
  Lines       99877    99876      -1     
=========================================
- Hits        80306    80287     -19     
- Misses      19571    19589     +18     

@mergify mergify bot merged commit ec48631 into solana-labs:master Jan 9, 2021
mergify bot pushed a commit that referenced this pull request Jan 9, 2021
* Bail on all CPI errors

* whitespace

(cherry picked from commit ec48631)

# Conflicts:
#	programs/bpf/rust/invoke/src/lib.rs
#	programs/bpf_loader/src/syscalls.rs
#	sdk/src/feature_set.rs
mergify bot pushed a commit that referenced this pull request Jan 9, 2021
* Bail on all CPI errors

* whitespace

(cherry picked from commit ec48631)
@jackcmay jackcmay deleted the bail-on-all-cpi-errors branch January 9, 2021 03:37
jackcmay added a commit that referenced this pull request Jan 9, 2021
* Bail on all CPI errors

* whitespace

(cherry picked from commit ec48631)
mergify bot added a commit that referenced this pull request Jan 9, 2021
* Bail on all CPI errors

* whitespace

(cherry picked from commit ec48631)

Co-authored-by: Jack May <[email protected]>
mergify bot added a commit that referenced this pull request Jan 10, 2021
* Bail on all CPI errors (#14500)

* Bail on all CPI errors

* whitespace

(cherry picked from commit ec48631)

* resolve conflicts

Co-authored-by: Jack May <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant