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

1/4 PoS: initial version of the PoS crate #418

Merged
merged 6 commits into from
Sep 7, 2021
Merged

Conversation

tzemanovic
Copy link
Member

@tzemanovic tzemanovic commented Aug 31, 2021

This PR is split from #385. Closes #322

The PoS system and its integration is described in #324. Rendered: https://github.com/anoma/anoma/blob/tomas/pos-design/docs/src/explore/design/pos.md and https://github.com/anoma/anoma/blob/tomas/pos-design/docs/src/explore/design/ledger/pos-integration.md, respectively.

Together with #419, #420, #421, these PRs contain the PoS MVP with:

  • validator self-bond
    • tx WASM + client cmd
    • VP validation
  • delegation
    • tx WASM + client cmd
    • VP validation
  • validator unbond from self-bond
    • tx WASM + client cmd
    • VP validation
  • delegator unbond from delegation
    • tx WASM + client cmd
    • VP validation
  • validator withdraw from unbond
    • tx WASM + client cmd
    • VP validation
  • delegator withdraw from unbond
    • tx WASM + client cmd
    • VP validation
  • slashing
    • base ledger apply slash on evidence in BeginBlock
    • withdraw from unbond apply slashes
    • VP validation of slashes on withdraw
  • RPC
    • get bonds/unbonds for a given source address
    • get a validator's voting power
    • get total voting power
    • get validator set (active/inactive)
    • add optional arg for epoch for queries above (use current epoch if not specified)

Cargo.toml Show resolved Hide resolved
@tzemanovic tzemanovic mentioned this pull request Aug 31, 2021
29 tasks
Copy link
Member

@batconjurer batconjurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small comments. I still need to review the validation.rs file

Copy link
Member

@yito88 yito88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Epoched structs look really nice!
I left comments for lib.rs though I'm reviewing the validation part.

proof_of_stake/src/lib.rs Outdated Show resolved Hide resolved
proof_of_stake/src/lib.rs Outdated Show resolved Hide resolved
proof_of_stake/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@yito88 yito88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

tzemanovic and others added 3 commits September 7, 2021 10:37
Co-authored-by: Yuji Ito <yuji@phact-columba.com>
Co-authored-by: Jacob Turner <jacob.turner870@gmail.com>
tzemanovic and others added 3 commits September 7, 2021 10:38
Co-authored-by: Jacob Turner <jacob.turner870@gmail.com>
Co-authored-by: yito88 <yuji@phact-columba.com>
@tzemanovic tzemanovic merged commit ac9c05d into master Sep 7, 2021
@tzemanovic tzemanovic deleted the tomas/pos-library branch September 7, 2021 09:27
Fraccaman pushed a commit that referenced this pull request Sep 7, 2021
Merge: 8aa9b0c 4aad89b
Author: Tomas Zemanovic <tzemanovic@gmail.com>
Date:   Tue Sep 7 11:27:02 2021 +0200

    Merge pull request #418 from anoma/tomas/pos-library

    1/4 PoS: initial version of the PoS crate
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

Successfully merging this pull request may close these issues.

Prototype the PoS system as an independent crate
3 participants