212 Commits

Author SHA1 Message Date
Arthur Greef
28fdfed1ba
Blake3 syscall (#17358) 2021-06-08 11:04:10 -07:00
dependabot[bot]
cb086ae492
chore: bump borsh from 0.8.1 to 0.9.0 (#17780)
* chore: bump borsh from 0.8.1 to 0.9.0

Bumps [borsh](https://github.com/near/borsh-rs) from 0.8.1 to 0.9.0.
- [Release notes](https://github.com/near/borsh-rs/releases)
- [Changelog](https://github.com/near/borsh-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/near/borsh-rs/compare/v0.8.1...v0.9.0)

---
updated-dependencies:
- dependency-name: borsh
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Clean bump and cargo-for-all-lock-files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-07 21:11:38 +00:00
Jack May
83b9a046d1
Add missing ProgramError to InstructionError mappings (#16231)
* Add missing ProgramError to InstructionError mappings

* add note

* Clarify process of adding new program error
2021-06-03 21:59:04 +00:00
Jack May
2b50529265
Add memory operation syscalls (#16447) 2021-06-01 15:33:17 -07:00
dependabot[bot]
86c07bf785
Bump bs58 from 0.3.1 to 0.4.0 (#17573)
* Bump bs58 from 0.3.1 to 0.4.0

Bumps [bs58](https://github.com/mycorrhiza/bs58-rs) from 0.3.1 to 0.4.0.
- [Release notes](https://github.com/mycorrhiza/bs58-rs/releases)
- [Commits](https://github.com/mycorrhiza/bs58-rs/compare/0.3.1...0.4.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Fixup

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-05-28 18:30:34 +00:00
Michael Vines
8eab0e8602
Bump version to v1.8.0 (#17541) 2021-05-27 08:51:53 -07:00
Jeff Washington (jwash)
44831c18d2
reuse work in is_non_loader_key (#16521) 2021-05-21 10:07:04 -05:00
Dmitri Makarov
2ae57c172a Bump bpf-tools version to 1.9
- upgrade rustc to 1.52.1 and clang to 12.0
2021-05-20 11:35:37 +02:00
Tao Zhu
0781fe1b4f
Upgrade Rust to 1.52.0 (#17096)
* Upgrade Rust to 1.52.0
update nightly_version to newly pushed docker image
fix clippy lint errors
1.52 comes with grcov 0.8.0, include this version to script

* upgrade to Rust 1.52.1

* disabling Serum from downstream projects until it is upgraded to Rust 1.52.1
2021-05-19 09:31:47 -05:00
Jack May
8eb05d6ed4
Add Keccak256 syscall and sdk support (#16498) 2021-05-10 16:16:58 -07:00
Jon Cinque
4b60b2863e
sdk: Add get_instance_packed_len for variable-size types (#17092)
* sdk: Add get_instance_packed_len for variable-size types

* Add comment for get_packed_len

* Add more tests
2021-05-10 23:31:02 +02:00
Trent Nelson
cfc1cb1aee SDK: Factor out pubkey on-curve test to a helper 2021-04-28 20:10:19 -06:00
Trent Nelson
9b7120bf73 SDK: More conversions for Pubkey 2021-04-27 17:54:02 -06:00
Justin Starry
8ce4a8d6ab
Annotate clock constants with computed values for quick refeerence (#16812) 2021-04-25 22:05:00 +08:00
Michael Vines
1500011fc6 get_packed_len() now correctly handles u32/i32 types 2021-04-23 13:39:42 -07:00
Jeff Washington (jwash)
48c07d32f0
WritableAccount.add/subtract_lamports (#16750)
* add/sub lamports

* make add/sub return Result

* sample replacements

* cleanup

* fix up a few tests as examples

* move enum, cleanup, impl from

* fmt

* cleanup

* add lamports.rs
2021-04-23 20:20:48 +00:00
Sebastian Bor
1a658c7f31
Allow SetUpgradeAuthority instruction in CPI calls (#16676)
* feat: allow SetAuthority in CLI calls

* chore: clippy match_like_matches_macro

* chore: clippy match_like_matches_macro

* chore: rename CLI to CPI

* chore: move check for cpi authorised instruction to syscalls

* chore: add set_upgrade_authority cpi test

* chore: assert upgrade authority was changed

* feat: gate set_upgrade_authority via cpi with a feature

* chore: move feature to the end of the list

* chore: remove white spaces

* chore: remove white spaces

* chore: update comment to rerun build
2021-04-22 00:06:59 +01:00
Jack May
01786f684e
Remove unwrap (#16652) 2021-04-19 20:17:56 -07:00
Michael Vines
a911ae00ba clippy 2021-04-18 20:55:02 -07:00
Justin Starry
f641429056
Remove blake3 from bpf program dependencies (#16506) 2021-04-13 10:06:05 +00:00
Justin Starry
85eb37fab0
Merge pull request from GHSA-8v47-8c53-wwrc
* Track transaction check time separately from account loads

* banking packet process metrics

* Remove signature clone in status cache lookup

* Reduce allocations when converting packets to transactions

* Add blake3 hash of transaction messages in status cache

* Bug fixes

* fix tests and run fmt

* Address feedback

* fix simd tx entry verification

* Fix rebase

* Feedback

* clean up

* Add tests

* Remove feature switch and fall back to signature check

* Bump programs/bpf Cargo.lock

* clippy

* nudge benches

* Bump `BankSlotDelta` frozen ABI hash`

* Add blake3 to sdk/programs/Cargo.lock

* nudge bpf tests

* short circuit status cache checks

Co-authored-by: Trent Nelson <trent@solana.com>
2021-04-13 00:28:08 -06:00
Jack May
fa83f3bd73
Return sysvars via syscalls (#16422) 2021-04-12 16:04:57 -07:00
François Garillot
b08cff9e77
Simplify some pattern-matches (#16402)
When those match an exact combinator on Option / Result.

Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust).
2021-04-08 12:40:37 -06:00
Jack May
92f4018b07
Cleanup unsupported sysvars (#16390)
* Cleanup unsupported sysvars

* fix ser description
2021-04-06 00:08:03 -07:00
Jack May
f84e88f0a2
Cleanup nits (#16211) 2021-03-30 12:16:21 -07:00
sakridge
54c68ea83f
Drop write lock on sysvars (#15497)
* Drop write lock on sysvars

* adds env var for demoting sysvar write lock demotion

* moves demote logic to is_writable

* feature gates sysvar write lock demotion

* adds builtins to write lock demotion

* adds system program id to builtins

* adds Feature111...

* adds an abi-freeze test

* mvines set of builtin program keys

Co-authored-by: Michael Vines <mvines@gmail.com>

* update tests

* adds bpf loader keys

* Add test sysvar

* Plumb demote_sysvar to is_writable

* more plumbing of demote_sysvar_write_locks to is_writable

* patches test_program_bpf_instruction_introspection

* hard codes demote_sysvar_write_locks to false for serialization/encoding methods

* Revert "hard codes demote_sysvar_write_locks to false for serialization/encoding methods"

This reverts commit ae3e2d2e777437bddd753933097a210dcbc1b1fc.

* change the hardcoded ones to demote_sysvar_write_locks=true

* Use data_as_mut_slice

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
Co-authored-by: Michael Vines <mvines@gmail.com>
2021-03-30 10:05:09 -07:00
Trent Nelson
9ba9d2a8ae Allow incomplete features in frozen-abi 2021-03-30 02:32:53 +00:00
Justin Starry
aabe186e3f
sdk: Use u32::MAX from std to unbreak BPF builds (#16171) 2021-03-27 15:53:25 +00:00
Jon Cinque
cffa851e0f
sdk: Add try_from_slice_unchecked for Borsh (#16098)
* sdk: Add try_from_slice_unchecked for Borsh

* Add tests

* Rename + clarify comment

* Rename back to unchecked
2021-03-26 23:37:35 +01:00
Ryo Onodera
6d5c6c17c5
Simplify account.rent_epoch handling for sysvar rent (#16049)
* Add some code for special local testing

* Add comment to store_account_and_update_capitalization

* Simplify account.rent_epoch handling for sysvar rent

* Introduce *_for_test functions

* Add deprecation messages to existing api
2021-03-25 15:23:20 +09:00
Trent Nelson
8b3de72e2a program: Correct clamp in Message::signer_keys() 2021-03-24 23:27:24 -06:00
Kristofer Peterson
6bc858a888 Refactored ShortU16Visitor::visit_seq() to reject overflows, extra leading zeros and ensure one-to-one encoding. 2021-03-24 21:53:35 -06:00
Trent Nelson
9153cb9237 sdk: ShortU16 - rename variables for clarity
ShortU16's implementation embeds its usage as the length of a
ShortVec, confusingly referring to both a 'len' and a 'size'
at the same time.
2021-03-24 21:53:35 -06:00
Trent Nelson
cc6dcb48d4 sdk: Add ShortU16 deser test 2021-03-24 21:53:35 -06:00
Jeff Washington (jwash)
6f5d8d18e9
remove new alloc on deserialization (#15636) 2021-03-23 14:52:59 -05:00
Trent Nelson
482c027d3b sq: optimize 2021-03-22 12:01:57 -06:00
Justin Starry
4c5660ba7a
Santize instruction index when loading instruction from sysvar (#15942) 2021-03-19 09:32:41 +08:00
Jack May
7f500d610c
Add Close instrruction and tooling to upgradeable loader (#15887) 2021-03-17 21:39:29 -07:00
Trent Nelson
12399157f5 SDK: Allow integer math in bump allocator 2021-03-17 22:23:18 -06:00
Trent Nelson
854e6766ce SDK: Ovf in epoch_schedule 2021-03-17 22:23:18 -06:00
Trent Nelson
98d7673a03 sdk/program: switch allow to mod-level for integer_arithmetic lint 2021-03-17 22:23:18 -06:00
Trent Nelson
bf33ce8906 sdk: Add accessor for signer pubkeys of a tx message 2021-03-16 22:09:46 -06:00
Michael Vines
a2eb655322 =1.7.0 2021-03-16 07:51:07 +00:00
Ryo Onodera
74aa32175b
Show flags for accounts in tx by solana confirm (#15804)
* Show flags for accounts in tx by solana confirm

* Address review comments

* Improve comment a bit

* Apply suggestions from code review

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

* Further apply review suggestions

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-03-16 14:44:48 +09:00
Michael Vines
8567b41d5f Improve Instruction::new deprecation warning 2021-03-15 20:04:20 -07:00
carllin
c1ba265dd9
Wallclock BankingStage Throttle (#15731) 2021-03-15 17:11:15 -07:00
Michael Vines
0c9ca5522c Bump version to v1.7.0 2021-03-13 09:01:21 +00:00
Trent Nelson
79ac1997de sdk: add macro for unchecked div with const denominator 2021-03-11 08:44:36 +00:00
Trent Nelson
24d18b3cf2 docs: add docs links for crates published to crates.io 2021-03-11 08:38:18 +00:00
Tyera Eulberg
e3e8179f2d
Sdk: start to appease clippy's integer arithmetic check (#15736)
* Move to module-level clippy allowance

* Fix stake_weighted_timestamp math

* Fix genesis_config

* Fix shred_version

* Fix hard_forks

* Fix process_instruction

* Add ArithmeticOverflow ix error

* Fix nonce_keyed_account

* Update BankSlotDelta frozen abi due to new ix error
2021-03-08 18:37:57 -07:00