Commit Graph

948 Commits

Author SHA1 Message Date
Michael Vines 9c53e1dfb2 Add SyscallStubs to enable syscall interception when building programs for non-BPF 2020-10-19 21:00:17 +00:00
Ryo Onodera 54517ea454
Follow up to persistent tower with tests and API cleaning (#12350)
* Follow up to persistent tower

* Ignore for now...

* Hard-code validator identities for easy reasoning

* Add a test for opt. conf violation without tower

* Fix compile with rust < 1.47

* Remove unused method

* More move of assert tweak to the asser pr

* Add comments

* Clean up

* Clean the test addressing various review comments

* Clean up a bit
2020-10-19 16:37:03 +09:00
Jack May 3f9e6a600b
program log pubkey as base58 (#12901) 2020-10-15 09:11:54 -07:00
Jack May 969f7b015b
Respect RefCell when calling invoke (#12858)
* Respect RefCell when calling invoke

* nudge
2020-10-15 01:06:41 +00:00
Jack May d4e953277e
Expose program error constants (#12861) 2020-10-14 00:38:08 -07:00
Jack May 56211378d3
terminology update, nonce to bump seed (#12840) 2020-10-13 10:11:08 -07:00
Eric Williams 1ab36203de
Retry inflation parameter update along with documentation updates (#12778)
* update initial inflation parameter

* update economics section of docs
2020-10-12 13:10:57 -07:00
Michael Vines 403790760c Default to 50% rent burn 2020-10-09 21:52:31 -07:00
Jack May 9ac8db3533
document program address collisions (#12774) 2020-10-09 23:19:41 +00:00
Tyera Eulberg b028c47d2b
Correct Bank timestamp drift every slot (#12737)
* Move timestamp helper to sdk

* Add Bank method for getting timestamp estimate

* Return sysvar info from Bank::clock

* Add feature-gated timestamp correction

* Rename unix_timestamp method to be more descriptive

* Review comments

* Add timestamp metric
2020-10-09 21:53:41 +00:00
carllin c879e7c1ad
Fix fee mismatch on snapshot deserialize (#12697)
Co-authored-by: Carl Lin <carl@solana.com>
2020-10-08 23:44:41 -07:00
Michael Vines 11df2e2236 Bump version to v1.5.0 2020-10-08 04:51:36 +00:00
Michael Vines 2c38865e70 Revert "Inflation cli fix and parameter update (#12709)"
This reverts commit b3f695c83f.
2020-10-07 19:43:15 -07:00
Jack May dd7fae4afb
Fix syscall featurization (#12714)
* Fix syscall featurization

* nudge
2020-10-07 18:38:38 -07:00
Eric Williams b3f695c83f
Inflation cli fix and parameter update (#12709)
update initial inflation parameter to reflect current design
2020-10-07 17:12:32 -07:00
Jack May 41ad3dd8f0
Remove skip-no-mangle entirely (#12696) 2020-10-07 09:13:48 -07:00
Jack May 630eb3b907
Local program allocator (#12679) 2020-10-06 11:03:51 -07:00
Jack May bff3825298
Remove unnecessary skip-no-mangle feature from sdk (#12684) 2020-10-06 11:03:29 -07:00
Tyera Eulberg 865d01c38d
Fix TransactionStatusMeta breakage in blockstore (#12587)
* Add helper to facilitate deserializing legacy structs

* Use default_on_eof to fix blockstore vis-a-vis TransactionStatusMeta

* Add should-panic test and comments
2020-09-30 11:49:35 -06:00
Jack May 058bca6632
add sha256 syscall (#12569) 2020-09-29 23:29:20 -07:00
Trent Nelson 3c7b9c2938 Move remaining nonce utils from runtime to SDK 2020-09-30 05:45:42 +00:00
Trent Nelson 65b868f4eb Move nonced tx helpers to SDK 2020-09-30 05:45:42 +00:00
Jack May 2ff983647f
Move process_instruction defs to runtime (#12507) 2020-09-29 01:36:46 -07:00
Michael Vines aa5c008fa8 Add pico-inflation feature 2020-09-28 08:25:00 -07:00
Michael Vines c10da16d7b Port instructions sysvar and secp256k1 program activation to FeatureSet 2020-09-25 11:40:36 -07:00
Jack May b8c4b88188
Cleanup names, fix line dependent test (#12477) 2020-09-25 09:00:06 -07:00
Trent Nelson 07dfa37cce Add `Signers` impl for `Vec<Box<dyn Signer>>` 2020-09-25 07:12:04 +00:00
behzad nouri bb183938d9
adds an atomic variant of the bloom filter (#12422)
For crds_gossip_pull, we want to parallelize build_crds_filters, which
requires concurrent writes to bloom filters.

This commit implements a variant of the bloom filter which uses atomics
for its bits vector and so is thread-safe.
2020-09-24 18:37:19 +00:00
Justin Starry 6601ec8f26
Record and store invoked instructions in transaction meta (#12311)
* Record invoked instructions and store in transaction meta

* Enable cpi recording if transaction sender is some

* Rename invoked to innerInstructions
2020-09-24 22:36:22 +08:00
Jack May 65049bd112
Bump rust-bpf to v0.2.4 (#12361) 2020-09-20 23:10:50 +00:00
sakridge 22d8b3c3f8
Cleanup and feature gate instruction processing (#12359) 2020-09-20 10:58:12 -07:00
sakridge f561eb917f
Add way to look at tx instructions (#11943) 2020-09-19 12:17:46 -07:00
Ryo Onodera cb8661bd49
Persistent tower (#10718)
* Save/restore Tower

* Avoid unwrap()

* Rebase cleanups

* Forcibly pass test

* Correct reconcilation of votes after validator resume

* d b g

* Add more tests

* fsync and fix test

* Add test

* Fix fmt

* Debug

* Fix tests...

* save

* Clarify error message and code cleaning around it

* Move most of code out of tower save hot codepath

* Proper comment for the lack of fsync on tower

* Clean up

* Clean up

* Simpler type alias

* Manage tower-restored ancestor slots without banks

* Add comment

* Extract long code blocks...

* Add comment

* Simplify returned tuple...

* Tweak too aggresive log

* Fix typo...

* Add test

* Update comment

* Improve test to require non-empty stray restored slots

* Measure tower save and dump all tower contents

* Log adjust and add threshold related assertions

* cleanup adjust

* Properly lower stray restored slots priority...

* Rust fmt

* Fix test....

* Clarify comments a bit and add TowerError::TooNew

* Further clean-up arround TowerError

* Truly create ancestors by excluding last vote slot

* Add comment for stray_restored_slots

* Add comment for stray_restored_slots

* Use BTreeSet

* Consider root_slot into post-replay adjustment

* Tweak logging

* Add test for stray_restored_ancestors

* Reorder some code

* Better names for unit tests

* Add frozen_abi to SavedTower

* Fold long lines

* Tweak stray ancestors and too old slot history

* Re-adjust error conditon of too old slot history

* Test normal ancestors is checked before stray ones

* Fix conflict, update tests, adjust behavior a bit

* Fix test

* Address review comments

* Last touch!

* Immediately after creating cleaning pr

* Revert stray slots

* Revert comment...

* Report error as metrics

* Revert not to panic! and ignore unfixable test...

* Normalize lockouts.root_slot more strictly

* Add comments for panic! and more assertions

* Proper initialize root without vote account

* Clarify code and comments based on review feedback

* Fix rebase

* Further simplify based on assured tower root

* Reorder code for more readability

Co-authored-by: Michael Vines <mvines@gmail.com>
2020-09-19 14:03:54 +09:00
Tyera Eulberg 58542cf7f6
Add Pack and COption to sdk (#12294)
* Add COption to sdk

* Add Pack to sdk

* Except program_option from nits check

* No Default::default
2020-09-17 21:10:02 -06:00
sakridge 3930cb865a
Add keccak-secp256k1 instruction (#11839)
* Implement keccak-secp256k1 instruction

Verifies eth addreses with ecrecover function

* Move secp256k1 test
2020-09-15 18:23:21 -07:00
Jack May 5ab4109b7e
Add memory allocation support for C programs (#12254) 2020-09-15 16:42:20 -07:00
Jack May 3278d78f08
Cache re-usable work performed by the loader (#12135) 2020-09-14 17:42:37 -07:00
carllin 3c69cd6d61
Update commitment options (#12173) 2020-09-11 11:19:06 -07:00
Ryo Onodera de4a613610
Check bank capitalization (#11927)
* Check bank capitalization

* Simplify and unify capitalization calculation

* Improve and add tests

* Avoid overflow and inhibit automatic restart

* Fix test

* Tweak checked sum for cap. and add tests

* Fix broken build after merge conflicts..

* Rename to ClusterType

* Rename confusing method

* Clarify comment

* Verify cap. in rent and inflation tests

Co-authored-by: Stephen Akridge <sakridge@gmail.com>
2020-09-12 01:48:06 +09:00
Ryo Onodera 53b8ea4464
Rename to ClusterType and restore devnet compat. (#12068)
* Rename to ClusterType and restore devnet compat.

* De-duplicate parse code and add comments

* Adjust default Devnet genesis & reduce it in tests
2020-09-08 23:55:09 +09:00
Ryo Onodera 89bca6110a
Clarify comments and names in inflation code (#11977) 2020-09-03 14:15:12 +09:00
Michael Vines 29cfbce21d Revert "Remove ::solana_sdk hack (#11326)"
This reverts commit c099b29b36.
2020-09-02 15:24:38 -07:00
carllin af08221aec
Switch account hashing to blake3 (#11969)
* Switch account hashing to blake3

Co-authored-by: Carl <carl@solana.com>
2020-09-02 00:37:36 -07:00
Jack May 0ed360b5e5
fix program test stubs (#11956)
* fix program tset stubs

* nudge
2020-08-31 21:48:16 -07:00
Jack May ae0fd3043a
Add support for deprecated loader (#11946) 2020-08-31 14:06:58 -07:00
Jon Cinque 8c43a3da32 Update nofile flag in Docker to run Solana
Currently, the Solana Docker container does not start because it
requires `nofile` to be at least 500000, and the default behavior is
1024.

This fixes the documentation and running script to properly set the ulimit to
500000.
2020-08-28 16:49:28 -07:00
Jack May ea179ad762
Bump compute budget (#11864)
* Bump compute budget

* nudge
2020-08-26 21:48:51 +00:00
Jack May db4bbb3569
Switch programs activation to whole-set based gating (#11750)
* Implement Debug for MessageProcessor

* Switch from delta-based gating to whole-set gating

* Remove dbg!

* Fix clippy

* Clippy

* Add test

* add loader to stable operating mode at proper epoch

* refresh_programs_and_inflation after ancestor setup

* Callback via snapshot; avoid account re-add; Debug

* Fix test

* Fix test and fix the past history

* Make callback management stricter and cleaner

* Fix test

* Test overwrite and frozen for native programs

* Test epoch callback with genesis-programs

* Add assertions for parent bank

* Add tests and some minor cleaning

* Remove unsteady assertion...

* Fix test...

* Fix DOS

* Skip ensuring account by dual (whole/delta) gating

* Fix frozen abi implementation...

* Move compute budget constatnt init back into bank

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2020-08-26 01:49:15 +09:00
Jon Cinque 9a366281d3
sdk: Make PubKey::create_program_address available in program unit tests (#11745)
* sdk: Make PubKey::create_program_address available in program unit tests

This finishes the work started in #11604 to have
`create_program_address` available when `target_arch` is not `bpf` and
`program` is enabled.  Otherwise, there is an undefined reference error
to `sol_create_program_address`, which is only defined in `bpf`.

A small test to simply call the function has been added in order to catch
the problem in the future.

The default dependency to `solana-sdk/default` doesn't cause a problem with
existing programs since `build.sh` always specifies
`--no-default-features`, and programs in `solana-program-library` all
use it too.

* Add `default-features = false` for inter-program dependencies

Fix the build error found during CI.  The `--no-default-features` flag
only applies to the top-level package, and not to dependencies.  A program that
depends on another program, i.e. `128bit` which depends on `128bit_dep`,
must specify `default-features = false` when including that package,
otherwise the `bpf` build will try to pull in default packages, which
includes `std`.
2020-08-24 19:28:36 +02:00
Jack May 8d362f682b
The constraints on compute power a program can consume is limited only to its instruction count (#11717) 2020-08-21 15:31:19 -07:00