This repository was archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
clean feature: prevent_calling_precompiles_as_programs
#27100
Merged
mergify
merged 6 commits into
solana-labs:master
from
jstarry:clean-feature/prevent_calling_precompiles_as_programs
Aug 18, 2022
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -14540,25 +14540,25 @@ pub(crate) mod tests { | |
| if bank.slot == 0 { | ||
| assert_eq!( | ||
| bank.hash().to_string(), | ||
| "9tLrxkBoNE7zEUZ2g72ZwE4fTfhUQnhC8A4Xt4EmYhP1" | ||
| "5gY6TCgB9NymbbxgFgAjvYLpXjyXiVyyruS1aEwbWKLK" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These had to be updated because the genesis block now includes the precompile accounts |
||
| ); | ||
| } | ||
| if bank.slot == 32 { | ||
| assert_eq!( | ||
| bank.hash().to_string(), | ||
| "AxphC8xDj9gmFosor5gyiovNvPVMydJCFRUTxn2wFiQf" | ||
| "6uJ5C4QDXWCN39EjJ5Frcz73nnS2jMJ55KgkQff12Fqp" | ||
| ); | ||
| } | ||
| if bank.slot == 64 { | ||
| assert_eq!( | ||
| bank.hash().to_string(), | ||
| "4vZCSbBuL8xjE43rCy9Cm3dCh1BMj45heMiMb6n6qgzA" | ||
| "4u8bxZRLYdQBkWRBwmpcwcQVMCJoEpzY7hCuAzxr3kCe" | ||
| ); | ||
| } | ||
| if bank.slot == 128 { | ||
| assert_eq!( | ||
| bank.hash().to_string(), | ||
| "46LUpeBdJuisnfwgYisvh4x7jnxzBaLfHF614GtcTs59" | ||
| "4c5F8UbcDD8FM7qXcfv6BPPo6nHNYJQmN5gHiCMTdEzX" | ||
| ); | ||
| break; | ||
| } | ||
|
|
@@ -14786,7 +14786,7 @@ pub(crate) mod tests { | |
| // No more slots should be shrunk | ||
| assert_eq!(bank2.shrink_candidate_slots(), 0); | ||
| // alive_counts represents the count of alive accounts in the three slots 0,1,2 | ||
| assert_eq!(alive_counts, vec![9, 1, 7]); | ||
| assert_eq!(alive_counts, vec![11, 1, 7]); | ||
| } | ||
|
|
||
| #[test] | ||
|
|
@@ -14832,7 +14832,7 @@ pub(crate) mod tests { | |
| .map(|_| bank.process_stale_slot_with_budget(0, force_to_return_alive_account)) | ||
| .sum(); | ||
| // consumed_budgets represents the count of alive accounts in the three slots 0,1,2 | ||
| assert_eq!(consumed_budgets, 10); | ||
| assert_eq!(consumed_budgets, 12); | ||
| } | ||
|
|
||
| #[test] | ||
|
|
||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ pub fn bootstrap_validator_stake_lamports() -> u64 { | |
| // Number of lamports automatically used for genesis accounts | ||
| pub const fn genesis_sysvar_and_builtin_program_lamports() -> u64 { | ||
| const NUM_BUILTIN_PROGRAMS: u64 = 4; | ||
| const NUM_PRECOMPILES: u64 = 2; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that the feature ids passed to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems so: |
||
| const FEES_SYSVAR_MIN_BALANCE: u64 = 946_560; | ||
| const STAKE_HISTORY_MIN_BALANCE: u64 = 114_979_200; | ||
| const CLOCK_SYSVAR_MIN_BALANCE: u64 = 1_169_280; | ||
|
|
@@ -41,6 +42,7 @@ pub const fn genesis_sysvar_and_builtin_program_lamports() -> u64 { | |
| + EPOCH_SCHEDULE_SYSVAR_MIN_BALANCE | ||
| + RECENT_BLOCKHASHES_SYSVAR_MIN_BALANCE | ||
| + NUM_BUILTIN_PROGRAMS | ||
| + NUM_PRECOMPILES | ||
| } | ||
|
|
||
| pub struct ValidatorVoteKeypairs { | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.