Files
kaspad/domain/consensus/database/serialization/dbobjects.proto
Ori Newman d207888b67 Implement pruned headers node (#1787)
* Pruning headers p2p basic structure

* Remove headers-first

* Fix consensus tests except TestValidateAndInsertPruningPointWithSideBlocks and TestValidateAndInsertImportedPruningPoint

* Add virtual genesis

* Implement PruningPointAndItsAnticoneWithMetaData

* Start fixing TestValidateAndInsertImportedPruningPoint

* Fix TestValidateAndInsertImportedPruningPoint

* Fix BlockWindow

* Update p2p and gRPC

* Fix all tests except TestHandleRelayInvs

* Delete TestHandleRelayInvs parts that cover the old IBD flow

* Fix lint errors

* Add p2p_request_ibd_blocks.go

* Clean code

* Make MsgBlockWithMetaData implement its own representation

* Remove redundant check if highest share block is below the pruning point

* Fix TestCheckLockTimeVerifyConditionedByAbsoluteTimeWithWrongLockTime

* Fix comments, errors ane names

* Fix window size to the real value

* Check reindex root after each block at TestUpdateReindexRoot

* Remove irrelevant check

* Renames and comments

* Remove redundant argument from sendGetBlockLocator

* Don't delete staging on non-recoverable errors

* Renames and comments

* Remove redundant code

* Commit changes inside ResolveVirtual

* Add comment to IsRecoverableError

* Remove blocksWithMetaDataGHOSTDAGDataStore

* Increase windows pagefile

* Move DeleteStagingConsensus outside of defer

* Get rid of mustAccepted in receiveBlockWithMetaData

* Ban on invalid pruning point

* Rename interface_datastructures_daawindowstore.go to interface_datastructures_blocks_with_meta_data_daa_window_store.go

* * Change GetVirtualSelectedParentChainFromBlockResponseMessage and VirtualSelectedParentChainChangedNotificationMessage to show only added block hashes
*  Remove ResolveVirtual
* Use externalapi.ConsensusWrapper inside MiningManager
* Fix pruningmanager.blockwithmetadata

* Set pruning point selected child when importing the pruning point UTXO set

* Change virtual genesis hash

* replace the selected parent with virtual genesis on removePrunedBlocksFromGHOSTDAGData

* Get rid of low hash in block locators

* Remove +1 from everywhere we use difficultyAdjustmentWindowSize and increase the default value by one

* Add comments about consensus wrapper

* Don't use separate staging area when resolving resolveBlockStatus

* Fix netsync stability test

* Fix checkResolveVirtual

* Rename ConsensusWrapper->ConsensusReference

* Get rid of blockHeapNode

* Add comment to defaultDifficultyAdjustmentWindowSize

* Add SelectedChild to DAGTraversalManager

* Remove redundant copy

* Rename blockWindowHeap->calculateBlockWindowHeap

* Move isVirtualGenesisOnlyParent to utils

* Change BlockWithMetaData->BlockWithTrustedData

* Get rid of maxReasonLength

* Split IBD to 100 blocks each time

* Fix a bug in calculateBlockWindowHeap

* Switch to trusted data when encountering virtual genesis in blockWithTrustedData

* Move ConsensusReference to domain

* Update ConsensusReference comment

* Add comment

* Rename shouldNotAddGenesis->skipAddingGenesis
2021-07-26 12:24:07 +03:00

158 lines
2.9 KiB
Protocol Buffer

syntax = "proto3";
package serialization;
option go_package = "github.com/kaspanet/kaspad/serialization";
message DbBlock {
DbBlockHeader header = 1;
repeated DbTransaction transactions = 2;
}
message DbBlockHeader {
uint32 version = 1;
repeated DbHash parentHashes = 2;
DbHash hashMerkleRoot = 3;
DbHash acceptedIDMerkleRoot = 4;
DbHash utxoCommitment = 5;
int64 timeInMilliseconds = 6;
uint32 bits = 7;
uint64 nonce = 8;
}
message DbHash {
bytes hash = 1;
}
message DbTransaction {
uint32 version = 1;
repeated DbTransactionInput inputs = 2;
repeated DbTransactionOutput outputs = 3;
uint64 lockTime = 4;
DbSubnetworkId subnetworkID = 5;
uint64 gas = 6;
bytes payload = 8;
}
message DbTransactionInput {
DbOutpoint previousOutpoint = 1;
bytes signatureScript = 2;
uint64 sequence = 3;
uint32 sigOpCount = 4;
}
message DbOutpoint {
DbTransactionId transactionID = 1;
uint32 index = 2;
}
message DbTransactionId {
bytes transactionId = 1;
}
message DbTransactionOutput {
uint64 value = 1;
DbScriptPublicKey scriptPublicKey = 2;
}
message DbSubnetworkId {
bytes subnetworkId = 1;
}
message DbAcceptanceData {
repeated DbBlockAcceptanceData blockAcceptanceData = 1;
}
message DbBlockAcceptanceData {
repeated DbTransactionAcceptanceData transactionAcceptanceData = 1;
DbHash blockHash = 2;
}
message DbTransactionAcceptanceData {
DbTransaction transaction = 1;
uint64 fee = 2;
bool isAccepted = 3;
repeated DbUtxoEntry transactionInputUtxoEntries = 4;
}
message DbBlockRelations {
repeated DbHash parents = 1;
repeated DbHash children = 2;
}
message DbBlockStatus {
uint32 status = 1;
}
message DbBlockGhostdagData {
uint64 blueScore = 1;
bytes blueWork = 2;
DbHash selectedParent = 3;
repeated DbHash mergeSetBlues = 4;
repeated DbHash mergeSetReds = 5;
repeated DbBluesAnticoneSizes bluesAnticoneSizes = 6;
}
message DbBluesAnticoneSizes {
DbHash blueHash = 1;
uint32 anticoneSize = 2;
}
message DbMultiset {
bytes multiset = 1;
}
message DbUtxoSet {
repeated DbUtxoCollectionItem items = 1;
}
message DbUtxoCollectionItem {
DbOutpoint outpoint = 1;
DbUtxoEntry utxoEntry = 2;
}
message DbScriptPublicKey {
bytes script = 1;
uint32 version = 2;
}
message DbUtxoEntry {
uint64 amount = 1;
DbScriptPublicKey scriptPublicKey = 2;
uint64 blockDaaScore = 3;
bool isCoinbase = 4;
}
message DbReachabilityData {
repeated DbHash children = 1;
DbHash parent = 2;
DbReachabilityInterval interval = 3;
repeated DbHash futureCoveringSet = 4;
}
message DbReachabilityInterval {
uint64 start = 1;
uint64 end = 2;
}
message DbUtxoDiff {
repeated DbUtxoCollectionItem toAdd = 1;
repeated DbUtxoCollectionItem toRemove = 2;
}
message DbTips {
repeated DbHash tips = 1;
}
message DbBlockCount {
uint64 count = 1;
}
message DbBlockHeaderCount {
uint64 count = 1;
}
message DbBlockGHOSTDAGDataHashPair {
DbHash hash = 1;
DbBlockGhostdagData GhostdagData = 2;
}