mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-28 00:03:39 +00:00
* Add PruningPointProof to externalapi. * Add BuildPruningPointProof and ValidatePruningPointProof to Consensus. * Add the pruning point proof to the protocol. * Add the pruning point proof to the wire package. * Add PruningPointBlueWork. * Make go vet happy. * Properly initialize PruningPointProof in consensus.go. * Validate pruning point blue work. * Populate PruningPointBlueWork with the actual blue work of the pruning point. * Revert "Populate PruningPointBlueWork with the actual blue work of the pruning point." This reverts commit f2a9829998a8161ca24c259f971bd144084f0488. * Revert "Validate pruning point blue work." This reverts commit c6a90c5d2c5137657484d49ae8f33609aeb50235. * Revert "Properly initialize PruningPointProof in consensus.go." This reverts commit 9391574bbf711ab14eaf0c7700ae4d4b2e782e9d. * Revert "Add PruningPointBlueWork." This reverts commit 48182f652a5ff5048017d2c26640a1ffec79bc60. * Fix PruningPointProof and MsgPruningPointProof to be two-dimensional. * Fix wire PruningPointProof to be two-dimensional.
49 lines
3.0 KiB
Go
49 lines
3.0 KiB
Go
package externalapi
|
|
|
|
// Consensus maintains the current core state of the node
|
|
type Consensus interface {
|
|
Init(skipAddingGenesis bool) error
|
|
BuildBlock(coinbaseData *DomainCoinbaseData, transactions []*DomainTransaction) (*DomainBlock, error)
|
|
ValidateAndInsertBlock(block *DomainBlock, shouldValidateAgainstUTXO bool) (*BlockInsertionResult, error)
|
|
ValidateAndInsertBlockWithTrustedData(block *BlockWithTrustedData, validateUTXO bool) (*BlockInsertionResult, error)
|
|
ValidateTransactionAndPopulateWithConsensusData(transaction *DomainTransaction) error
|
|
ImportPruningPoints(pruningPoints []BlockHeader) error
|
|
BuildPruningPointProof() (*PruningPointProof, error)
|
|
ValidatePruningPointProof(pruningPointProof *PruningPointProof) error
|
|
|
|
GetBlock(blockHash *DomainHash) (*DomainBlock, error)
|
|
GetBlockEvenIfHeaderOnly(blockHash *DomainHash) (*DomainBlock, error)
|
|
GetBlockHeader(blockHash *DomainHash) (BlockHeader, error)
|
|
GetBlockInfo(blockHash *DomainHash) (*BlockInfo, error)
|
|
GetBlockRelations(blockHash *DomainHash) (parents []*DomainHash, selectedParent *DomainHash, children []*DomainHash, err error)
|
|
GetBlockAcceptanceData(blockHash *DomainHash) (AcceptanceData, error)
|
|
|
|
GetHashesBetween(lowHash, highHash *DomainHash, maxBlocks uint64) (hashes []*DomainHash, actualHighHash *DomainHash, err error)
|
|
GetMissingBlockBodyHashes(highHash *DomainHash) ([]*DomainHash, error)
|
|
GetPruningPointUTXOs(expectedPruningPointHash *DomainHash, fromOutpoint *DomainOutpoint, limit int) ([]*OutpointAndUTXOEntryPair, error)
|
|
GetVirtualUTXOs(expectedVirtualParents []*DomainHash, fromOutpoint *DomainOutpoint, limit int) ([]*OutpointAndUTXOEntryPair, error)
|
|
PruningPoint() (*DomainHash, error)
|
|
PruningPointHeaders() ([]BlockHeader, error)
|
|
PruningPointAndItsAnticoneWithTrustedData() ([]*BlockWithTrustedData, error)
|
|
ClearImportedPruningPointData() error
|
|
AppendImportedPruningPointUTXOs(outpointAndUTXOEntryPairs []*OutpointAndUTXOEntryPair) error
|
|
ValidateAndInsertImportedPruningPoint(newPruningPoint *DomainHash) error
|
|
GetVirtualSelectedParent() (*DomainHash, error)
|
|
CreateBlockLocatorFromPruningPoint(highHash *DomainHash, limit uint32) (BlockLocator, error)
|
|
CreateHeadersSelectedChainBlockLocator(lowHash, highHash *DomainHash) (BlockLocator, error)
|
|
CreateFullHeadersSelectedChainBlockLocator() (BlockLocator, error)
|
|
GetSyncInfo() (*SyncInfo, error)
|
|
Tips() ([]*DomainHash, error)
|
|
GetVirtualInfo() (*VirtualInfo, error)
|
|
GetVirtualDAAScore() (uint64, error)
|
|
IsValidPruningPoint(blockHash *DomainHash) (bool, error)
|
|
ArePruningPointsViolatingFinality(pruningPoints []BlockHeader) (bool, error)
|
|
GetVirtualSelectedParentChainFromBlock(blockHash *DomainHash) (*SelectedChainPath, error)
|
|
IsInSelectedParentChainOf(blockHashA *DomainHash, blockHashB *DomainHash) (bool, error)
|
|
GetHeadersSelectedTip() (*DomainHash, error)
|
|
Anticone(blockHash *DomainHash) ([]*DomainHash, error)
|
|
EstimateNetworkHashesPerSecond(startHash *DomainHash, windowSize int) (uint64, error)
|
|
PopulateMass(transaction *DomainTransaction)
|
|
ResolveVirtual() error
|
|
}
|