-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
builtins consume statically defined units at beginning of process_ins…
…truction()
- Loading branch information
1 parent
c290a77
commit 3b409f5
Showing
8 changed files
with
92 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
use { | ||
solana_program_runtime::invoke_context::InvokeContext, | ||
solana_sdk::instruction::InstructionError, | ||
solana_sdk::{feature_set, instruction::InstructionError}, | ||
}; | ||
|
||
pub fn process_instruction(_invoke_context: &mut InvokeContext) -> Result<(), InstructionError> { | ||
pub fn process_instruction(invoke_context: &mut InvokeContext) -> Result<(), InstructionError> { | ||
// Consume compute units if feature `native_programs_consume_cu` is activated, | ||
if invoke_context | ||
.feature_set | ||
.is_active(&feature_set::native_programs_consume_cu::id()) | ||
{ | ||
invoke_context.consume_checked(150)?; | ||
} | ||
|
||
// Do nothing, compute budget instructions handled by the runtime | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters