Commit Graph

701 Commits

Author SHA1 Message Date
Rob Walker 777ae3c215
Add time since genesis to sysvar::clock (#7289)
* genesis timestamp

* remove clock::create_account()

* ..

* add configure-able creation time

* dividing by 1T, should be dividing by 1B
2019-12-12 14:03:43 -08:00
Rob Walker ea0ba19089
Add SystemInstruction::CreateAccountWithSeed (#7390)
* address generator

* coverage

* fixups

* remove ascii restriction

* illustrate that utf-8 doesn't expand the space
2019-12-12 11:12:09 -08:00
Ryo Onodera a1ab81a896
Include rent_epoch and executable into account hash (#7415)
* Clean a bit

* Add rent_epoch and executable into account hashing

* Remove comment and instead create an issue
2019-12-12 13:03:33 +09:00
sakridge 0aa4dc904e
Accounts index updates, remove pubkey when dead account (#7408) 2019-12-11 11:11:31 -08:00
Parth feeb1cb566
distribute leftover lamports (#7396)
* distribute leftover lamports

* add test scenario

* fix naming
2019-12-11 02:41:08 +05:30
dependabot-preview[bot] 6f457292ff Bump bincode from 1.2.0 to 1.2.1
Bumps [bincode](https://github.com/servo/bincode) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/servo/bincode/releases)
- [Commits](https://github.com/servo/bincode/compare/v1.2.0...v1.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-10 10:00:56 -07:00
Parth 696cb298ab
put limit on account data length (#7320)
* put limit on account data length

* proper debug message
2019-12-10 22:17:11 +05:30
Rob Walker 39cd6dff7d
turn on rent (#7368)
* turn on rent

* add rent exempt balances for bootstrap accounts

* use Rent::free() when not testing rent
2019-12-09 21:56:43 -08:00
Trent Nelson 5d2b27d916 Address post-merge review for #7353 (#7378)
automerge
2019-12-09 12:54:10 -08:00
Justin Starry 43e608af47
Expose stake delegations from bank for winner tool (#7354)
* Expose stake delegations from bank

* cargo fmt

* Add test
2019-12-08 20:52:01 -08:00
Trent Nelson 059e631f41
Durable Nonce: Re-introduce Initialize instruction (#7353)
Toward an Authorized Noncer
2019-12-08 10:16:55 -07:00
dependabot-preview[bot] 891767c6b7 Bump serde_json from 1.0.42 to 1.0.44
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.42 to 1.0.44.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.42...v1.0.44)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-08 09:43:24 -07:00
Trent Nelson 1ffd6b4b4d
Add program and runtime support for Durable Transaction Nonces (#6845)
* Rework transaction processing result forwarding

Durable nonce prereq

* Add Durable Nonce program API

* Add runtime changes for Durable Nonce program

* Register Durable Nonce program

* Concise comments and bad math

* Fix c/p error

* Add rent sysvar to withdraw ix

* Remove rent exempt required balance from Meta struct

* Use the helper
2019-12-07 12:54:10 -07:00
Justin Starry b7d4330dd4
Fail fast if account paths cannot be canonicalized (#7300)
* Canonicalize account paths to avoid symlink issues

* fixes
2019-12-05 21:41:29 -05:00
sakridge cfc21e1225
Only serialize rooted append vecs (#7281) 2019-12-05 14:27:46 -08:00
Parth 0d1fed78af Pay rent to validators (#7164)
automerge
2019-12-05 06:10:34 -08:00
Jack May 9485eba73d
nudge (#7279) 2019-12-04 19:28:20 -08:00
Jack May 23c4a7dc49
nudge (#7280) 2019-12-04 19:28:00 -08:00
Jack May 9b172879a2
Remove deprecated solana_entrypoint macro (#7257) 2019-12-04 00:42:50 -08:00
Parth ba688cf629
enforce proper range for rent burn_percent (#7217)
* enforce proper range for burn_percent
2019-12-04 00:54:01 +05:30
Rob Walker d5c8b26a45
bank_leak_mac_os (#7209) 2019-12-03 00:09:05 -08:00
Rob Walker f9df17d8d0
track bank size (#7144)
* track bank size

* support non-linux a bit better
2019-12-02 13:47:20 -08:00
Sagar Dhawan 0e2e13f018 Update usages of u64 to Slot (#7191)
automerge
2019-12-02 11:57:40 -08:00
sakridge 887bff572a
More conservative purge_zero_lamport_accounts purge logic (#7157) 2019-12-02 09:51:05 -08:00
dependabot-preview[bot] 0f872af502 Bump libc from 0.2.65 to 0.2.66 (#7180)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.65 to 0.2.66.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.65...0.2.66)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-02 09:56:03 -07:00
dependabot-preview[bot] 7f4feaee08 Bump serde from 1.0.102 to 1.0.103 (#7163)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.102 to 1.0.103.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.102...v1.0.103)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-27 09:10:25 -07:00
Rob Walker 8d75efdc58
genesis config hashmaps (#7107) 2019-11-26 19:23:37 -08:00
dependabot-preview[bot] c810913861 Bump serde_derive from 1.0.102 to 1.0.103 (#7141)
automerge
2019-11-26 14:44:20 -08:00
dependabot-preview[bot] 2b13158e29 Bump serde_json from 1.0.41 to 1.0.42 (#7142)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.41 to 1.0.42.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.41...v1.0.42)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-26 15:09:01 -07:00
Tyera Eulberg 58c144ee55
Add getBlockTime rpc api (#7130)
* Add getBlockTime rpc api

* Add getBlockTime to docs

* Fix duration rounding for common tick/slot durations; add slot duration calculation

* Expose slots_per_year

* Use genesis values instead of clock defaults to calculate block offset

* Add get-block-time cli subcommand

* Fix test_rent: decrease magic number usage
2019-11-26 00:40:36 -07:00
Michael Vines 294662a1ce
Bump version to 0.22.0 2019-11-25 21:34:50 -07:00
Sagar Dhawan 76a68c26c9
Track a Bank's parent slot independently from parent bank (#7131) 2019-11-25 15:34:51 -08:00
Rob Walker ef64f00cbb
Revert "Revert "add genesis stake placeholders (#6969)" (#7109)" (#7124)
This reverts commit 702f7cc51d.
2019-11-25 15:11:55 -08:00
Rob Walker acbe89a159
shrink stakes (#7122) 2019-11-25 13:14:32 -08:00
dependabot-preview[bot] 094c391cd7 Bump itertools from 0.8.1 to 0.8.2 (#7111)
Bumps [itertools](https://github.com/bluss/rust-itertools) from 0.8.1 to 0.8.2.
- [Release notes](https://github.com/bluss/rust-itertools/releases)
- [Commits](https://github.com/bluss/rust-itertools/commits/v0.8.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-25 10:22:47 -07:00
anatoly yakovenko 702f7cc51d Revert "add genesis stake placeholders (#6969)" (#7109)
* Revert "add genesis stake placeholders (#6969)"

This reverts commit 8a879faac7.

* fixup! Revert "add genesis stake placeholders (#6969)"

* fixup! fixup! Revert "add genesis stake placeholders (#6969)"

* fixup! fixup! fixup! Revert "add genesis stake placeholders (#6969)"

* fixup! fixup! fixup! fixup! Revert "add genesis stake placeholders (#6969)"

* fmt
2019-11-23 23:15:21 -07:00
sakridge 6c89226ccf
Purge zero lamport accounts on snapshot ingestion (#7010)
Snapshots do not load the original index, so they must
purge zero lamport accounts again.
2019-11-22 18:22:28 -08:00
Ryo Onodera 8bb68c4e6a
Really remove mentions of 'genesis_block' (#7099) 2019-11-23 05:58:20 +09:00
Sagar Dhawan 4485b978c1
Clean up accounts hash internal state api (#7090) 2019-11-22 08:56:00 -08:00
Rob Walker 8a879faac7
add genesis stake placeholders (#6969)
* add investor stake placeholders

fixups

fixups

review comments, fixups

make more data-looky for easier management

rent may be zero

rework with more tables, derived keys

fixups

rebase-fix

fixups

fixups

* genesis is now too big to boot in 10 seconds
2019-11-21 12:05:31 -08:00
Sagar Dhawan 2c1b8fdd39 Add another test for bank state hashes (#7073)
automerge
2019-11-20 23:03:42 -08:00
Jack May 3415db9739
Merge api/program into single units (#7061) 2019-11-20 16:32:19 -08:00
Tyera Eulberg 97ca6858b7
Write transaction status and fee into persistent store (#7030)
* Pass blocktree into execute_batch, if persist_transaction_status

* Add validator arg to enable persistent transaction status store

* Pass blocktree into banking_stage, if persist_transaction_status

* Add validator params to bash scripts

* Expose actual transaction statuses outside Bank; add tests

* Fix benches

* Offload transaction status writes to a separate thread

* Enable persistent transaction status along with rpc service

* nudge

* Review comments
2019-11-20 16:43:10 -07:00
Parth 9f6a2e51b2
add credit-debit rent handling (#6947)
* add credit-debit rent handling

* add tests

* charge rent for validator account for fee credit

* rent is stored per tx instead of account
2019-11-21 01:57:02 +05:30
anatoly yakovenko b150da837a Use epoch as the gossip purge timeout for staked nodes. (#7005)
automerge
2019-11-20 11:25:18 -08:00
Jack May d184d3a732
Merge native programs parts into one unit (#7047) 2019-11-20 10:12:43 -08:00
Sagar Dhawan 42da1ce4e2
Fix bank hash not changing when no internal state has changed (#7052)
* Fix bank hash not changing when no internal state has changed

* Fix unnecessary call to hash_internal_state

* Add blockhash into the bank_hash

* Add blockhash into the bank_hash and update tests

* Refactor accounts_db slot_hashes

* More clarity in comments

* Add clippy suggestion

* Grammar

* Fix compile after clippy made me break it

* Schooled by clippy
2019-11-19 20:19:43 -08:00
Parth 3615209ce7 don't allow assignment to sysvar program (#7017)
automerge
2019-11-18 19:39:29 -08:00
Greg Fitzgerald c09469fa3a
Rename verify_instruction() to verify_account_changes() (#7020) 2019-11-18 15:01:14 -07:00
Parth c902fd0303
skip sysvars while assessing rent (#7015)
* skip sysvars while assessing rent
2019-11-19 01:31:27 +05:30
Michael Vines e7f63cd336
Upgrade to rust 1.39.0 (#6939)
* Upgrade to rust 1.39.0

* 1.39.0 clippy
2019-11-14 12:27:01 -07:00
Parth 7b05b3dbb3
rent collector improvments (#6888)
* avoid account copying + pre-empt rent

* adding support for base rent
2019-11-14 10:56:49 +05:30
Michael Vines cc96848b01 Remove unneeded prepare_batch() assert (#6941)
automerge
2019-11-13 17:08:21 -08:00
Michael Vines 9026339d35
Restore is_frozen() asserts (#6925) 2019-11-13 10:40:51 -07:00
Michael Vines fcc2874591
Remove/address some TODOs (#6923) 2019-11-13 09:43:15 -07:00
Greg Fitzgerald 986e9e268e
Revive the parallel bank client from v0.16 (#6903) 2019-11-12 15:26:21 -07:00
Rob Walker bb00904fc8
add rent reserve for bootstrap stakes (#6876)
* genesis investor stakes

* assert rent is sufficient for these bootstrappers
2019-11-12 12:33:40 -08:00
Justin Starry 9807f47d4e
Rename genesis block to genesis config (#6816) 2019-11-08 23:56:57 -05:00
carllin 91be35731c
Fix freeze and register_tick race (#6799)
* Fix freeze and register_tick race

* Add test
2019-11-08 17:21:17 -08:00
Michael Vines efdfc5c327
Remove TODOs (#6843) 2019-11-08 16:43:18 -07:00
Jack May 2f7d0e7884
TODO already covered by issue (#6828) 2019-11-08 11:45:17 -08:00
carllin 66a0f54097 Replay should respect order of register_ticks with respect to blockhashes (#6805) 2019-11-08 12:29:41 -07:00
Parth 5bd05fba09
require `to` account signature (#6658)
* require to signature

* fixing invocation to create_account

* fix create_account references

* address review comment

* whacking bugs in tests

* fixing stake program tests
2019-11-08 15:57:35 +05:30
Sagar Dhawan 80a89b5e6d Revert "Revert "Add inflation to epoch phases (#6787)" (#6802)" (#6806)
automerge
2019-11-07 18:33:14 -08:00
Sagar Dhawan d89271528e Revert "Add inflation to epoch phases (#6787)" (#6802)
automerge
2019-11-07 16:43:09 -08:00
Jack May a9c4cd6cbe
Add inflation to epoch phases (#6787) 2019-11-07 10:53:04 -08:00
Justin Starry e420800aeb
Update terminology for block height and genesis block (#6782) 2019-11-06 23:09:03 -05:00
Tyera Eulberg b3a75a60a4
Use rooted bank by default in rpc bank selection (#6759)
* Name anonymous parameters for clarity

* Add CommitmentConfig to select bank for rpc

* Add commitment information to jsonrpc docs

* Update send_and_confirm retries as per commitment defaults

* Pass CommitmentConfig into client requests; also various 'use' cleanup

* Use _with_commitment methods to speed local_cluster tests

* Pass CommitmentConfig into Archiver in order to enable quick confirmations in local_cluster tests

* Restore solana ping speed

* Increase wallet-sanity timeout to account for longer confirmation time
2019-11-06 14:15:00 -07:00
carllin 24102a7435
Allow voting on empty banks (#6719)
* Allow votes on empty banks

* Remove making first bank is_delta true, no longer necessary for idling

* Remove votable from ledger tool
2019-11-06 01:02:26 -08:00
Jack May 9614d17024
Limit deserialization of data coming off the wire (#6751)
* Limit deserialization of data coming off the wire

* Feedback and cleanup
2019-11-06 00:07:57 -08:00
Jack May b9d8e3e55a
Only copy whats needed to verify an instruction after processing (#6669) 2019-11-05 10:57:32 -08:00
Tyera Eulberg c6931dcb07
Remove credit-only account handling (#6726)
* Renaming
- credit-only/credit-debit to read-only/read-write
- debitable to writable

* Remove credit handling, making credit-only accounts read-only

* Update programs to remove deprecated credit-only account designation

* Use readonly and writable instead of underscored types
2019-11-05 09:38:35 -07:00
anatoly yakovenko f54cfcdb8f
Store and persists full stack of tower votes in gossip (#6695)
* vote array

wip

wip

wip

update

gossip index should match tower index

tests build

clippy

test index after expired vote

test

bank specific last vote sync time

* verify

* we are likely to see many more warnings about old votes now
2019-11-04 16:19:54 -08:00
Rob Walker efe260f12e
sysvar trait (#6667)
* sysvar trait

* get the new guy in on it
2019-11-04 12:31:24 -08:00
Rob Walker b9b535c30f
move system_instruction::transfer() `to` credit-debit (#6677)
* transfer no credit only

* use a credit-only transfer in the credit-only test
2019-11-04 12:30:59 -08:00
Trent Nelson 5416c114cf
SDK: Add sysvar to expose recent block hashes to programs (#6663)
* SDK: Add sysvar to expose recent block hashes to programs

* Blockhashes is one word

* Missed one

* Avoid allocs on update

* unwrap_or_else

* Use iterators

* Add microbench

* Revert "unwrap_or_else"

This reverts commit a8f8c3bfbe0d88e2229e67a29e9d2b489b93ff62.

* Revert "Avoid allocs on update"

This reverts commit 486f01790c271cf09ac3dbffba0e40e526e81324.
2019-11-04 10:51:15 -07:00
Michael Vines 3938142535
keygen: add dedicated `solana-keygen grind` command (#6697)
* Remove dead code

* Speed up vanity key grinding
2019-11-03 19:41:26 -08:00
Michael Vines 50a17fc00b Use Slot and Epoch type aliases instead of raw u64 (#6693)
automerge
2019-11-02 00:38:30 -07:00
Justin Starry e8e5ddc55d
Verify number of hashes for each block of entries (#6262)
* Verify number of hashes for each block of entries

* Fix blocktree processor tick check

* Rebase once more
2019-10-31 16:38:50 -04:00
Greg Fitzgerald 328a6a866e Fix code comment (#6640)
automerge
2019-10-30 22:21:34 -07:00
Jack May 5264fded00
Avoid alloc due to vector pushes (#6632) 2019-10-30 21:55:17 -07:00
Rob Walker fa12a5f70b
kill rent calculator (#6625) 2019-10-30 16:25:12 -07:00
Rob Walker a587d05098
fix re delegate (#6603) 2019-10-29 14:42:45 -07:00
dependabot-preview[bot] 30c0a7d069 Bump serde from 1.0.101 to 1.0.102 (#6581)
automerge
2019-10-28 09:19:39 -07:00
dependabot-preview[bot] 71b4e765c8 Bump itertools from 0.8.0 to 0.8.1 (#6583)
Bumps [itertools](https://github.com/bluss/rust-itertools) from 0.8.0 to 0.8.1.
- [Release notes](https://github.com/bluss/rust-itertools/releases)
- [Commits](https://github.com/bluss/rust-itertools/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-28 08:26:15 -07:00
dependabot-preview[bot] 73dd5aa2d1 Bump serde_derive from 1.0.101 to 1.0.102 (#6582)
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.101 to 1.0.102.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.101...v1.0.102)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-28 08:24:13 -07:00
Rob Walker c9cea2152b
optimize verify_instruction (#6539) 2019-10-25 21:47:16 -07:00
Dan Albert 73c31d873e
Update Cargo.toml versions from 0.20.0 to 0.21.0 (#6568) 2019-10-25 17:40:49 -06:00
Jack May d68e2c4d06
Revert "Make instruction data opaque to runtime (#6470)" (#6564)
This reverts commit 6eeca9c6f1.
2019-10-25 16:22:41 -07:00
Jack May 6eeca9c6f1
Make instruction data opaque to runtime (#6470) 2019-10-24 22:38:57 -07:00
Rob Walker f46a2cec3c
owner and executable checks (#6526)
* owner_checks

* only system program may assign owner, and only if pre.owner is system

* moar coverage!

* moar coverage, allow re-assignment IFF data is zeroed
2019-10-24 11:06:00 -07:00
Rob Walker b4119c454a
credit_only credits forwarding (#6509)
* credit_only_credits_forwarding

* whack transfer_now()

* fixup

* bench should retry the airdrop TX

* fixup

* try to make bench-exchange a bit more robust, informative
2019-10-23 22:01:22 -07:00
sakridge f1172617cc
Purge accounts with lamports=0 on rooted forks (#6315) 2019-10-23 12:46:48 -07:00
Michael Vines 35cc74ef25
Add GenesisBlock::OperatingMode to control how cluster features are activated (#6430) 2019-10-23 11:50:10 -07:00
Michael Vines 3fb70b8d47
Ban XXX, TBD, FIXME comments (#6486) 2019-10-21 16:43:11 -07:00
Greg Fitzgerald 9232057e95
Rename replicator to archiver (#6464)
* Rename replicator to archiver

* cargo fmt

* Fix grammar
2019-10-21 11:29:37 -06:00
Justin Starry 09abbd93b1
Cleanup register_tick special handling (#6462) 2019-10-21 10:51:02 -04:00
Rob Walker e2c316d2d0
system_instruction_processor updates (#6448)
* zero lamport account creation

* whack create_user_account, take 2

* target->to

* ..

* ..

* update chacha golden

* update chacha golden

* ..

* ..
2019-10-19 18:23:27 -07:00
sakridge 35ed432d1a
Make benchmark useful (#6440)
function is verify_hash_internal_state
2019-10-18 12:59:47 -07:00
dependabot-preview[bot] 51dad397ed Bump libc from 0.2.64 to 0.2.65
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.64 to 0.2.65.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.64...0.2.65)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-18 08:05:49 -07:00