Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Refactor hashBoinc for binary claim contexts #1558
Based on discussions in Slack, this PR moves the storage of claim contexts from the coinbase transaction to the block itself to facilitate submission of much larger superblock data than a transaction allows. This accommodation prepares the protocol for the removal of the team requirement and a greater number of users. The application begins to use the binary serialization format after the next mandatory threshold. This format significantly reduces the size overhead of the claim context and eliminates issues with string-based serialization.
To further reduce the size of claim data, I removed the following legacy fields:
Although it provides an easy-to-access historical log, this data can be reproduced from blockchain data, so it's not necessary to store it in every block. We can also remove the following informational fields from the claim context, but we agreed to keep them in the short-term for explorers:
A subsequent pull request will hook-up the new
Added a check for zero research reward when staking a block--in the same vein as 6d3cbf8, this switches the block to an investor stake so we don't add unnecessary CPID data to the chain. The research age system needs to scan every research reward block at startup, including blocks with zero research reward. By omitting the CPID from the block, the index scan can skip the block at startup without needing to double-check the research reward amount.
iFoggz left a comment
After an hour reviewing this code + 2 sandwiches and a tea. I can say there is a lot going on here and this is a big change and a lot of refactoring to accommodate the change. However I did not see anything that pops out that concerns me. I approve to push ahead for more wide scale testing on testnet and see how well this performs for many users. a set bv11 start should be setup and testnet should be upgraded before hand. Good work @cyrossignol, These are changes that need to be done to improve the overall quality of life and expansion of Gridcoin into the future.
This allows generated blocks greater than MAX_BLOCK_SIZE only when those contain a superblock. The superblock must serialize on the network to at most Superblock::MAX_SIZE bytes. The rest of the block must hold at most MAX_BLOCK_SIZE bytes still.
If no pending research subsidy value exists, build an investor claim. This avoids polluting the block index with non-research reward blocks that contain CPIDs which increases the effort needed to load research age context at start-up.