Skip to content

Commit e618f9a

Browse files
author
HaoranYi
committed
fix test_bpf_loader_upgradeable_deploy_with_max_len test
1 parent 43da3f2 commit e618f9a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

runtime/src/bank/tests.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7206,12 +7206,10 @@ fn test_bpf_loader_upgradeable_deploy_with_max_len() {
72067206
invocation_message.clone(),
72077207
bank.last_blockhash(),
72087208
);
7209+
// See comments below at line 7230.
72097210
assert_eq!(
72107211
bank.process_transaction(&transaction),
7211-
Err(TransactionError::InstructionError(
7212-
0,
7213-
InstructionError::InvalidAccountData
7214-
)),
7212+
Err(TransactionError::InvalidProgramForExecution),
72157213
);
72167214
{
72177215
let program_cache = bank.transaction_processor.program_cache.read().unwrap();
@@ -7230,12 +7228,14 @@ fn test_bpf_loader_upgradeable_deploy_with_max_len() {
72307228
let instruction = Instruction::new_with_bytes(buffer_address, &[], Vec::new());
72317229
let message = Message::new(&[instruction], Some(&mint_keypair.pubkey()));
72327230
let transaction = Transaction::new(&[&binding], message, bank.last_blockhash());
7231+
// This is a slightly change of behavior for this PR. In the old code, we
7232+
// short-circuit buffer account to fake it and mark it executable. So it
7233+
// passed program execution check but failed with `Err(InstructionError(0, InvalidAccountData))`.
7234+
// With this PR, we don't do that. The buffer account will NOT be executable. A different error is throw `Err(InvalidProgramForExecution)`.
7235+
// This will break consensus unfortunately! Maybe a feature gate is required for this PR?
72337236
assert_eq!(
72347237
bank.process_transaction(&transaction),
7235-
Err(TransactionError::InstructionError(
7236-
0,
7237-
InstructionError::InvalidAccountData,
7238-
)),
7238+
Err(TransactionError::InvalidProgramForExecution),
72397239
);
72407240
{
72417241
let program_cache = bank.transaction_processor.program_cache.read().unwrap();

0 commit comments

Comments
 (0)