stasatdaglabs 21a459c0f4
Implement virtual selected parent chain RPC methods (#1249)
* [NOD-1579] Rename AcceptedTxIDs to AcceptedTransactionIDs.

* [NOD-1579] Add InsertBlockResult to ValidateAndInsertBlock results.

* [NOD-1593] Rename InsertBlockResult to BlockInsertionResult.

* [NOD-1593] Add SelectedParentChainChanges to AddBlockToVirtual's result.

* [NOD-1593] Implement findSelectedParentChainChanges.

* [NOD-1593] Implement TestFindSelectedParentChainChanges.

* [NOD-1593] Fix a string.

* [NOD-1593] Finish implementing TestFindSelectedParentChainChanges.

* [NOD-1593] Fix merge errors.

* [NOD-1597] Begin implementing UTXOIndex.

* [NOD-1597] Connect UTXOIndex to RPC.

* [NOD-1597] Connect Consensus to UTXOIndex.

* [NOD-1597] Add AcceptanceData to BlockInfo.

* [NOD-1597] Implement UTXOIndex.Update().

* [NOD-1597] Implement add(), remove(), and discard() in utxoIndexStore.

* [NOD-1597] Add error cases to add() and remove().

* [NOD-1597] Add special cases to add() and remove().

* [NOD-1597] Implement commit.

* [NOD-1597] Add a mutex around UTXOIndex.Update().

* [NOD-1597] Return changes to the UTXO from Update().

* [NOD-1597] Add NotifyUTXOsChangedRequestMessage and related structs.

* [NOD-1597] Implement HandleNotifyUTXOsChanged.

* [NOD-1597] Begin implementing TestUTXOIndex.

* [NOD-1597] Implement RegisterForUTXOsChangedNotifications.

* [NOD-1597] Fix bad transaction.ID usage.

* [NOD-1597] Implement convertUTXOChangesToUTXOsChangedNotification.

* [NOD-1597] Make UTXOsChangedNotificationMessage.Removed UTXOsByAddressesEntry instead of just RPCOutpoint so that the client can discern which address was the UTXO removed for.

* [NOD-1597] Collect outpoints in TestUTXOIndex.

* [NOD-1597] Rename RPC stuff.

* [NOD-1597] Add messages for GetUTXOsByAddresses.

* [NOD-1597] Implement HandleGetUTXOsByAddresses.

* [NOD-1597] Implement GetUTXOsByAddresses.

* [NOD-1597] Implement UTXOs().

* [NOD-1597] Implement getUTXOOutpointEntryPairs().

* [NOD-1597] Expand TestUTXOIndex.

* [NOD-1597] Convert SubmitTransaction to use RPCTransaction instead of MsgTx.

* [NOD-1597] Finish implementing TestUTXOIndex.

* [NOD-1597] Add messages for GetVirtualSelectedParentBlueScore.

* [NOD-1597] Implement HandleGetVirtualSelectedParentBlueScore and GetVirtualSelectedParentBlueScore.

* [NOD-1597] Implement TestVirtualSelectedParentBlueScore.

* [NOD-1597] Implement NotifyVirtualSelectedParentBlueScoreChanged.

* [NOD-1597] Expand TestVirtualSelectedParentBlueScore.

* [NOD-1597] Implement notifyVirtualSelectedParentBlueScoreChanged.

* [NOD-1597] Make go lint happy.

* [NOD-1593] Fix merge errors.

* [NOD-1593] Rename findSelectedParentChainChanges to calculateSelectedParentChainChanges.

* [NOD-1593] Expand TestCalculateSelectedParentChainChanges.

* [NOD-1597] Add logs to utxoindex.go.

* [NOD-1597] Add logs to utxoindex/store.go.

* [NOD-1597] Add logs to RPCManager.NotifyXXX functions.

* Implement notifySelectedParentChainChanged.

* Implement TestSelectedParentChain.

* Rename NotifyChainChanged to NotifyVirtualSelectedParentChainChanged.

* Rename GetChainFromBlock to GetVirtualSelectedParentChainFromBlock.

* Remove AcceptanceIndex from the config.

* Implement HandleGetVirtualSelectedParentChainFromBlock.

* Expand TestVirtualSelectedParentChain.

* Fix merge errors.

* Add a comment.

* Move a comment.
2020-12-21 14:43:32 +02:00

163 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 {
int32 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 {
int32 version = 1;
repeated DbTransactionInput inputs = 2;
repeated DbTransactionOutput outputs = 3;
uint64 lockTime = 4;
DbSubnetworkId subnetworkID = 5;
uint64 gas = 6;
DbHash payloadHash = 7;
bytes payload = 8;
}
message DbTransactionInput {
DbOutpoint previousOutpoint = 1;
bytes signatureScript = 2;
uint64 sequence = 3;
}
message DbOutpoint {
DbTransactionId transactionID = 1;
uint32 index = 2;
}
message DbTransactionId {
bytes transactionId = 1;
}
message DbTransactionOutput {
uint64 value = 1;
bytes 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;
}
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 DbUtxoEntry {
uint64 amount = 1;
bytes scriptPublicKey = 2;
uint64 blockBlueScore = 3;
bool isCoinbase = 4;
}
message DbReachabilityData {
DbReachabilityTreeNode treeNode = 1;
repeated DbHash futureCoveringSet = 2;
}
message DbReachabilityTreeNode {
repeated DbHash children = 1;
DbHash parent = 2;
DbReachabilityInterval interval = 3;
}
message DbReachabilityInterval {
uint64 start = 1;
uint64 end = 2;
}
message DbUtxoDiff {
repeated DbUtxoCollectionItem toAdd = 1;
repeated DbUtxoCollectionItem toRemove = 2;
}
message DbPruningPointUTXOSetBytes {
bytes bytes = 1;
}
message DbHeaderTips {
repeated DbHash tips = 1;
}
message DbTips {
repeated DbHash tips = 1;
}
message DbVirtualDiffParents {
repeated DbHash virtualDiffParents = 1;
}
message DbBlockCount {
uint64 count = 1;
}
message DbBlockHeaderCount {
uint64 count = 1;
}