Alt Block/ Chain Handling #194
Labels
A-consensus
Related to consensus.
A-storage
Related to storage.
C-proposal
A proposal of some kind, and a request for comments.
What
Adding alt block handling to Cuprate's components, the consensus and DB code needs to be able to handle reorgs.
The block downloader can already handle downloading an alt chain.
How
Consensus changes
The consensus changes are being completed in this PR: #214
Database changes
#214 makes some changes to the
BCRequest
/response enums these new requests will need to be handled in the DB.To do this some new tables will need to be added:
AltChainsInfo
Key:
ChainID
Value:
AltChainInfo
AltBlockHeights
Key: Block Hash (
[u8; 32]
).Value:
AltBlockHeight
AltBlocksInfo
Key:
AltBlockHeight
Value:
CompactAltBlockInfo
AltBlockBlobs
Key:
AltBlockHeight
Value:
Vec<u8>
AltTransactionBlobs
Key: Tx hash (
[u8; 32]
)Value:
Vec<u8>
AltTransactionsInfo
Key: Tx hash (
[u8; 32]
)Value:
AltTransactionInfo
DB request changes
And some new request variants need to be added:
These todos also need to be completed:
cuprate/storage/blockchain/src/service/read.rs
Line 210 in dced4ed
cuprate/storage/blockchain/src/service/read.rs
Line 326 in dced4ed
cuprate/storage/blockchain/src/service/read.rs
Line 382 in dced4ed
The text was updated successfully, but these errors were encountered: