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

Stake Relativization Specification + Fixes #86

Merged
merged 17 commits into from
Mar 23, 2024

Conversation

davidrusu
Copy link
Contributor

@davidrusu davidrusu commented Mar 18, 2024

The main thrust of this PR is implementing Stake Relativization, but in doing so, a few issues with the orphan handling and fork management code came up and so this PR has gotten a bit more complex with the various fixes.

Unfortunately the bugs were revealed after I had done the majority of the stake relativization implementation otherwise I would have split them out into smaller PR's.

notable bugs:

  • orphans from complex branching structures failed to validate
  • we would lose track of the current branch on re-org

I've updated the specification in Notion from learnings having gone through the implementation process, namely the inference period is no longer the entire epoch, we need a stable value for total stake for when we enter the next epoch:
https://www.notion.so/Stake-Relativization-65f5ed5522b64c36b625652023318d88?pvs=4#6e3c4d567eda49079822662075b847ed

@davidrusu davidrusu changed the title WIP: Stake Relativization Specification Stake Relativization Specification + Orphan Proof Fixes Mar 21, 2024
@davidrusu davidrusu marked this pull request as ready for review March 21, 2024 13:59
@davidrusu davidrusu changed the title Stake Relativization Specification + Orphan Proof Fixes Stake Relativization Specification + Fixes Mar 21, 2024
Copy link
Contributor

@zeegomo zeegomo left a comment

Choose a reason for hiding this comment

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

Good work!

cryptarchia/cryptarchia.py Show resolved Hide resolved
cryptarchia/cryptarchia.py Outdated Show resolved Hide resolved
self.local_chain = new_chain
if new_chain != self.local_chain:
self.forks.remove(new_chain)
self.forks.append(self.local_chain)
Copy link
Contributor

Choose a reason for hiding this comment

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

oops

Copy link
Contributor Author

Choose a reason for hiding this comment

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

c'est la vie

cryptarchia/cryptarchia.py Outdated Show resolved Hide resolved
cryptarchia/cryptarchia.py Outdated Show resolved Hide resolved
@davidrusu davidrusu merged commit d2f6ad5 into master Mar 23, 2024
1 check passed
@davidrusu davidrusu deleted the drusu/cryptarchia-total-stake-inference branch March 23, 2024 03:53
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.

2 participants