-
Notifications
You must be signed in to change notification settings - Fork 292
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
Primitives Module Planning and Outline #2786
Comments
Updated issue description for PR #2787. |
Updated issue description for PR #2788. |
Updated issue description for #2826. |
Updated issue description for #2827. |
Updated issue description for #2920. |
Hi, @davecgh . Could you explain more details about "Implement BlockHeader including things such as long-term stable serialization and calculation of the block hash as used in consensus"? I would like to contribute with that ticket. |
This issue is intended to act as a running high-level outline and provide motivation for overall planned long-term refactors and implementation of a
primitives
module as time permits.Currently, the
wire
module essentially acts as the fundamental building block of some data structures and other definitions for other concepts that are key to consensus. For example, block headers, transactions, blocks, and sequence lock definitions. While this has worked well over the years and is reasonable given the current architecture, it does result in the conflation of two concepts that really are distinct. Namely, that the specific details regarding the way the data structures are serialized and used in consensus is fundamentally entirely distinct from the data sharing protocol even though they are currently highly coincident.Further, it also has led to several other fundamental consensus-related concepts such as median time sources, determination of transaction finalization, and lock times needing to be defined elsewhere since those are clearly not related to the wire protocol.
Thus, my plan is to implement a new
primitives
module which will become the new fundamental building block of consensus code with the following motivations and goals:wire
,blockchain
,blockchain/standalone
, anddcrutil
Given that almost everything currently builds on
wire
either directly or indirectly, this is going to be a fairly intensive and long-running effort. Moreover, many of the individual changes will very likely look out of place and/or incomplete in isolation, so my hope is that this issue along with a high-level outline will provide insight into the end goal.Note that some of these will very likely need to be updated as the work proceeds since unexpected things invariably come up during large development efforts such as this. They are also not in a strict order.
uint256
subpackage for all fixed-precision unsigned 256-bit integer needs -- Implemented by PR uint256: Introduce package. #2787blockchain/standalone
and update to use the newuint256
instead of standard library big integers -- Implemented by PR primitives: Add initial proof-of-work funcs. #2788blockchain/standalone
-- Implemented by PR primitives: Add inclusion proof funcs. #2827blockchain/standalone
-- Implemented by PR primitives: Add subsidy calcs. #2920wire
)Tx
including things such as long-term stable serialization and calculation of both witness and full hashes used in consensusBlockHeader
including things such as long-term stable serialization and calculation of the block hash as used in consensusBlock
including things such as long-term stable serialization and pass through hash calculationblockchain/standalone
-- Partially implemented by primitives: Add core merkle tree root calcs. #2826blockchain/standalone
blockchain/standalone
blockchain/standalone
in favor of the newprimitives
modulewire
to make use of the newprimitives
types and remove all consensus-specific definitionsMedianTimeSource
fromblockchain
blockchain
blockchain
code used by external consumers related to transaction checkingblockchain
an internal packagetxscript
currently which is not desirable for the new moduleThe text was updated successfully, but these errors were encountered: