Commit Graph

1627 Commits

Author SHA1 Message Date
Michael Vines db37680f6f Add extra authorized withdrawer test 2021-06-16 18:26:25 -07:00
dependabot[bot] 6f5b248746
chore: bump miow from 0.2.2 to 0.3.6 (#18000)
* chore: bump miow from 0.2.2 to 0.3.6

Bumps [miow](https://github.com/yoshuawuyts/miow) from 0.2.2 to 0.3.6.
- [Release notes](https://github.com/yoshuawuyts/miow/releases)
- [Changelog](https://github.com/yoshuawuyts/miow/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yoshuawuyts/miow/compare/0.2.2...v0.3.6)

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

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

* Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-16 12:30:17 -06:00
dependabot[bot] 0323ea9f7e
chore: bump tarpc from 0.24.1 to 0.26.2 (#17966)
* chore: bump tarpc from 0.24.1 to 0.26.2

Bumps [tarpc](https://github.com/google/tarpc) from 0.24.1 to 0.26.2.
- [Release notes](https://github.com/google/tarpc/releases)
- [Changelog](https://github.com/google/tarpc/blob/master/RELEASES.md)
- [Commits](https://github.com/google/tarpc/commits)

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

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

* [auto-commit] Update all Cargo lock files

* Accommodate breaking changes & update tracing

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-15 20:31:34 +00:00
Jon Cinque 1b1d34da59
Refactor stake program into solana_program (#17906)
* Move stake state / instructions into solana_program

* Update account-decoder

* Update cli and runtime

* Update all other parts

* Commit Cargo.lock changes in programs/bpf

* Update cli stake instruction import

* Allow integer arithmetic

* Update ABI digest

* Bump rust mem instruction count

* Remove useless structs

* Move stake::id() -> stake::program::id()

* Re-export from solana_sdk and mark deprecated

* Address feedback

* Run cargo fmt
2021-06-15 18:04:00 +02:00
dependabot[bot] 36b09db2d1
chore: bump rpassword from 4.0.5 to 5.0.1 (#17965)
* chore: bump rpassword from 4.0.5 to 5.0.1

Bumps [rpassword](https://github.com/conradkleinespel/rpassword) from 4.0.5 to 5.0.1.
- [Release notes](https://github.com/conradkleinespel/rpassword/releases)
- [Commits](https://github.com/conradkleinespel/rpassword/compare/v4.0.5...v5.0.1)

---
updated-dependencies:
- dependency-name: rpassword
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-06-15 09:28:34 -06:00
dependabot[bot] 61a8badb31
chore: bump thiserror from 1.0.23 to 1.0.25 (#17964)
* chore: bump thiserror from 1.0.23 to 1.0.25

Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.23 to 1.0.25.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.23...1.0.25)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-06-15 09:27:47 -06:00
Tyera Eulberg b7de369992
Bump spl-token to v3.1.1 (#17951) 2021-06-14 23:33:20 -06:00
dependabot[bot] a0872232d3
chore: bump itertools from 0.9.0 to 0.10.1 (#17929)
* chore: bump itertools from 0.9.0 to 0.10.1

Bumps [itertools](https://github.com/rust-itertools/itertools) from 0.9.0 to 0.10.1.
- [Release notes](https://github.com/rust-itertools/itertools/releases)
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/compare/v0.9.0...v0.10.1)

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

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

* Fix versions

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-14 18:32:20 +00:00
Dmitri Makarov 32742df1b4 Add build script to extract a list of registered syscalls
The list is used in cargo-build-bpf to check generated .so modules for
undefined symbols that are not known run-time syscalls.
2021-06-14 04:51:30 -07:00
Dmitri Makarov 361c1bdd57
Fix file permissions (#17910) 2021-06-12 02:03:32 +00:00
dependabot[bot] 2e75023840
chore: bump regex from 1.4.5 to 1.5.4 (#17885)
* chore: bump regex from 1.4.5 to 1.5.4

Bumps [regex](https://github.com/rust-lang/regex) from 1.4.5 to 1.5.4.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.4.5...1.5.4)

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

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-06-11 09:50:54 -06:00
Dmitri Makarov d272468a14
Adjust assert_instruction_count expected insn count value (#17874) 2021-06-10 20:50:55 +00:00
dependabot[bot] f08ed1eb2d
chore: bump rayon from 1.5.0 to 1.5.1 (#17869)
* chore: bump rayon from 1.5.0 to 1.5.1

Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.5.0...v1.5.1)

---
updated-dependencies:
- dependency-name: rayon
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <you@example.com>
2021-06-10 13:18:47 -06:00
dependabot[bot] 4a146b6a19
chore: bump mio from 0.7.6 to 0.7.11 (#17872)
* chore: bump mio from 0.7.6 to 0.7.11

Bumps [mio](https://github.com/tokio-rs/mio) from 0.7.6 to 0.7.11.
- [Release notes](https://github.com/tokio-rs/mio/releases)
- [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/mio/commits)

---
updated-dependencies:
- dependency-name: mio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-10 19:15:34 +00:00
dependabot[bot] 527b07966f
chore: bump semver from 0.11.0 to 1.0.3 (#17871)
* chore: bump semver from 0.11.0 to 1.0.3

Bumps [semver](https://github.com/dtolnay/semver) from 0.11.0 to 1.0.3.
- [Release notes](https://github.com/dtolnay/semver/releases)
- [Commits](https://github.com/dtolnay/semver/compare/0.11.0...1.0.3)

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

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

* [auto-commit] Update all Cargo lock files

* Use constructor to avoid pre/build typing issues

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <you@example.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-10 13:02:31 -06:00
Trent Nelson e0d679b319 programs/config: Disallow duplicate signers 2021-06-09 23:09:09 -06:00
Dmitri Makarov 2fe211c5e0
Remove O2 option for compiling BPF programs (#17865)
rustc default compiler optimization level is O3. This change removes
the option that overrides the default optimization level, because it
is safe to do so.  The code generation is incorrect in some cases
because of link-time optimizations, which remain disabled for
compiling BPF programs.  In addition, this commit updates the expected
instruction counts for assert_instruction_count test.
2021-06-10 05:04:17 +00:00
dependabot[bot] 2c591ebaab
chore: bump nix from 0.19.0 to 0.20.0 (#17853)
* chore: bump nix from 0.19.0 to 0.20.0

Bumps [nix](https://github.com/nix-rust/nix) from 0.19.0 to 0.20.0.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.19.0...v0.20.0)

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

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-06-09 18:01:26 +00:00
dependabot[bot] 9a2ca8dd2f
chore: bump rustc_version from 0.2.3 to 0.4.0 (#17854)
* chore: bump rustc_version from 0.2.3 to 0.4.0

Bumps [rustc_version](https://github.com/Kimundi/rustc-version-rs) from 0.2.3 to 0.4.0.
- [Release notes](https://github.com/Kimundi/rustc-version-rs/releases)
- [Commits](https://github.com/Kimundi/rustc-version-rs/compare/v0.2.3...v0.4.0)

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

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

* Make versions consistent

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-09 16:57:39 +00:00
Arthur Greef 28fdfed1ba
Blake3 syscall (#17358) 2021-06-08 11:04:10 -07:00
dependabot[bot] 03f4eb3ed1
chore: bump hex from 0.4.2 to 0.4.3 (#17829)
* chore: bump hex from 0.4.2 to 0.4.3

Bumps [hex](https://github.com/KokaKiwi/rust-hex) from 0.4.2 to 0.4.3.
- [Release notes](https://github.com/KokaKiwi/rust-hex/releases)
- [Commits](https://github.com/KokaKiwi/rust-hex/compare/v0.4.2...v0.4.3)

---
updated-dependencies:
- dependency-name: hex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-06-08 09:34:04 -06:00
Tyera Eulberg a66566e75b
Remove budget program (#17816) 2021-06-08 01:20:17 +00: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
dependabot[bot] 0a24cff30e
chore: bump tokio-stream from 0.1.2 to 0.1.6 (#17784)
* chore: bump tokio-stream from 0.1.2 to 0.1.6

Bumps [tokio-stream](https://github.com/tokio-rs/tokio) from 0.1.2 to 0.1.6.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.2...tokio-stream-0.1.6)

---
updated-dependencies:
- dependency-name: tokio-stream
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-06-07 09:44:50 -06:00
dependabot[bot] 43b8d98055
chore: bump generic-array from 0.14.3 to 0.14.4 (#17782)
* chore: bump generic-array from 0.14.3 to 0.14.4

Bumps [generic-array](https://github.com/fizyk20/generic-array) from 0.14.3 to 0.14.4.
- [Release notes](https://github.com/fizyk20/generic-array/releases)
- [Changelog](https://github.com/fizyk20/generic-array/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fizyk20/generic-array/compare/0.14.3...0.14.4)

---
updated-dependencies:
- dependency-name: generic-array
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-06-07 09:06:34 -06:00
Jon Cinque 8f5e773caf
system-program: Remove zero lamport check on transfers (#17726)
* system-program: Move lamports == 0 check on transfers

* Address feedback

* Update stake split to explicitly allocate + assign

* Update stake tests referring to split instruction

* Revert whitespace

* Update split instruction index in test

* Remove unnecessary `assign_with_seed` from `split_with_seed`

* Fix stake instruction parser

* Update test to allow splitting into account with lamports
2021-06-06 01:45:45 +02:00
dependabot[bot] 7bb5f24274
chore: bump libsecp256k1 from 0.3.5 to 0.5.0 (#17734)
* chore: bump libsecp256k1 from 0.3.5 to 0.5.0

Bumps [libsecp256k1](https://github.com/paritytech/libsecp256k1) from 0.3.5 to 0.5.0.
- [Release notes](https://github.com/paritytech/libsecp256k1/releases)
- [Changelog](https://github.com/paritytech/libsecp256k1/blob/master/CHANGELOG.md)
- [Commits](https://github.com/paritytech/libsecp256k1/commits)

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

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

* [auto-commit] Update all Cargo lock files

* Update crate name

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-04 13:09:35 -06:00
dependabot[bot] 4bba92d3da
chore: bump serde_json from 1.0.62 to 1.0.64 (#17735)
* chore: bump serde_json from 1.0.62 to 1.0.64

Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.62 to 1.0.64.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.62...v1.0.64)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-06-04 17:45:26 +00:00
dependabot[bot] 3dcc8e0046
chore: bump libloading from 0.6.2 to 0.7.0 (#17704)
* chore: bump libloading from 0.6.2 to 0.7.0

Bumps [libloading](https://github.com/nagisa/rust_libloading) from 0.6.2 to 0.7.0.
- [Release notes](https://github.com/nagisa/rust_libloading/releases)
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.6.2...0.7.0)

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

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

* [auto-commit] Update all Cargo lock files

* New libloading methods are marked unsafe

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-03 18:08:31 -06:00
Dmitri Makarov 47861fc373 Bump BPF tools to v1.9 2021-06-03 17:06:49 -07:00
dependabot[bot] 4971bc45f2
chore: bump pbkdf2 from 0.6.0 to 0.8.0 (#17703)
* chore: bump pbkdf2 from 0.6.0 to 0.8.0

Bumps [pbkdf2](https://github.com/RustCrypto/password-hashes) from 0.6.0 to 0.8.0.
- [Release notes](https://github.com/RustCrypto/password-hashes/releases)
- [Commits](https://github.com/RustCrypto/password-hashes/compare/pbkdf2-v0.6.0...pbkdf2-v0.8.0)

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

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

* [auto-commit] Update all Cargo lock files

* Bump hmac too

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-03 17:37:28 -06: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
dependabot[bot] 8e1e57a181
chore: bump tar from 0.4.28 to 0.4.35 (#17666)
* chore: bump tar from 0.4.28 to 0.4.35

Bumps [tar](https://github.com/alexcrichton/tar-rs) from 0.4.28 to 0.4.35.
- [Release notes](https://github.com/alexcrichton/tar-rs/releases)
- [Commits](https://github.com/alexcrichton/tar-rs/compare/0.4.28...0.4.35)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <you@example.com>
2021-06-02 14:17:58 -06:00
dependabot[bot] 19c49e2e25
chore: bump crossbeam-channel from 0.4.4 to 0.5.0 (#17665)
* chore: bump crossbeam-channel from 0.4.4 to 0.5.0

Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.4.4 to 0.5.0.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.4.4...crossbeam-channel-0.5.0)

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

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <you@example.com>
2021-06-02 19:36:28 +00:00
Jack May 80e5b24b38
Fix CPI recursion depth (#17659)
* Fix CPI recursion depth
2021-06-02 11:15:19 +02:00
Jack May 4e0db50e4e
Fix test instruction count (#17655) 2021-06-01 22:59:35 -07:00
Jack May 2b50529265
Add memory operation syscalls (#16447) 2021-06-01 15:33:17 -07:00
dependabot[bot] a43c29e858
Bump indicatif from 0.15.0 to 0.16.2 (#17628)
* Bump indicatif from 0.15.0 to 0.16.2

Bumps [indicatif](https://github.com/mitsuhiko/indicatif) from 0.15.0 to 0.16.2.
- [Release notes](https://github.com/mitsuhiko/indicatif/releases)
- [Commits](https://github.com/mitsuhiko/indicatif/compare/0.15.0...0.16.2)

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

* [auto-commit] Update all Cargo lock files

* Fix message types

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-06-01 17:38:02 +00:00
dependabot[bot] a0d721c6bd
Bump sha2 from 0.9.2 to 0.9.5 (#17627)
* Bump sha2 from 0.9.2 to 0.9.5

Bumps [sha2](https://github.com/RustCrypto/hashes) from 0.9.2 to 0.9.5.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/compare/sha2-v0.9.2...sha2-v0.9.5)

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-06-01 08:58:38 -06:00
dependabot[bot] ab0f4ff835
Bump serde from 1.0.122 to 1.0.126 (#17618)
* Bump serde from 1.0.122 to 1.0.126

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.122 to 1.0.126.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.122...v1.0.126)

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <anatoly+githubjenkins@solana.io>
2021-05-31 22:41:25 +00:00
dependabot[bot] 88a22d7b0f
Bump rustversion from 1.0.4 to 1.0.5 (#17610)
* Bump rustversion from 1.0.4 to 1.0.5

Bumps [rustversion](https://github.com/dtolnay/rustversion) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/dtolnay/rustversion/releases)
- [Commits](https://github.com/dtolnay/rustversion/compare/1.0.4...1.0.5)

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-05-31 16:54:15 +00:00
Michael Vines 2896fc3987
Make `initialize` public (#17605) 2021-05-31 00:14:50 -07:00
Dmitri Makarov 831e87c65d
Add BPF rustc option to reduce the optimizations to safer level (#17590) 2021-05-28 23:14:53 +00:00
Jack May 89ee8778bc
Unify BPF verifiers (#17585) 2021-05-28 14:24:02 -07:00
dependabot[bot] a35024123c
chore: bump memmap2 from 0.1.0 to 0.2.3 (#17548)
Bumps [memmap2](https://github.com/RazrFalcon/memmap2-rs) from 0.1.0 to 0.2.3.
- [Release notes](https://github.com/RazrFalcon/memmap2-rs/releases)
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.1.0...v0.2.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-28 13:11:58 -06: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
Jack May a3240aebde
Always bail if program modifies a ro account (#17569) 2021-05-28 09:50:25 -07:00
Dmitri Makarov 2316ddb90a
Revert bpf-tools to version 1.8 because of a codegen bug suspicion (#17568) 2021-05-28 09:36:46 +00:00
dependabot[bot] e833d2ba5b
Bump num-derive from 0.3.2 to 0.3.3 (#17547)
* Bump num-derive from 0.3.2 to 0.3.3

Bumps [num-derive](https://github.com/rust-num/num-derive) from 0.3.2 to 0.3.3.
- [Release notes](https://github.com/rust-num/num-derive/releases)
- [Changelog](https://github.com/rust-num/num-derive/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-derive/compare/num-derive-0.3.2...num-derive-0.3.3)

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

* chore: bump num-derive

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-05-27 19:43:00 -06:00
dependabot[bot] ec1a307a7c
Bump console from 0.11.3 to 0.14.1 (#16301)
* Bump console from 0.11.3 to 0.14.1

Bumps [console](https://github.com/mitsuhiko/console) from 0.11.3 to 0.14.1.
- [Release notes](https://github.com/mitsuhiko/console/releases)
- [Changelog](https://github.com/mitsuhiko/console/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/console/compare/0.11.3...0.14.1)

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

* Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-05-27 18:55:27 +00:00
dependabot[bot] 4f74c77146
chore: bump chrono-humanize from 0.1.1 to 0.2.1 (#16895)
* chore: bump chrono-humanize from 0.1.1 to 0.2.1

Bumps [chrono-humanize](https://gitlab.com/imp/chrono-humanize-rs) from 0.1.1 to 0.2.1.
- [Release notes](https://gitlab.com/imp/chrono-humanize-rs/tags)
- [Commits](https://gitlab.com/imp/chrono-humanize-rs/compare/0.1.1...0.2.1)

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <anatoly+githubjenkins@solana.io>
2021-05-27 18:03:15 +00:00
dependabot[bot] 6e2ae68643
Bump serde_bytes from 0.11.4 to 0.11.5 (#16299)
* Bump serde_bytes from 0.11.4 to 0.11.5

Bumps [serde_bytes](https://github.com/serde-rs/bytes) from 0.11.4 to 0.11.5.
- [Release notes](https://github.com/serde-rs/bytes/releases)
- [Commits](https://github.com/serde-rs/bytes/compare/0.11.4...0.11.5)

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-05-27 11:48:44 -06:00
Michael Vines 8eab0e8602
Bump version to v1.8.0 (#17541) 2021-05-27 08:51:53 -07:00
Michael Vines 9541411c15 Plumb transaction-level rewards (aka "rent debits") into the `getTransaction` RPC method 2021-05-27 03:05:05 +00:00
Dmitri Makarov 3ae4806dae
Fix missing builtins in C programs linking with compiler_builtins (#17475) 2021-05-25 17:11:02 +00:00
Dmitri Makarov 85b647d80f
Bump solana_rbpf to version 0.2.11 (#17404) 2021-05-25 08:05:35 +00:00
Alexander Meißner 855ae79598
Fix InvokeContext::push() account_deps (#17350)
* Reverts aliasing of account_deps with the previous invocation stack frame in InvokeContext::push().
* Adds explicit assert of programdata account content in test_program_bpf_upgrade_via_cpi.
2021-05-21 22:34:07 +02:00
Michael Vines 96cde36784 SetLockup now requires the authorized withdrawer when the lockup is not in force 2021-05-21 11:49:01 -07:00
Trent Nelson 019bccab51 stake: merge accounts with mismatched, but expired lockups 2021-05-21 10:50:27 -06:00
Trent Nelson 74ac6ab80f stake: plumb `can_merge_expired_lockups` feature flag 2021-05-21 10:50:27 -06:00
jon-chuang 662c2aaeec
programs/stake: cancel deactivate (#17344)
fix: remove stray println

add error for inconsistent input.

fix: lamports don't need to match when redelegating to same vote account

Improve comments

bump

Apply suggestions from code review


Add assert in test

Use stake_program_v4

Co-Authored-By: Trent Nelson <trent.a.b.nelson@gmail.com>

Co-authored-by: Trent Nelson <trent.a.b.nelson@gmail.com>
2021-05-21 05:31:55 +00:00
Tyera Eulberg 91f2b6185e
Prevent withrawing Initialized stake account to zero stake (#17366) 2021-05-21 02:01:08 +00:00
Michael Vines 2c99b23ad7 Add get_sysvar() helper to sdk 2021-05-21 01:30:12 +00: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
Jack May 477898f682
Optimize aligned memory used by the runtime (#17324) 2021-05-19 13:43:59 -07: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 cfcae50022
fix test (#17310) 2021-05-18 11:46:42 -07:00
Dmitri Makarov ab871ed4b7 Bump bpf-tools version to 1.8 2021-05-18 08:10:57 +02:00
Jack May f15dd1b4ef
Add C Serialization Tests for #17217 (#17294) 2021-05-17 16:33:58 -07:00
Dmitri Makarov 3f0480d060
Fix deprecated trait object without an explicit dyn warning (#17231) 2021-05-14 17:33:07 +00:00
Dmitri Makarov 4ed828e4ee Enable RBPF trace output for BPF tests that are not using bpf_loader 2021-05-11 23:50:42 +02:00
Jack May 8eb05d6ed4
Add Keccak256 syscall and sdk support (#16498) 2021-05-10 16:16:58 -07:00
Tyera Eulberg 694c674aa6
Implement Bip32 for seed-phrase/passphrase signing (#16942)
* Add Keypair helpers for bip32 derivation

* Plumb bip32 for SignerSourceKind::Ask

* Support full-path querystring

* Use as_ref

* Add public wrappers for from_uri cases

* Support master root derivations (and fix too-deep print

* Add ask:// HD documentation

* Update ASK elsewhere in docs
2021-05-03 19:58:56 -06:00
Jeff Washington (jwash) 541aa5ad85
tests: lamports -> lamports() (#16982) 2021-05-03 10:45:54 -05:00
Justin Starry 8e561354d5
Improve readability of vote lockout processing (#16987)
* Improve readability of vote lockout processing

* clippy

* simplify comment

* feedback
2021-05-02 08:36:06 +00:00
Jeff Washington (jwash) 763c04adf3
lamports = -> .set_lamports() (#16980) 2021-04-30 21:17:05 +00:00
Jeff Washington (jwash) 5e74cede4e
lamports -> lamports() (#16979) 2021-04-30 21:03:08 +00:00
Jeff Washington (jwash) 6f88aeac56
tests: .lamports= -> .set_lamports() (#16977)
* .lamports= -> .set_lamports()

* another

* fix

* another
2021-04-30 18:44:15 +00:00
Jeff Washington (jwash) 0af84bb91e
lamports= -> .set_lamports() (#16978) 2021-04-30 18:20:54 +00:00
Jeff Washington (jwash) ac87bc40ca
tests: .lamports -> .lamports() (#16976) 2021-04-30 18:16:58 +00:00
Jeff Washington (jwash) 94edd6140c
checked_sub_lamports (#16918) 2021-04-29 21:34:44 +00:00
Jeff Washington (jwash) c9c94a7ef2
checked_sub_lamports (#16923) 2021-04-29 12:38:21 -05:00
Jeff Washington (jwash) ca7b36ad8f
lamports -> lamports() (#16920) 2021-04-29 10:44:46 -05:00
Jeff Washington (jwash) 59e19828ea
set_lamports() (#16914) 2021-04-29 10:43:26 -05:00
Tyera Eulberg d6f30b7537
Refactor SignerSource to expose DerivationPath to other kinds of signers (#16933)
* One use statement

* Add stdin uri scheme

* Convert parse_signer_source to return Result

* A-Z deps

* Convert Usb data to Locator

* Pull DerivationPath out of Locator

* Wrap SignerSource to share derivation_path

* Review comments

* Check Filepath existence, readability in parse_signer_source
2021-04-29 01:42:21 -06:00
Jeff Washington (jwash) a7070a5ca7
set_lamports() (#16921) 2021-04-28 21:30:06 +00:00
Jeff Washington (jwash) 8dc15f727c
account.lamports -= (#16913) 2021-04-28 15:47:59 -05:00
Jeff Washington (jwash) 82e11588a5
lamports -> lamports() (#16915) 2021-04-28 14:55:55 -05:00
Jeff Washington (jwash) a7a671b3aa
AccountSharedData.set_executable() (#16881) 2021-04-28 14:07:43 +00:00
Jeff Washington (jwash) 2021255f91
executable() (#16880) 2021-04-28 08:53:54 -05:00
Trent Nelson 64fcb792c2 remote-wallet: Add helpers for locating remote wallets 2021-04-27 17:54:02 -06:00
Jack May 9b3a59f030
Retain alloc'd and updated data in cpi (#16850) 2021-04-27 13:36:42 -07:00
Jeff Washington (jwash) 1bd623cd15
private AccountSharedData.rent_epoch (#16844) 2021-04-27 13:51:13 -05:00
Jeff Washington (jwash) 69bfbf9e98
AccountSharedData.set_executable (#16836) 2021-04-27 09:56:50 -05:00
Jeff Washington (jwash) 3887169db0
lamports += to checked_add (#16841) 2021-04-27 09:56:18 -05:00
Jeff Washington (jwash) 998cba74b5
AccountSharedData.executable() (#16835) 2021-04-27 09:12:17 -05:00
Jeff Washington (jwash) 4e7e675c07
lamports += -> checked_add_lamports (#16791) 2021-04-27 09:11:35 -05:00
Jeff Washington (jwash) 603872685d
private AccountSharedData.owner (#16760)
* private AccountSharedData.owner

* fix perf test
2021-04-26 14:59:17 -05:00
Jeff Washington (jwash) f2ab0384e4
owner -> owner() (#16783) 2021-04-26 17:06:40 +00:00
Jeff Washington (jwash) aeff911c93
owner -> owner() (#16784) 2021-04-26 10:40:11 -05:00
Jeff Washington (jwash) 6d160768d7
delete vest program (#16795) 2021-04-26 08:50:46 -05:00
Jeff Washington (jwash) ca14c18998
owner -> owner() (#16782) 2021-04-23 22:49:47 +00:00
Jeff Washington (jwash) 1a4a7059af
owner -> owner() (#16785) 2021-04-23 15:59:13 -05: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
Jeff Washington (jwash) fb0b76c1f3
account.owner = X -> account.set_owner(X) (#16754) 2021-04-23 12:34:22 -05:00
Jeff Washington (jwash) 87e2e07d34
AccountSharedData.copy_into_owner_from_slice (#16755) 2021-04-23 09:34:08 -05:00
Jack May be4df39a4c
Remove unactivated ristretto syscall (#16727) 2021-04-22 09:29:42 -07: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
Jeff Washington (jwash) 03f7b251b8
ReadableAccount.data returns slice (#16686)
* ReadAbleAccount.data returns slice

* more slice fixup

* more slice

* slice
2021-04-20 16:41:16 -05:00
Jack May 08d5253651
Enforce host aligned memory for program regions (#16590) 2021-04-20 11:07:30 -07:00
Tyera Eulberg 185bbf2db5
Wrap derivation_path::DerivationPath (#16609)
* Replace custom DerivationPath impl

* Add method to parse full-path from str with hardening

* Convert Bip44 to trait

* Hoist more work on derivation-path

* Privatize Bip44 trait
2021-04-19 20:57:43 +00:00
Jack May 2409bb18f3
Remove unwrap from bpf_loader serialization (#16645) 2021-04-19 13:30:31 -07:00
Alexander Meißner 9dfcb921cf
Refactoring: Move KeyedAccounts to InvokeContext (#15410)
Collects all parametric occurrences and the construction of keyed_accounts and puts them into InvokeContext.
2021-04-19 18:48:48 +02:00
Michael Vines a911ae00ba clippy 2021-04-18 20:55:02 -07:00
Trent Nelson 5d1ef5d01d clap-utils: Use `uriparse` crate to parse `SignerSource` 2021-04-16 13:56:12 -06:00
Jack May 74f58376f8
Expand and update instruction count tests (#16522) 2021-04-13 16:23:42 -07:00
Michael Vines f7eadd9d70
bump solana_rbpf from 0.2.5 to 0.2.7 (#16515) 2021-04-13 14:49:09 -07:00
Dmitri Makarov db3bca7edd
Add llvm feature option to compile for Solana BPF target (#16495) 2021-04-13 07:20:18 +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
carllin dc7030ffaa
Allow fork choice to support multiple versions of a slot (#16266) 2021-04-12 01:00:59 -07:00
Christian Drappi 54a04bac3d
Apple M1 compatibility (#16346)
Co-authored-by: Christian Drappi <christiandrappi@Christians-MacBook-Pro.local>
2021-04-09 17:21:01 -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 476fd40948
Add program-test tests to bpf programs (#16407) 2021-04-07 01:47:15 -07:00
Jack May 92f4018b07
Cleanup unsupported sysvars (#16390)
* Cleanup unsupported sysvars

* fix ser description
2021-04-06 00:08:03 -07:00
Tyera Eulberg 03d3ae1cb9
Faucet: repurpose cap and slice args to apply to single IPs (#16381)
* Single use stmt

* Log request IP

* Switch cap and slice to apply per IP

* Use SOL in logs, error msgs

* Use thiserror instead of overloading io::Error

* Return memo transaction for requests that exceed per-request-cap

* Handle faucet memos in cli

* Add some docs, esp about memo transaction

* Use SOL symbol & standardize memo

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

* Differentiate faucet tx-length errors

* Populate signature in cli airdrop memo case

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-04-06 07:01:05 +00:00
Tyera Eulberg ae7bc8299d
Use spl-memo v3.0.1 (#16384)
* Use memo v3.0.1, which simplifies id imports

* tree
2021-04-06 02:06:44 +00:00
Michael Vines 9360e57816 Fix build 2021-04-05 17:12:31 -07:00
Michael Vines a4f0d8636a RpcClient no longer panics in a tokio multi-threaded runtime 2021-04-05 16:50:03 -07:00
bji 364af3a3e0
issue #10831: added --with-memo option to all cli commands that submit (#16291)
* issue #10831: added --with-memo option to all cli commands that submit
transactions.  Also, improve the block command to show UTF-8 string instead
of integer values for memo program data.

* Fixed tests and changed some syntax according to feedback.

* Use spl_memo id (all versions where applicable) instead of hardcoding id.

* Update Cargo.toml in programs/bpf.

* Update formatting via cargo fmt.

* Update to use spl_memo version 3.0.1, which simplifies package imports
2021-04-05 20:53:50 +00:00
Dmitri Makarov 1359bceb5d
Bump bpf-tools to version v1.5 (#16331)
The new version of bpf-tools eliminates the separate
rust-bpf-sysroot. The Rust standard libraries for the BPF target are
built in tree when the compiler is built.  The standard libraries code
is slightly more optimized and some reduction of compute budget can be
expected with this version of bpf-tools.
2021-04-04 13:04:22 +00:00
Jack May dee655df35
Cleanup use (#16327) 2021-04-02 08:54:09 -07:00
Tyera Eulberg a902505810
Parse SPL associated-token-account instructions (#16318) 2021-04-01 22:48:05 +00:00
behzad nouri 3f63ed9a72
removes OrderedIterator and transaction batch iteration order (#16153)
In TransactionBatch,
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/transaction_batch.rs#L4-L11
lock_results[i] is aligned with transactions[iteration_order[i]]:
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/bank.rs#L2414-L2424
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/accounts.rs#L788-L817

However load_and_execute_transactions is iterating over
  lock_results[iteration_order[i]]
https://github.com/solana-labs/solana/blob/e50f59844/runtime/src/bank.rs#L2878-L2889
and then returning i as for the index of the retryable transaction.

If iteratorion_order is [1, 2, 0], and i is 0, then:
  lock_results[iteration_order[i]] = lock_results[1]
which corresponds to
  transactions[iteration_order[1]] = transactions[2]
so neither i = 0, nor iteration_order[i] = 1 gives the correct index for the
corresponding transaction (which is 2).

This commit removes OrderedIterator and transaction batch iteration order
entirely. There is only one place in blockstore processor which the
iteration order is not ordinal:
https://github.com/solana-labs/solana/blob/e50f59844/ledger/src/blockstore_processor.rs#L269-L271
It seems like, instead of using an iteration order, that can shuffle entry
transactions in-place.
2021-03-31 23:59:19 +00:00
Jack May ad7f8e7f23
Use more performant copy (#16282) 2021-03-31 16:52:58 -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
Jeff Washington (jwash) f4f2e781ff
get rid of data copy (#16210)
* get rid of data copy

* format
2021-03-30 10:33:46 -05:00
Dmitri Makarov 658ddd1c9c
Bump bpf-tools to version v1.4 (#16152) 2021-03-26 19:21:41 +00:00
Justin Starry e817a6db00
Add timeout for local cluster partition tests (#16123)
* Add timeout for local cluster partition tests

* fix optimistic conf test logs

* Bump instruction count assertions
2021-03-25 13:27:07 -06:00
Jeff Washington (jwash) 66c42f62d8
make AccountSharedData.data private to abstract storage (#16091)
* format

* 2 more tests

* use
2021-03-25 11:04:20 -05: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
Dmitri Makarov 664ed76523
Bump bpf-tools to version v1.3 (#16068)
* Bump bpf-tools to version v1.3

This brings in the fix for increased compute budget that wasn't caught
when bpf-tools v1.2 were released.

* Adjust BPF test programs instruction counts
2021-03-24 07:16:38 +00:00
Jeff Washington (jwash) 2d24d13046
AccountsSharedData: data copy on write (#15800)
* Arc<AccountData>

* try custom serializer

* adapt test from Behzad's change

* clippy

* simplify serialization

* remove abi example derive

* refactor 'take'

* remove serialization

* remove serialize calls

* remove account_data

* remove intos

* remove left over file
2021-03-23 15:19:31 -05:00
Jeff Washington (jwash) 6f5d8d18e9
remove new alloc on deserialization (#15636) 2021-03-23 14:52:59 -05:00
Jeff Washington (jwash) 64429104b1
account data.fill replacement (#16037) 2021-03-19 15:13:20 -05:00
Dmitri Makarov 14e45155e4 Bump bpf-tools to v1.2 and get rid of xargo 2021-03-19 12:09:15 +01:00
Michael Vines 02b81dd05d Update to reqwest 0.11.2 2021-03-18 11:59:41 -07:00
Jack May 7f500d610c
Add Close instrruction and tooling to upgradeable loader (#15887) 2021-03-17 21:39:29 -07:00
Jeff Washington (jwash) d30c9ef351
refactor test truncate data (#15851)
* refactor test truncate data

* retain existing behavior
2021-03-17 15:09:26 -05:00
Trent Nelson 672e9c640f CLI: Support dumping the TX message in sign-only mode 2021-03-16 19:20:54 -06:00
Jeff Washington (jwash) 806bfdd67b
set_data_from_slice (#15854)
* data_ensure_equal_to_slice

* rename and change to copy
2021-03-16 16:56:26 -05:00
Michael Vines a2eb655322 =1.7.0 2021-03-16 07:51:07 +00:00
Jack May ad9901d7c6
Charge compute budget for bytes passed via cpi (#15874) 2021-03-15 22:41:44 -07:00
Michael Vines 0c9ca5522c Bump version to v1.7.0 2021-03-13 09:01:21 +00:00
Jack May cc38ae72e7
Skip deserialization of readonly accounts (#15813) 2021-03-11 19:28:21 -08:00
Jeff Washington (jwash) 952c3bcbb7
AccountSharedData construction (#15790) 2021-03-11 18:09:04 -06:00
Jeff Washington (jwash) 3419a5446e
AccountSharedData.set_data (#15781)
* account.set_data and resize_data

* remove data_resize
2021-03-11 16:40:45 -06:00
Michael Vines 1061d021c9 Unpack snapshot AppendVecs directly into account paths 2021-03-11 08:25:24 -08:00
Trent Nelson 24d18b3cf2 docs: add docs links for crates published to crates.io 2021-03-11 08:38:18 +00:00
Jack May 478518308d
Share RO and Executable accounts within invocations (#15799) 2021-03-10 23:04:00 -08:00
Jeff Washington (jwash) 1135ffd595
mut data refs as slice (#15782) 2021-03-10 15:28:03 -06:00
Jack May 369e13b111
cleanup old runtime features (#15787) 2021-03-10 09:48:41 -08:00
Dmitri Makarov c5a5d7457e
Bump bpf-tools to v1.1 (#15776) 2021-03-10 18:13:38 +01:00
Jeff Washington (jwash) 52e54e1100
account.data -> data() (#15778) 2021-03-09 22:31:33 +00:00
Jeff Washington (jwash) 8a3135d17b
Account->AccountSharedData (#15691) 2021-03-09 15:06:07 -06:00
Jack May efcb58092e
Add more duplicate account tests (#15746) 2021-03-05 20:36:27 -08:00
dependabot-buildkite ee621878b0 [auto-commit] Update all Cargo lock files 2021-03-05 09:06:36 -08:00
Jack May fb3837260c
Add BPf loader finalize test via inner instruction (#15708) 2021-03-04 20:34:36 +00:00
Jack May b53cb8eb2d
Deprecate Instruction::new (#15695) 2021-03-04 05:46:48 +00:00
Jeff Washington (jwash) be35c1c1b7
add execute detail timings (#15638) 2021-03-03 17:07:45 -06:00
Yang Hau 6acb06f8d8
refactor: Use UINT64_MAX to replace hardcoded number (#15676) 2021-03-03 17:16:18 +00:00
Jack May d73af9c1dd
cli: don't overallocate upgradeable buffer accounts (#15603) 2021-03-02 00:45:53 -08:00
Tyera Eulberg acf5e4e219
Update Cargo.lock 2021-03-02 00:53:14 -07:00
Jack May 3cd00965a7
Enable BPF program instruction traces (#15613) 2021-03-01 23:11:58 -08:00
Trent Nelson ef63ffce7d Bump ed25519-dalek to 1.0.1 2021-03-01 21:10:46 +00:00
sakridge 8399851d11
check program owners (#15495)
* check program owners

* BankSlotDelta should change because InstructionError variant added

Co-authored-by: Tyera Eulberg <tyera@solana.com>
2021-02-26 22:21:34 +00:00
Tyera Eulberg d521dfe63c
Implement OutputFormat for confirm in Cli and ledger-tool bigtable (#15528)
* Add CliTransaction struct

* Impl DisplayFormat for decode-transaction

* Add block-time to transaction println, writeln

* Impl DisplayFormat for confirm

* Use DisplayFormat in ledger-tool bigtable confirm
2021-02-25 14:15:52 -07:00
Jon Cinque ebd43938a7
docs: Update stake merging documentation (#15489)
* Update stake merging documentation

* Integrate review feedback

* Integrate review feedback in comment too
2021-02-25 17:24:39 +01:00
Tyera Eulberg eddb7f98f5
Check vote account initialization (#15503)
* Check account data_len on Vote account init

* Check account data populated on update_cached_accounts
2021-02-24 10:00:48 -07:00
Jack May cf4e31964b
Remove limit on program size related to feature cleanup (#15493) 2021-02-23 20:54:18 +00:00
Michael Vines 8680a46458 Transition config program over to ic_msg() logging 2021-02-22 20:19:04 -08:00
Michael Vines 5df36aec7d Pacify clippy 2021-02-19 20:08:41 -08:00
Justin Starry 15bbe6436d
Bump SPL token version to v3.1.0 (#15429)
* Bump SPL token version to v3.1.0

* Cargo.lock
2021-02-19 09:15:41 +00:00
Jack May 48785b507b
Bump Rust-BPF to v1.46 (#15273) 2021-02-18 11:30:08 -08:00
Jack May 02432a548f
Cleanup old features (#15391) 2021-02-18 09:56:11 -08:00
Jon Cinque 0f6f6080f3
sdk: Add Borsh support for types and utilities (#15290)
* sdk: Add Borsh to Pubkey

* Add serialization error for easier borsh integration

* Add Borsh usage to banks-client and sdk

* Rename SerializationError -> IOError

* Add new errors to proto

* Update Cargo lock

* Update Cargo.lock based on CI

* Clippy

* Update ABI on bank

* Address review feedback

* Update sanity program instruction count test
2021-02-18 11:14:56 +01:00
Trent Nelson 7f7370c306 Re-allow clippy::integer_arithmetic at crate-level 2021-02-17 13:55:08 -07:00
Michael Vines 9ba69a7381 Adapt to fs_extra 1.2.0 2021-02-17 12:44:58 -08:00
Jon Cinque 3ac7e09de6
docs: Remove references to "create_address_with_seed" (#15339) 2021-02-17 14:25:02 +01:00
Tyera Eulberg 51c27dcc1c
Clean & check stake (#15363)
* Add failing test

* Fix test

* Clean up redendant if case

* Demonstrate withdrawal boundaries

* Update test to fail on conditions that should be acceptable

* Fix test

* Add test for larger stake source

* Mirror changes for undelegated accounts

* Extra stake checks

* Split accounts must be the right size

Co-authored-by: Stephen Akridge <sakridge@gmail.com>
2021-02-17 03:42:46 +00:00
Tyera Eulberg 7e17a0d3bb Move fn to sdk 2021-02-16 19:25:00 -08:00
Stephen Akridge f929301c60 Vote program updates 2021-02-16 18:59:15 -08:00
Trent Nelson b3256aa722 Bump rand_core to 0.6.2
https://rustsec.org/advisories/RUSTSEC-2021-0023
2021-02-15 22:51:35 +00:00
Trent Nelson ae82b5ebfd stake: add lamports overflow test for withdraw 2021-02-15 11:09:51 -07:00
Alexander Meißner b43d2bc882
rbpf-v0.2.5 (#15334) 2021-02-15 18:27:41 +01:00
sakridge 08f94a2bd2
Stake program update (#15307) 2021-02-12 17:24:43 -08:00
Ryo Onodera 4e99aa5fa6
More failure codepath tracing (#15246) 2021-02-12 15:24:23 +09:00
Jack May 6650fbf443
Add per-byte logging cost (#15279) 2021-02-12 00:55:17 +00:00
Ryo Onodera ab0f4c69aa
Improve vote-account for logical flow/reasoning (#15237)
* Improve vote-account for logical flow/reasoning

* Clean up

* Update messages
2021-02-11 21:24:20 +09:00
Jack May 10abd199e1
Match BPF instruction reporting to dump file (#15254) 2021-02-11 00:48:19 +00:00
Michael Vines 47578895e1
Increment hyper versions to pacify cargo audit (#15171) 2021-02-05 23:14:05 -08:00
Michael Vines dc7041ba07
Require lockup authority to change withdraw authority on locked stake (#14861) 2021-02-05 22:40:07 -08:00
Ryo Onodera c69027e5aa
chore: bump serde from 1.0.118 to 1.0.122 (#15126)
* chore: bump serde from 1.0.118 to 1.0.122

* Update programs/bpf/Cargo.lock
2021-02-05 19:23:24 +09:00
Tyera Eulberg d1563f0ccd
Bump tonic, prost, tarpc, tokio (#15013)
* Update tonic & prost, and regenerate proto

* Reignore doc code

* Revert pull #14367, but pin tokio to v0.2 for jsonrpc

* Bump backoff and goauth -> and therefore tokio

* Bump tokio in faucet, net-utils

* Bump remaining tokio, plus tarpc
2021-02-05 00:21:53 -07:00
Mrmaxmeier ebbaa1f8ea
Fix integer overflow in degenerate invoke_signed BPF syscalls (#15051) 2021-02-03 13:32:38 -08:00
Jack May 02a5f7104a
Fix which shared object the test uses (#15060) 2021-02-03 13:31:55 -08:00
Jack May d24d5fba0e
Upgradeable loader max_data_len limit (#15039) 2021-02-03 09:16:25 -08:00
Tyera Eulberg 98aa1fa4ea
Upgrade jsonrpc crates to v17.0.0 (#15018)
* Upgrade to jsonrpc 17.0.0

* Fix test

* tree

Co-authored-by: Michael Vines <mvines@gmail.com>
2021-02-02 19:53:08 -07:00
Trent Nelson a2aea0ca33 cli-output: Add option sigverify status to `println_transaction()` output 2021-02-02 18:44:22 +00:00
dependabot[bot] 1df93fa2be
chore: bump serde from 1.0.112 to 1.0.118 (#14828)
* chore: bump serde from 1.0.112 to 1.0.122

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.112 to 1.0.122.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.112...v1.0.122)

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

* [auto-commit] Update all Cargo lock files

* Update frozen_abi digest following serde update

* Revert "chore: bump serde from 1.0.112 to 1.0.122"

This reverts commit a3ef4442a4c985144ae2bd7ceaf8899a7ab8d7c0.

* Revert "[auto-commit] Update all Cargo lock files"

This reverts commit c41c3b005fb1ccade55155302c52cd5736c4b55f.

* chore: bump serde from 1.0.112 to 1.0.118

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.112 to 1.0.118.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.112...v1.0.118)

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

* [auto-commit] Update all Cargo lock files

* Remove serum-dex pinning

* blind commit!

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-02-02 23:28:16 +09:00
Tyera Eulberg 34dfcc9c6f
Parse SPL Memo v3 (#14979)
* Parse memo v3 too

* tree
2021-02-02 04:02:57 +00:00
Jack May 73d9186502
More rich runtime logging (#14938) 2021-02-01 11:40:49 -08:00
Jack May 07cef5a557
Buffer authority must match upgrade authority for deploys and upgrades (#14923) 2021-01-29 12:43:42 -08:00
Alexander Meißner d026da4a1b
Ignore syscalls which are not registered in cached rbpf executable. (#14898) 2021-01-29 12:30:10 +01:00
Jack May 0b1015f7d3
Richer runtime failure logging (#14875) 2021-01-28 10:04:54 -08:00
Jack May 2ca0872a98
nit: message doesn't represent (#14893) 2021-01-27 17:21:45 -08:00
Jack May 63429507b2
Add syscall feature activation test (#14890) 2021-01-27 17:21:25 -08:00
Alexander Meißner 7686b70381
Bumps RBPF to v0.2.4 (#14865) 2021-01-26 14:45:03 -08:00
Michael Vines ff22091a98 Add StakeInstruction::Merge logging 2021-01-26 11:52:39 -08:00
Michael Vines 119e2c75dd cli now supports a custodian for stake authorize operations 2021-01-26 11:48:28 -08:00
Jack May e57b9c3b02
Add more upgradeable tests (#14846) 2021-01-25 21:04:59 -08:00
Michael Vines 8359f4f5ff Include Clock sysvar in AuthorizeWithSeed instruction 2021-01-25 19:38:10 -08:00
Michael Vines 2b50433099 Remove legacy_stake program 2021-01-25 19:34:40 -08:00
sakridge 191193289f
Upgrade sha2 to 0.9.3 (#14746) 2021-01-22 22:25:22 -08:00
Jack May 77572a7c53
Track account writable deescalation (#14626) 2021-01-22 15:28:01 -08:00
Michael Vines 3c6dbd21d2 Add ic_msg()/ic_logger_msg() macros 2021-01-21 21:41:33 +00:00
behzad nouri d52c94a366
adds missing block_time field (#14743) 2021-01-21 18:29:48 +00:00
behzad nouri 8e581601d6
patches crds vote-index assignment bug (#14438)
If tower is full, old votes are evicted from the front of the deque:
https://github.com/solana-labs/solana/blob/2074e407c/programs/vote/src/vote_state/mod.rs#L367-L373
whereas recent votes if expire are evicted from the back:
https://github.com/solana-labs/solana/blob/2074e407c/programs/vote/src/vote_state/mod.rs#L529-L537

As a result, from a single tower_index scalar, we cannot infer which crds-vote
should be overwritten:
https://github.com/solana-labs/solana/blob/2074e407c/core/src/crds_value.rs#L576

In addition there is an off by one bug in the existing code. tower_index is
bounded by MAX_LOCKOUT_HISTORY - 1:
https://github.com/solana-labs/solana/blob/2074e407c/core/src/consensus.rs#L382
So, it is at most 30, whereas MAX_VOTES is 32:
https://github.com/solana-labs/solana/blob/2074e407c/core/src/crds_value.rs#L29
Which means that this branch is never taken:
https://github.com/solana-labs/solana/blob/2074e407c/core/src/crds_value.rs#L590-L593
so crds table alwasys keeps 29 **oldest** votes by wallclock, and then
only overrides the 30st one each time. (i.e a tally of only two most
recent votes).
2021-01-21 13:08:07 +00:00
Jack May aa96ad042b
Add signer/writable de/escalation tests (#14726) 2021-01-21 09:19:46 +00:00
carllin 2745b79b74
Parallel cache scan (#14544)
* Parallel cache scan

* PR comments

* PR comments

Co-authored-by: Carl Lin <carl@solana.com>
2021-01-20 08:50:17 +00:00
Jack May a480b63234
Bail on small deploy buffers (#14677) 2021-01-20 01:56:44 +00:00
Jack May e3bd9e5300
Prevent the invoke and upgrade of programs in the same tx batch (#14653)
* Prevent the invoke and upgrade of programs in the same tx batch

* Pass program address as writable in the upgrade instruction
2021-01-19 16:24:44 -08:00
dependabot[bot] 4ecc0f4fa6
chore: bump rayon from 1.4.1 to 1.5.0 (#14177)
* chore: bump rayon from 1.4.1 to 1.5.0

Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.4.1 to 1.5.0.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.4.1...rayon-core-v1.5.0)

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

* [auto-commit] Update all Cargo lock files

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <dependabot-buildkite@noreply.solana.com>
2021-01-15 18:07:35 +09:00
sakridge 907f518f6d
Add load/execute/store timings (#14561) 2021-01-14 14:14:16 -08:00
Jack May 6e8a1ba7de
Load executable accounts from invoke context (#14574) 2021-01-14 00:19:22 -08:00
Alexander Meißner 0d26cb6d37 Bump RBPF version to v0.2.3 2021-01-11 21:29:00 -08:00
Jack May ec48631fc5
Bail on all CPI errors (#14500)
* Bail on all CPI errors

* whitespace
2021-01-09 02:27:39 +00:00
Jack May 9d53eca6e3
Report correct program id (#14486) 2021-01-08 14:43:24 -08:00
Michael Vines 21a0a83543 Bump smallvec version 2021-01-08 20:20:34 +00:00
Jack May 58487c6360
Add buffer authority to upgradeable loader (#14482) 2021-01-08 09:37:57 -08:00
Jack May 5eacc5d08d
Enable program upgrades via CPI (#14449) 2021-01-06 14:31:14 -08:00
Jack May a8b5a32b50
Gate cpi program account passing (#14443) 2021-01-05 21:53:41 +00:00
Jack May 0619805806
Upgradeable programs needs program account's address as program id (#14417) 2021-01-04 21:45:05 +00:00
Jack May 2d8dacb72b
Gate CPI authorized programs (#14361) 2020-12-30 18:13:37 -08:00
Jack May 1c5427ff17
Remove assert (#14356) 2020-12-30 21:07:22 +00:00
Jack May 6c6095abe7
nit: clarify loader id (#14355) 2020-12-30 20:02:29 +00:00
Jack May 5524938a50
Limit CPI instruction size (#14317) 2020-12-29 01:14:17 +00:00
Jack May ee0a80a092
Prevent bpf loader impersonators (#14278) 2020-12-24 03:04:48 +00:00
Jack May b1d702a618
Don't use caller passed executable account (#14276) 2020-12-23 14:34:14 -08:00