Commit Graph

996 Commits

Author SHA1 Message Date
Jack May
509bcd2e74 Bump rbpf to v0.2.19 (#21880)
* Bump rbpf to v0.2.19

Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
2021-12-14 16:51:23 +01:00
Justin Starry
e5476913fe Remove activated feature that checks tx signature len (#21747) 2021-12-14 09:23:05 -05:00
Ashwin Sekar
4bc5bfb2df Addressing leftover comments from #21531 (#21782)
* Addressing leftover comments from #21531

* Add feature flag

* Feature gate new vote instruction

* add clock & slot hashes sysvar to test
2021-12-13 07:52:22 -08:00
Jeff Washington (jwash)
90f41fd9b7 use cost model to limit new account creation (#21369)
* use cost model to limit new account creation

* handle every system instruction

* remove &

* simplify match

* simplify match

* add datapoint for account data size

* add postgres error handling

* handle accounts:unlock_accounts
2021-12-12 14:57:18 -06:00
Michael Vines
c5c699a918 Remove the 5 integer msg! form 2021-12-11 09:37:11 -08:00
Justin Starry
9b41ddd9ba Add address lookup table program (#21616)
* Add address lookup table program

* feedback
2021-12-10 16:02:16 -05:00
Justin Starry
6c108c8fc3 Migrate from address maps to address lookup tables (#21634)
* Migrate from address maps to address lookup tables

* update sanitize error

* cargo fmt

* update abi
2021-12-10 11:04:04 -05:00
Michael Vines
a35df1cb02 Add initial wasm bindings for Instruction, SystemProgram and Transaction 2021-12-09 15:53:58 -08:00
Michael Vines
488dc37fec Add wasm bindings for Pubkey and Keypair 2021-12-09 15:53:58 -08:00
Justin Starry
6fc329180b Add more reporting for invalid stake cache members and prune them (#21654)
* Add more reporting for invalid stake cache members

* feedback
2021-12-09 14:12:11 -05:00
Sean Young
45e56c599d Ensure we have keys to activate these features (#21669) 2021-12-07 18:58:59 +00:00
Justin Starry
e123883b26 Reject vote withdraws that create non-rent-exempt accounts (#21639)
* Reject vote withdraws that create non-rent-exempt accounts

* fix mocked instruction test
2021-12-06 17:01:20 -05:00
Justin Starry
3dab1e711d Move transaction error code into new module (#21635) 2021-12-06 12:45:33 -05:00
Brian Anderson
df2b448993 Fix incorrect nonoverlapping test in sol_memcpy (#21007)
Thanks!
2021-12-06 09:26:46 -08:00
fee1-dead
c4a9c8b5e9 Remove dependency on hex (#21567)
* Remove dependency on `hex`

* Update lock file

* Use `debug_struct` instead of own format

* Share code, add test, and fix rent_epoch spelling

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-12-03 20:53:35 -07:00
Michael Vines
b8837c04ec Reformat imports to a consistent style for imports
rustfmt.toml configuration:
  imports_granularity = "One"
  group_imports = "One"
2021-12-03 09:19:13 -08:00
Alexander Meißner
1a4a039913 Adds feature reject_empty_instruction_without_program. (#21591) 2021-12-03 15:47:18 +01:00
Alexander Meißner
015250f96c Feature gates for rbpf v0.2.16 (#21590)
- Adds feature reject_section_virtual_address_file_offset_mismatch.
- Adds feature start_verify_shift32_imm.
- Enables enable_symbol_and_section_labels only in the rbpf-cli.
2021-12-03 15:45:25 +01:00
Jack May
976eb81d4f Cleanup the bank's use of nonces (#21246) 2021-12-02 09:57:05 -08:00
ryleung-solana
8cf36e5cb0 Add GPU sigverify for verify path (#20851)
Allows the use of GPU acceleration in verifying the signatures in Entry's after deserialization in the replay stage

Co-authored-by: Stephen Akridge <sakridge@gmail.com>
Co-authored-by: Ryan Leung <ryan.leung@solana.com>
2021-11-30 21:16:13 -05:00
Jon Cinque
02bc4e3fc1 spl-token: New program feature flag (#21354)
* spl-token: Add feature flag for new release

* Remove all spl token version declarations
2021-11-21 14:27:03 +01:00
carllin
b30c94ce55 ClusterInfoVoteListener send only missing votes to BankingStage (#20873) 2021-11-18 15:20:41 -08:00
Alexander Meißner
e540b1cf3c Refactor: Move sdk::process_instruction in program-runtime-crate (#21180)
* Moves the Executor dyn Trait to instruction_processor.rs

* Moves the Logger dyn Trait as well as the ic_msg and ic_logger_msg macros to log_collector.rs,
and moves the stable_log to stable_log.rs

* Moves the ComputeMeter dyn Trait to invoke_context.rs

* Moves the InvokeContext dyn Trait and the ProcessInstructionWithContext type to invoke_context.rs

* Updates cargo files.

* Re-export InvokeContext in program-test

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-11-17 19:35:07 +01:00
Jack May
cb0bb5bd1e Nonce accounts must be writeable (#21260)
* Nonce accounts must be writeable

* feedback

* feedback
2021-11-16 23:01:00 +00:00
Alexander Meißner
0661aa67ed Adds a feature gate to reject the deployment of programs with unresolved syscall symbols. (#21298) 2021-11-16 18:21:16 +01:00
Kirill Fomichev
d8a392c20b add new macro: pubkey! (#21245)
* add new macro: `pubkey!`

* fmt
2021-11-15 11:22:51 -08:00
Jeff Washington (jwash)
f8dcb2f38b report mem stats (#21258) 2021-11-13 00:59:41 +00:00
Tao Zhu
11153e1f87 refactor cost calculation (#21062)
* - cache calculated transaction cost to allow sharing;
- atomic cost tracking op;
- only lock accounts for transactions eligible for current block;
- moved qos service and stats reporting to its own model;
- add cost_weight default to neutral (as 1), vote has zero weight;

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update core/src/qos_service.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update core/src/qos_service.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-11-12 01:04:53 -06:00
Jack May
131c0d78c4 Fix compute budget bump (#21238) 2021-11-11 14:09:28 -08:00
Alexander Meißner
6704fa011f Removes native loader entrypoints from the SDK and thus from the public interface. (#21185) 2021-11-05 12:49:04 +01:00
Alexander Meißner
7200c5106e Replaces MockInvokeContext by ThisInvokeContext in tests (#20881)
* Replaces MockInvokeContext by ThisInvokeContext in BpfLoader, SystemInstructionProcessor, CLIs, ConfigProcessor, StakeProcessor and VoteProcessor.

* Finally, removes MockInvokeContext, MockComputeMeter and MockLogger.

* Adjusts assert_instruction_count test.

* Moves ThisInvokeContext to the program-runtime crate.
2021-11-04 21:47:32 +01:00
Alexander Meißner
29ad081555 Stop caching sysvars, instead load them ahead of time. (#21108) 2021-11-04 09:48:34 +01:00
Justin Starry
140a5f633d Simplify replay vote tracking by using packet metadata (#21112) 2021-11-03 09:02:48 +00:00
Jack May
1adf255e3a Deprecate more Fee/Blockhash APIs (#21140) 2021-11-02 16:38:23 -07:00
Jack May
bced07a099 Update fee api to use blockhash (#21054) 2021-10-29 13:52:59 -07:00
Jack May
4aa12a52b6 Feature cleanup (#21038) 2021-10-28 09:04:03 -07:00
Justin Starry
036d7fcc81 Clean up sanitized tx creation for tests (#21006) 2021-10-27 18:09:16 +01:00
Jack May
1e2bef76e3 Add compute budget program as a noop (#20992) 2021-10-26 20:08:59 -07:00
Jack May
2515f6a04f Update deprecation versions (#20959) 2021-10-26 09:06:41 -07:00
Alexander Meißner
cf0fd5b2ca Moves NonceKeyedAccount from the SDK to the Runtime. (#20954) 2021-10-25 22:58:18 +02:00
Jack May
bfbbc53dac Divorce the runtime from FeeCalculator (#20737) 2021-10-22 14:32:40 -07:00
Alexander Meißner
e7c9b9329d Fixes a bug in MockInvokeContext::get_compute_meter() and adjusts the test assert_instruction_count accordingly. (#20854)
The get_compute_meter() method created a reference to a clone instead of cloning the reference.
2021-10-22 09:46:47 +02:00
Alexander Meißner
97c2732d02 Refactor: Cleanup InvokeContext (#20785)
* Move blockhash and fee_calculator in ThisInvokeContext instead of using a reference.

* Moves tx_wide_compute_cap into InvokeContext::push().

* Adds ThisInvokeContext::new_mock() constructor.

* Adds missing loader account in uses of MockInvokeContext.

* Use keyed_account_at_index() when accessing keyed_accounts.

* Makes sysvar interface consistent between ThisInvokeContext and MockInvokeContext,
in order to add InvokeContext::get_sysvars().

* Adds InvokeContext::set_blockhash() and InvokeContext ::set_fee_calculator().

* Adds new_mock_with_features.

* Makes ancestors optional in ThisInvokeContext.

* Adds prepare_mock_invoke_context() and mock_process_instruction().
2021-10-21 20:57:42 +02:00
Jack May
58164517e4 Add program heap bump instruction (#20607) 2021-10-19 21:01:39 -07:00
Brian Anderson
d9b0fc0e3e Remove @brief annotations from Rust API docs (#20769) 2021-10-19 15:48:15 -06:00
Alexander Meißner
e98cfbb570 Removes deprecated BpfComputeBudget. (#20728) 2021-10-18 09:55:41 +02:00
behzad nouri
0c0384ec32 revises turbine peers shuffling order (#20480)
Turbine randomly shuffles cluster nodes on a broadcast tree for each
shred. This requires knowing the stakes and nodes' contact-infos (from
gossip).

However gossip is subject to partitioning and propogation delays.
Additionally unstaked nodes may join and leave the cluster at any
moment, changing the cluster view from one node to another.

This commit:
* Always arranges the unstaked nodes at the bottom of turbine broadcast
  tree.
* Staked nodes are always included regardless of if their contact-info
  is available in gossip or not.
* Uses the unbiased WeightedShuffle construct for shuffling nodes.
2021-10-14 15:09:36 +00:00
Jack May
da45be366a Remove blockhash from fee calculation (#20641) 2021-10-13 13:10:58 -07:00
Alexander Meißner
1d813ea078 Refactor: Make program_id always last in program chain (#20598)
* Replaces program_id field in InvokeContextStackFrame by index.

* Swaps order of program account and programdata account.

* Removes program_id parameter from InvokeContext::push().
2021-10-13 08:58:20 +02:00
Jack May
c231cfe235 Reduce budget request instruction length (#20636) 2021-10-12 20:56:24 -07:00