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

Adds symmetric tests for all cases of un-/re-/deployment inside the same transaction #29725

Merged

Conversation

Lichtso
Copy link
Contributor

@Lichtso Lichtso commented Jan 16, 2023

Problem

The state of the madness is currently neither documented nor covered by test cases (except for redeployment). Here is the effect of a top-level program management instruction on subsequent execution instructions:

Action top-level-instruction in same TX CPI-instruction in same TX
deployment call fails, so does deployment retroactively deployment is visible
redeployment (upgrade) upgrade is visible upgrade is visible
undeployment (close) close is invisible, program remains open close is invisible, program remains open

Summary of Changes

  • Unifies test_program_sbf_upgrade_and_invoke_in_same_tx() and test_program_sbf_upgrade_self_via_cpi() into test_program_sbf_invoke_in_same_tx_as_redeployment().
  • Adds test_program_sbf_invoke_in_same_tx_as_deployment() and test_program_sbf_invoke_in_same_tx_as_undeployment().

…gram_sbf_upgrade_self_via_cpi() into test_program_sbf_invoke_in_same_tx_as_redeployment().

Adds test_program_sbf_invoke_in_same_tx_as_deployment() and test_program_sbf_invoke_in_same_tx_as_undeployment().
@Lichtso Lichtso added the runtime Issues related to runtime, BPF, and LLVM label Jan 16, 2023
@Lichtso Lichtso merged commit c5380d4 into solana-labs:master Jan 17, 2023
@Lichtso Lichtso deleted the tests/un-re-deployment_in_same_transaction branch January 17, 2023 08:44
@Lichtso Lichtso added v1.14 and removed v1.14 labels Jan 18, 2023
mergify bot pushed a commit that referenced this pull request Jan 18, 2023
…ame transaction (#29725)

Unifies test_program_sbf_upgrade_and_invoke_in_same_tx() and test_program_sbf_upgrade_self_via_cpi() into test_program_sbf_invoke_in_same_tx_as_redeployment().
Adds test_program_sbf_invoke_in_same_tx_as_deployment() and test_program_sbf_invoke_in_same_tx_as_undeployment().

(cherry picked from commit c5380d4)

# Conflicts:
#	programs/bpf/tests/programs.rs
#	runtime/src/loader_utils.rs
Lichtso added a commit that referenced this pull request Jan 19, 2023
…ame transaction (#29725)

Unifies test_program_sbf_upgrade_and_invoke_in_same_tx() and test_program_sbf_upgrade_self_via_cpi() into test_program_sbf_invoke_in_same_tx_as_redeployment().
Adds test_program_sbf_invoke_in_same_tx_as_deployment() and test_program_sbf_invoke_in_same_tx_as_undeployment().

(cherry picked from commit c5380d4)
Lichtso added a commit that referenced this pull request Jan 19, 2023
…ame transaction (#29725)

Unifies test_program_sbf_upgrade_and_invoke_in_same_tx() and test_program_sbf_upgrade_self_via_cpi() into test_program_sbf_invoke_in_same_tx_as_redeployment().
Adds test_program_sbf_invoke_in_same_tx_as_deployment() and test_program_sbf_invoke_in_same_tx_as_undeployment().

(cherry picked from commit c5380d4)
Lichtso added a commit that referenced this pull request Jan 19, 2023
…ame transaction (#29725)

Unifies test_program_sbf_upgrade_and_invoke_in_same_tx() and test_program_sbf_upgrade_self_via_cpi() into test_program_sbf_invoke_in_same_tx_as_redeployment().
Adds test_program_sbf_invoke_in_same_tx_as_deployment() and test_program_sbf_invoke_in_same_tx_as_undeployment().

(cherry picked from commit c5380d4)
Lichtso added a commit that referenced this pull request Jan 19, 2023
…ame transaction (backport #29725) (#29756)

Adds symmetric tests for all cases of un-/re-/deployment inside the same transaction (#29725)

Unifies test_program_sbf_upgrade_and_invoke_in_same_tx() and test_program_sbf_upgrade_self_via_cpi() into test_program_sbf_invoke_in_same_tx_as_redeployment().
Adds test_program_sbf_invoke_in_same_tx_as_deployment() and test_program_sbf_invoke_in_same_tx_as_undeployment().

(cherry picked from commit c5380d4)

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
runtime Issues related to runtime, BPF, and LLVM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant