behzad nouri
4f22ee8f9b
uses varint encoding for vote-state lockout offsets
...
The commit removes CompactVoteStateUpdate and instead reduces serialized
size of VoteStateUpdate using varint encoding for vote-state lockout
offsets.
2022-09-12 16:31:20 +00:00
behzad nouri
f6fbc47b2d
adds serde varint encoder/decoder
...
#[derive(Deserialize, Serialize)]
struct Foo {
#[serde(with = "serde_varint")]
field: u64,
...
}
2022-09-12 16:31:20 +00:00
Brian Anderson
28f979b5a5
Fix solana_program::vote docs ( #27621 )
2022-09-07 13:05:52 -06:00
Alexander Meißner
0367c1a60c
Feature: `SyscallSetAccountProperties` ( #27444 )
...
* Adds TransactionContextAttribute.
* Adds SyscallSetAccountProperties.
* Adds AccountPropertyUpdate factory methods to BorrowedAccount.
* Categorizes syscalls exclusive to ABIv0/v1 and ABIv2.
2022-09-02 12:42:06 +02:00
Brian Anderson
dce99f1d0d
Fix broken macro doc links ( #27125 )
...
These don't resolve correctly in Rust 1.63.
2022-09-01 21:14:25 +00:00
Brooks Prumo
757e46c3c7
Set cap for new allocations per transaction ( #27385 )
2022-08-29 14:30:48 -04:00
Yihau Chen
a19b5c1536
chore: allow test_is_writable_account_cache ignore clippy::get_first ( #27414 )
2022-08-26 15:33:25 +08:00
Tao Zhu
5e71f339c9
Add a SanitizedMessage type that caches writable accounts indexes ( #27317 )
...
* Add a SanitizedMessage type that caches writable accounts indexes
* Add is_writable_account_cache to both SanitizedMessage variants, cache is initialized in constructors
2022-08-25 16:33:41 -05:00
Tyera Eulberg
1095cdf436
Fixup docs in sdk to use new clients ( #27362 )
...
Fixup client docs in sdk
2022-08-24 21:29:56 -06:00
Ashwin Sekar
efa6201eda
Check overflow on vote tx compaction boundary ( #27185 )
...
* Check overflow on vote tx compaction boundary
Check for overflow during the conversion between VoteStateUpdate and
CompactVoteStateUpdate.
* Try removing clippy supress
2022-08-23 22:29:03 -07:00
Brennan Watt
e4a7d01e10
Rust v1.63 ( #27303 )
...
* Upgrade to Rust v1.63.0
* Add nightly_clippy_allows
* Resolve some new clippy nightly lints
* Increase QUIC packets completion timeout
* Update quinn-udp crate
Co-authored-by: Michael Vines <mvines@gmail.com>
2022-08-22 18:01:03 -07:00
Brennan Watt
7573000d87
Revert "Rust v1.63.0 ( #27148 )" ( #27245 )
...
This reverts commit a2e7bdf50a
.
2022-08-19 09:19:44 +01:00
Brennan Watt
a2e7bdf50a
Rust v1.63.0 ( #27148 )
...
* Upgrade to Rust v1.63.0
* Add nightly_clippy_allows
* Resolve some new clippy nightly lints
* Increase QUIC packets completion timeout
Co-authored-by: Michael Vines <mvines@gmail.com>
2022-08-17 15:48:33 -07:00
Brian Anderson
b6762fc2f9
Add more sysvar API docs ( #26849 )
...
* Add more sysvar API docs
* Remove println from examples
* Update sdk/program/src/clock.rs
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Update sdk/program/src/clock.rs
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Update sdk/program/src/clock.rs
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Update sdk/program/src/clock.rs
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Update sdk/program/src/clock.rs
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Update sdk/program/src/clock.rs
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Update sdk/program/src/clock.rs
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Update sdk/program/src/clock.rs
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Fix docs for ACCOUNT_STORAGE_OVERHEAD
* Update sdk/program/src/epoch_schedule.rs
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Update sdk/program/src/sysvar/slot_hashes.rs
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Update sdk/program/src/sysvar/slot_history.rs
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Update sdk/program/src/sysvar/slot_history.rs
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Update sdk/program/src/sysvar/mod.rs
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Fix docs for DEFAULT_LEADER_SCHEDULE_SLOT_OFFSET
* Fix recent_blockhash short description
* Fix whitespace
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2022-08-15 12:19:46 -06:00
Michael Vines
ccfbc54195
Move vote program state and instructions to solana-program
2022-08-09 20:52:47 -07:00
Brian Anderson
ebe25fdb56
Add API docs for secp256k1_instruction and secp256k1_recover ( #26065 )
...
* Add API docs for secp256k1_instruction and secp256k1_recover
* typo
* Remove unused variable from secp256k1 program test
* Bump solana_bpf_rust_secp256k1_recover ix count
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2022-08-08 16:22:10 -06:00
Richard Patel
a9a3c62907
Fix sol_get_processed_sibling_instruction on 32-bit hosts ( #26522 )
2022-08-05 12:06:03 -07:00
Brian Anderson
a69ee79111
Delete unused create_test_recent_blockhashes
2022-08-02 01:28:23 -06:00
Michael Vines
48862c575a
Add StakeInstruction::Redelegate
2022-07-27 20:24:25 -06:00
Justin Starry
2335f6908a
Loosen CPI restrictions and charge compute for ix data len ( #26653 )
...
* Loosen CPI restrictions and charge compute for ix data len
* Address feedback
* use explicit casting
* more feedback
2022-07-24 20:20:16 +02:00
Justin Starry
f8e9af5f1e
Cap the number of accounts passed to a bpf program ix ( #26630 )
...
* Cap the number of accounts passed to a bpf program ix
* update bank abi hash
* fix ci failures
2022-07-20 14:12:43 +02:00
Justin Starry
3fc161bea4
Fix flaky message kitchen sink test ( #26624 )
2022-07-14 18:39:57 +01:00
Justin Starry
8e8c6e60ff
Allow extending upgradeable program data account length ( #26386 )
...
* Allow extending upgradeable program data account length
* Add is_writable check
* Fix cargo version
* System program fix, comment, and test
* Switch to u32 for serialized bytes value in ix
2022-07-11 22:46:32 +01:00
Justin Starry
eb6a722eba
Clean up `nonce_must_be_writable` feature ( #26444 )
...
Clean up nonce_must_be_writable feature
2022-07-07 15:45:19 +01:00
behzad nouri
6f5857a5db
removes feature gate code separating durable nonce from blockhash domain ( #26055 )
2022-07-06 12:03:13 +00:00
samkim-crypto
24c6f820ce
remove elgamal syscall operations ( #26311 )
...
resolve conflict
2022-06-30 16:27:48 +09:00
Justin Starry
f44fcd1880
Detect and reject invalid AccountInfo reallocations
2022-06-29 09:15:59 +01:00
behzad nouri
2efdb965dd
encapsulates AuthorizeNonceAccount implementation in the nonce module ( #26202 )
...
Follow up commit removes feature gate code separating durable nonce from
blockhash domain. This commit allows to encapsulate any logic
distinguishing legacy vs current nonce versions in the nonce module
after removing the feature gate.
2022-06-25 12:17:39 +00:00
Michael Vines
f3639b76ce
Remove some clippy lints
2022-06-22 09:23:22 -07:00
apfitzge
4940d530b8
Add static vector to get sdk ids ( #25907 )
...
* Add function to get all sdk program ids
* program_ids: use lazy_static instead of a function
* program_ids -> sdk_ids
2022-06-13 13:07:18 -05:00
samkim-crypto
697a69cbe8
Add syscall tests for curve25519 ( #25634 )
...
* add curve25519 syscall tests
* add curve25519 syscall feature set description
* fmt
* rename curve25519 group syscall
* update point to scalar
* resolve conflict
2022-06-12 10:18:51 +09:00
behzad nouri
b4190319a1
feat(nonce): adds system instruction to upgrade legacy nonce versions ( #25789 )
...
https://github.com/solana-labs/solana/pull/25788
permanently disables durable transactions with legacy nonce versions
which are within chain blockhash domain.
This commit adds a new system instruction for a one-time idempotent
upgrade of legacy nonce accounts in order to bump them out of chain
blockhash domain.
2022-06-10 00:04:29 +00:00
behzad nouri
3c1ce3cc93
permanently disables durable nonces with chain blockhash domain ( #25788 )
...
https://github.com/solana-labs/solana/pull/25744
separated durable nonce and blockhash domains, which will stop double
execution going forward. However it is possible that a durable
transaction has *already* been executed once as a normal transaction and
it is now a valid durable transaction. #25744 cannot stop such
transactions to be re-executed until the nonce accounts are advanced.
This commit adds a new nonce version indicating that the nonce is moved
out of the blockhash domain, and permanently disables durable
transactions for legacy nonces which are in the blockhash domain.
2022-06-09 15:28:37 +00:00
Justin Starry
b2b426d4bf
Reject durable nonce transactions not signed by authority ( #25831 )
2022-06-08 14:43:09 -05:00
Ashwin Sekar
8caced68ce
Serialize lamports per signature ( #25364 )
...
* Serialize lamports per signature
* Add full snapshot archive test, enable features in previous tests
2022-06-06 13:07:02 -07:00
behzad nouri
5ee157f43d
separates durable nonce and blockhash domains
...
AdvanceNonceAccount instruction updates nonce to blockhash. This makes it
possible that a durable transaction is executed twice both as a normal
transaction and a nonce transaction if it uses blockhash (as opposed to nonce)
for its recent_blockhash field.
The commit prevents this double execution by separating nonce and blockhash
domains; when advancing nonce account, blockhash is hashed with a fixed string.
As a result a blockhash cannot be a valid nonce value; and if transaction was
once executed as a normal transaction it cannot be re-executed as a durable
transaction again and vice-versa.
2022-06-04 12:39:31 +00:00
Brooks Prumo
0b2d5291f8
Add new error if stake delegation is below the minimum ( #25709 )
2022-06-01 20:29:57 -05:00
Brian Anderson
897e97a305
Add docs to solana_program::program ( #25352 )
2022-05-31 10:10:40 -07:00
Alessandro Decina
2c8a3f39a6
Consolidate syscalls under solana_program::syscalls, implement static syscalls (sbfv2) ( #24188 )
...
Move all syscall declarations under solana_program::syscalls. If the target
supports static syscalls (sbfv2), then actually define them statically to avoid
dynamic relocations.
2022-05-26 23:01:55 +10:00
HaoranYi
be630a5213
typo ( #25479 )
2022-05-23 18:42:43 +00:00
Michael Vines
b05c7d91ed
Fix derive_partial_eq_without_eq clippy lint
2022-05-22 22:22:21 -07:00
Justin Starry
10d677a092
Fix flakey v0::Message::test_try_compile test ( #25438 )
2022-05-21 20:49:07 +08:00
Dmitri Makarov
569b00025c
fix: replace rust cfg annotations that use bpf by target_os solana
2022-05-18 20:39:43 -07:00
Jack May
21e066ef26
Merge pull request from GHSA-wxrh-ff9f-fc6w
2022-05-16 12:30:37 -07:00
Justin Starry
6c10515ccf
Revert "Serialize lamports per signature in snapshots ( #25181 )" ( #25228 )
...
This reverts commit 35d2a0fd69
.
2022-05-15 12:04:17 +00:00
Ashwin Sekar
35d2a0fd69
Serialize lamports per signature in snapshots ( #25181 )
...
* Serialize lamports per signature
* pr comments
2022-05-14 10:57:51 -07:00
Justin Starry
d8a8393994
Don't extract invoked keys from a message when using a lookup table ( #25065 )
...
* Refactor message compiled keys
* Prohibit invoked keys from being extracted by lookup table
2022-05-13 10:32:10 +08:00
Justin Starry
68800982ea
Add size_of const fns for upgradeable loader states ( #25131 )
2022-05-11 22:22:59 +08:00
Justin Starry
e3bdc38f0a
Add sanitized types for use in banking stage ( #25067 )
2022-05-11 00:30:48 +08:00
Jason
c80896b58f
speedup sysvar or builtin test ( #25047 )
...
* Add a quick lookup table to speed up sysvar/builtin key check
* Fix up the syntax
* Fix syntax
* Fix syntax 2
* Rename the static variable, improve commenting
* Fix merge error
* Fixed two clippy suggestions
* Improved commenting
2022-05-10 10:37:51 -05:00