Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Research PoS implementations #3

Closed
garious opened this issue Feb 14, 2018 · 9 comments
Closed

Research PoS implementations #3

garious opened this issue Feb 14, 2018 · 9 comments
Milestone

Comments

@garious
Copy link
Contributor

garious commented Feb 14, 2018

Is there any way we can incorporate an existing PoS implementation? Maybe Proof of Authority?

@garious garious added this to the Proof of Stake milestone Feb 14, 2018
@garious
Copy link
Contributor Author

garious commented Mar 28, 2018

No, we probably won't incorporate an existing PoS implementation. Thanks to proof of history, our proof of stake voting ends up being a fairly straightforward generalization of the spending plan contracts. We'll create a new entry type called Block that will point to an Entry ID and include a contract that does a 2/3 multisig vote with an expiration in num_hashes. Once the votes are on the ledger, the entry and all prior may be coalesced. Note that the block the votes are in does not need to be finalized before the entries are coalesced. Signature verification is sufficient.

@garious
Copy link
Contributor Author

garious commented Mar 28, 2018

Just to add to my previous comment, if the block that the votes are in needed to be finalized, then you'd never finalize. That also implies that votes need to survive rollback. That means that both leader and verifiers need to cache votes until they are in a block that's been finalized, and that implies that votes are broadcast to all nodes, not just the leader.

@garious
Copy link
Contributor Author

garious commented Mar 28, 2018

Problems that need to solved here:

  • Proof to anyone interpreting the chain that consensus has been reached
  • Survive a leader handoff without leaving space for a timing attack (@aeyakovenko groks this better than I do)
  • Calculate bond

So far my comments have only been about the first.

@garious
Copy link
Contributor Author

garious commented Mar 29, 2018

@garious
Copy link
Contributor Author

garious commented Apr 26, 2018

DFINITY's threshold relay looks promising and is similar in spirit to Proof of History. It's a VRF that can likely be integrated into our VDF to further simplify consensus.

@bgorlick
Copy link

I was going to suggest their threshold relay as well as one option to consider. I'm giving it some thought still.

@garious garious removed this from the v0.5.0 milestone Apr 27, 2018
sakridge referenced this issue in sakridge/solana May 2, 2018
Fix streamer::window_send_test
@bgorlick
Copy link

Cardano also recently posted this after tweeting "Proof of Stake - Finally Solved"
Composable Proof-of-Stake Blockchains with Dynamic Availability
Web: https://iohk.io/research/papers/#AQZE2XCV
PDF: https://api.zotero.org/groups/478201/items/PV8BKNA2/file/view?key=Qcjdk4erSuUZ8jvAah59Asef

@garious
Copy link
Contributor Author

garious commented May 10, 2018

Thanks @bgorlick, I'll be reviewing that closely. Excited to see this on Page 14:

For brevity, whenever in the protocol we say that a party uses the clock to update, τ, ep, and sl we mean
the following step:
Send (clock-read,sidC ) to Gclock; receive the current time τ and update ep := dτ /Re and slot index
sl = τ , accordingly.

solana-grimes pushed a commit that referenced this issue Aug 20, 2018
# This is the 1st commit message:

Fix tesetment readme

# This is the commit message #2:

updte

# This is the commit message #3:

typo

# This is the commit message #4:

cleanup
@mvines mvines modified the milestones: The Future!, v0.10 Pillbox Sep 5, 2018
@garious
Copy link
Contributor Author

garious commented Oct 1, 2018

We're rolling our own PoH-based PoS solution. As it relates to previously mentioned implementations above, it implements a VRF on top of our VDF. It samples the PoH counter every X hashes, and will hash the counter (not the hash) to use as a seed in leader selection. Likewise, we implement dynamic availability with a very similar mechanism. We sample the live nodes from gossip, grab their stakes from the Bank at a given PoH hash, and use that PoH-count-derived seed to randomly create the leader schedule, weighted by stake.

Adding all the dirty details to the consensus RFC is being tracked under #445.

@garious garious closed this as completed Oct 1, 2018
@jstarry jstarry mentioned this issue Apr 17, 2020
2 tasks
garious added a commit to garious/solana that referenced this issue May 12, 2020
garious added a commit that referenced this issue May 13, 2020
* Initial commit

* Execute transfers

* Refactor for testing

* Cleanup readme

* Rewrite

* Cleanup

* Cleanup

* Cleanup client

* Use a Null Client to move prints closer to where messages are sent

* Upgrade Solana

* Move core functionality into its own module

* Handle transaction errors

* Merge allocations

* Fixes

* Cleanup readme

* Fix markdown

* Add example input

* Add integration test - currently fails

* Add integration test

* Add metrics

* Use RpcClient in dry-run, just don't send messages

* More metrics

* Fix dry run with no keys

* Only require one approval if fee-payer is the sender keypair

* Fix bugs

* Don't create the transaction log if nothing to put into it;
  otherwise the next innvocation won't add the header

* Apply previous transactions to allocations with matching recipients

* Bail out of any account already has a balance

* Polish

* Add new 'balances' command

* 9 decimal places

* Add missing file

* Better dry-run; keypair options now optional

* Change field name from 'bid' to 'accepted'

Also, tolerate precision change from 2 decimal places to 4

* Write to transaction log immediately

* Rename allocations_csv to bids_csv

So that we can bypass bids_csv with an allocations CSV file

* Upgrade Solana

* Remove faucet from integration test

* Cleaner integration test

Won't work until this lands and is released:

#9717

* Update README

* Add TravicCI script to build and test (#1)

* Add distribute-stake command (#2)

* Distribute -> DistributeTokens (#3)

* Cache cargo deps (#4)

* Add docs (#5)

* Switch to latest Solana 1.1 release (#7)

* distribute -> distribute-tokens (#9)

* Switch from CSV to a pickledb database (#8)

* Switch from CSV to a pickledb database

* Allow PickleDb errors to bubble up

* Dedup

* Hoist db

* Add finalized field to TransactionInfo

* Don't allow RPC client to resign transactions

* Remove dead code

* Use transport::Result

* Record unconfirmed transaction

* Fix: separate stake account per allocation

* Catch transport errors

* Panic if we attempt to replay a transaction that hasn't been finalized

* Attempt to fix CI

PickleDb isn't calling flush() or close() after writing to files.
No issue on MacOS, but looks racy in CI.

* Revert "Attempt to fix CI"

This reverts commit 1632394f636c54402b3578120e8817dd1660e19b.

* Poll for signature before returning

* Add --sol-for-fees option for stake distributions

* Add --allocations-csv option (#14)

* Add allocations-csv option

* Add tests or GTFO

* Apply review feedback

* apply feedback

* Add read_allocations function

* Update arg_parser.rs

* Fix balances command (#17)

* Fix balances command

* Fix readme

* Add --force to transfer to non-empty accounts (#18)

* Add --no-wait (#16)

* Add ThinClient methods to implement --no-wait

* Plumb --no-wait through

No tests yet

* Check transaction status on startup

* Easier to test

* Wait until transaction is finalized before checking if it failed with an error

It's possible that a minority fork thinks it failed.

* Add unit tests

* Remove dead code and rustfmt

* Don't flush database to file if doing a dry-run

* Continue when transactions not yet finalized (#20)

If those transactions are dropped, the next run will execute them.

* Return the number of confirmations (#21)

* Add read_allocations() unit-test (#22)

Delete the copy-pasted top-level test.

Fixes #19

* Add a CSV printer (#23)

* Remove all the copypasta (#24)

* Move resolve_distribute_stake_args into its own function

* Add stake args to token args

* Unify option names

* Move Command::DistributeStake into DistributeTokens

* Remove process_distribute_stake

* Only unique signers

* Use sender keypair to fund new fee-payer accounts

* Unify distribute_tokens and distribute_stake

* Rename print-database command to transaction-log (#25)

* Send all transactions as quickly as possible, then wait (#26)

* Send all transactions as quickly as possible, then wait

* Exit when finalized or blockhashes have expired

* Don't need blockhash in the CSV output

* Better types

CSV library was choking on Pubkey as a type. PickleDb doesn't have that problem.

* Resend if blockhash has not expired

* Attempt to fix CI

* Move log to stderr

* Add constructor, tuck away client (#30)

* Add constructor, tuck away client

* Fix unwrap() caught by CI

* Fix optional option flagged as required

* Bunch of cleanup (#31)

* Remove untested --no-wait feature

* Make --transactions-db an option, not an arg

So that in the future, we can make it optional

* Remove more untested features

Too many false positives in that santity check.  Use --dry-run
instead.

* Add dry-run mode to ThinClient

* Cleaner dry-run

* Make key parameters required

Just don't use them in --dry-run

* Add option to write the transaction log

--dry-run doesn't write to the database. Use this option if you
want a copy of the transaction log before the final run.

* Revert --transaction-log addition

Implement #27 first

* Fix CI

* Update readme

* Fix CI in copypasta

* Sort transaction log by finalized date (#33)

* Make --transaction-db option implicit (#34)

* Move db functionality into its own module (#35)

* Move db functionality into its own module

* Rename tokens module to commands

* Version bump

* Upgrade Solana

* Add solana-tokens to build

* Remove Cargo.lock

* Remove vscode file

* Remove TravisCI build script

* Install solana-tokens

Co-authored-by: Dan Albert <[email protected]>
mvines pushed a commit that referenced this issue Jun 12, 2020
nishadsingh1 pushed a commit to nishadsingh1/solana that referenced this issue Aug 1, 2020
vkomenda pushed a commit to vkomenda/solana that referenced this issue Aug 29, 2021
Bumps [semver](https://github.com/npm/node-semver) from 7.1.3 to 7.3.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/master/CHANGELOG.md)
- [Commits](npm/node-semver@v7.1.3...v7.3.2)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
lijunwangs referenced this issue in lijunwangs/solana Apr 7, 2024
solana-labs#595)

Adjust receive window to make them linear to the count of streams (solana-labs#33913)

Adjust receive window to make them linear to the count of streams to reduce fragmentations
willhickey pushed a commit that referenced this issue Apr 8, 2024
#595)

Adjust receive window to make them linear to the count of streams (#33913)

Adjust receive window to make them linear to the count of streams to reduce fragmentations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants