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

Consensus: add alt-chain handling #214

Merged
merged 22 commits into from
Jul 29, 2024
Merged

Consensus: add alt-chain handling #214

merged 22 commits into from
Jul 29, 2024

Conversation

Boog900
Copy link
Member

@Boog900 Boog900 commented Jul 5, 2024

What

Adds alt-chain handling to our consensus code.

part of: #194

How

Handling of alt blocks/chains is delicate balance, we need to check alt block weight however the amount of data needed to check block weight is too much to do for any alt block.

So handling of alt blocks is done in steps.

Going roughly, first we build the difficulty cache and check the blocks PoW. Then if that is valid we build the weight cache and check block weight. This means we need to add multiple new request to the context cache.

Also to prevent needing to build the caches multiple times we keep the alt caches cached in the context cache.

Some changes had to be made to the database requests/response types.

@github-actions github-actions bot added A-dependency Related to dependencies, or changes to a Cargo.{toml,lock} file. A-workspace Changes to a root workspace file or general repo file. A-consensus Related to consensus. labels Jul 5, 2024
@github-actions github-actions bot added the A-helper Related to cuprate-helper. label Jul 6, 2024
@github-actions github-actions bot added A-storage Related to storage. A-types Related to types. labels Jul 12, 2024
@Boog900 Boog900 added the P-medium Medium priority. label Jul 22, 2024
@Boog900 Boog900 marked this pull request as ready for review July 22, 2024 01:06
@Boog900
Copy link
Member Author

Boog900 commented Jul 22, 2024

@hinto-janai this is ready, it's not extremely high priority, I have stuff I can work on that does not depend on this. I may have rushed some docs as this took way longer than expected, so I might need to expand some sections.

@Boog900 Boog900 requested a review from hinto-janai July 26, 2024 23:49
Copy link
Contributor

@hinto-janai hinto-janai left a comment

Choose a reason for hiding this comment

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

Some small leftover fixes needed.

@Boog900 Boog900 merged commit b44c6b0 into main Jul 29, 2024
6 checks passed
@Boog900 Boog900 deleted the alt-chain branch July 29, 2024 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Related to consensus. A-dependency Related to dependencies, or changes to a Cargo.{toml,lock} file. A-helper Related to cuprate-helper. A-storage Related to storage. A-types Related to types. A-workspace Changes to a root workspace file or general repo file. P-medium Medium priority.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants