Use MassCommitment instead of Mass

This commit is contained in:
Ori Newman 2025-01-18 16:03:33 +02:00
parent baa7d1a15f
commit 998d0ce33c
5 changed files with 241 additions and 343 deletions

View File

@ -2,9 +2,10 @@ package appmessage
import (
"encoding/hex"
"github.com/pkg/errors"
"math/big"
"github.com/pkg/errors"
"github.com/kaspanet/kaspad/domain/consensus/utils/blockheader"
"github.com/kaspanet/kaspad/domain/consensus/utils/hashes"
"github.com/kaspanet/kaspad/domain/consensus/utils/utxo"
@ -219,7 +220,7 @@ func RPCTransactionToDomainTransaction(rpcTransaction *RPCTransaction) (*externa
LockTime: rpcTransaction.LockTime,
SubnetworkID: *subnetworkID,
Gas: rpcTransaction.Gas,
Mass: rpcTransaction.Mass, // BPS10 add mass
MassCommitment: rpcTransaction.Mass,
Payload: payload,
}, nil
}
@ -288,7 +289,7 @@ func DomainTransactionToRPCTransaction(transaction *externalapi.DomainTransactio
LockTime: transaction.LockTime,
SubnetworkID: subnetworkID,
Gas: transaction.Gas,
Mass: transaction.Mass, // <<< BPS10 add mass
Mass: transaction.MassCommitment,
Payload: payload,
}
}

View File

@ -20,6 +20,7 @@ type DomainTransaction struct {
Fee uint64
Mass uint64
MassCommitment uint64
// ID is a field that is used to cache the transaction ID.
// Always use consensushashing.TransactionID instead of accessing this field directly

View File

@ -27,7 +27,7 @@ func TransactionHash(tx *externalapi.DomainTransaction) *externalapi.DomainHash
// Encode the header and hash everything prior to the number of
// transactions.
writer := hashes.NewTransactionHashWriter()
err := serializeTransaction(writer, tx, txEncodingFull)
err := serializeTransaction(writer, tx, txEncodingFull, true)
if err != nil {
// It seems like this could only happen if the writer returned an error.
// and this writer should never return an error (no allocations or possible failures)
@ -52,7 +52,7 @@ func TransactionID(tx *externalapi.DomainTransaction) *externalapi.DomainTransac
encodingFlags = txEncodingExcludeSignatureScript
}
writer := hashes.NewTransactionIDWriter()
err := serializeTransaction(writer, tx, encodingFlags)
err := serializeTransaction(writer, tx, encodingFlags, false)
if err != nil {
// this writer never return errors (no allocations or possible failures) so errors can only come from validity checks,
// and we assume we never construct malformed transactions.
@ -74,7 +74,7 @@ func TransactionIDs(txs []*externalapi.DomainTransaction) []*externalapi.DomainT
return txIDs
}
func serializeTransaction(w io.Writer, tx *externalapi.DomainTransaction, encodingFlags txEncoding) error {
func serializeTransaction(w io.Writer, tx *externalapi.DomainTransaction, encodingFlags txEncoding, includeMass bool) error {
err := binaryserializer.PutUint16(w, tx.Version)
if err != nil {
return err
@ -126,12 +126,13 @@ func serializeTransaction(w io.Writer, tx *externalapi.DomainTransaction, encodi
return err
}
if tx.Mass > 0 { // Only serialize Mass if it's not zero
if includeMass {
if tx.MassCommitment > 0 { // For backward compatibility, serialize MassCommitment only if it's not zero
err = binaryserializer.PutUint64(w, tx.Mass)
if err != nil {
return err
}
}
}
return nil

View File

@ -8,9 +8,7 @@ message RequestAddressesMessage{
SubnetworkId subnetworkId = 2;
}
message AddressesMessage{
repeated NetAddress addressList = 1;
}
message AddressesMessage { repeated NetAddress addressList = 1; }
message NetAddress {
int64 timestamp = 1;
@ -18,9 +16,7 @@ message NetAddress{
uint32 port = 4;
}
message SubnetworkId{
bytes bytes = 1;
}
message SubnetworkId { bytes bytes = 1; }
message TransactionMessage {
uint32 version = 1;
@ -30,7 +26,7 @@ message TransactionMessage{
SubnetworkId subnetworkId = 5;
uint64 gas = 6;
bytes payload = 8;
uint64 mass = 9; // <<< BPS10 - Add mass to TransactionMessage
uint64 mass = 9;
}
message TransactionInput {
@ -45,9 +41,7 @@ message Outpoint{
uint32 index = 2;
}
message TransactionId{
bytes bytes = 1;
}
message TransactionId { bytes bytes = 1; }
message ScriptPublicKey {
bytes script = 1;
uint32 version = 2;
@ -78,64 +72,41 @@ message BlockHeader{
uint64 blueScore = 13;
}
message BlockLevelParents {
repeated Hash parentHashes = 1;
}
message BlockLevelParents { repeated Hash parentHashes = 1; }
message Hash{
bytes bytes = 1;
}
message Hash { bytes bytes = 1; }
message RequestBlockLocatorMessage {
Hash highHash = 1;
uint32 limit = 2;
}
message BlockLocatorMessage{
repeated Hash hashes = 1;
}
message BlockLocatorMessage { repeated Hash hashes = 1; }
message RequestHeadersMessage {
Hash lowHash = 1;
Hash highHash = 2;
}
message RequestNextHeadersMessage{
}
message RequestNextHeadersMessage {}
message DoneHeadersMessage{
}
message DoneHeadersMessage {}
message RequestRelayBlocksMessage{
repeated Hash hashes = 1;
}
message RequestRelayBlocksMessage { repeated Hash hashes = 1; }
message RequestTransactionsMessage {
repeated TransactionId ids = 1;
}
message RequestTransactionsMessage { repeated TransactionId ids = 1; }
message TransactionNotFoundMessage{
TransactionId id = 1;
}
message TransactionNotFoundMessage { TransactionId id = 1; }
message InvRelayBlockMessage{
Hash hash = 1;
}
message InvRelayBlockMessage { Hash hash = 1; }
message InvTransactionsMessage{
repeated TransactionId ids = 1;
}
message InvTransactionsMessage { repeated TransactionId ids = 1; }
message PingMessage{
uint64 nonce = 1;
}
message PingMessage { uint64 nonce = 1; }
message PongMessage{
uint64 nonce = 1;
}
message PongMessage { uint64 nonce = 1; }
message VerackMessage{
}
message VerackMessage {}
message VersionMessage {
uint32 protocolVersion = 1;
@ -149,13 +120,9 @@ message VersionMessage{
string network = 10;
}
message RejectMessage{
string reason = 1;
}
message RejectMessage { string reason = 1; }
message RequestPruningPointUTXOSetMessage{
Hash pruningPointHash = 1;
}
message RequestPruningPointUTXOSetMessage { Hash pruningPointHash = 1; }
message PruningPointUtxoSetChunkMessage {
repeated OutpointAndUtxoEntryPair outpointAndUtxoEntryPairs = 1;
@ -173,18 +140,13 @@ message UtxoEntry {
bool isCoinbase = 4;
}
message RequestNextPruningPointUtxoSetChunkMessage {
}
message RequestNextPruningPointUtxoSetChunkMessage {}
message DonePruningPointUtxoSetChunksMessage {
}
message DonePruningPointUtxoSetChunksMessage {}
message RequestIBDBlocksMessage{
repeated Hash hashes = 1;
}
message RequestIBDBlocksMessage { repeated Hash hashes = 1; }
message UnexpectedPruningPointMessage{
}
message UnexpectedPruningPointMessage {}
message IbdBlockLocatorMessage {
Hash targetHash = 1;
@ -196,31 +158,22 @@ message RequestIBDChainBlockLocatorMessage{
Hash highHash = 2;
}
message IbdChainBlockLocatorMessage {
repeated Hash blockLocatorHashes = 1;
}
message IbdChainBlockLocatorMessage { repeated Hash blockLocatorHashes = 1; }
message RequestAnticoneMessage {
Hash blockHash = 1;
Hash contextHash = 2;
}
message IbdBlockLocatorHighestHashMessage {
Hash highestHash = 1;
}
message IbdBlockLocatorHighestHashMessage { Hash highestHash = 1; }
message IbdBlockLocatorHighestHashNotFoundMessage {
}
message IbdBlockLocatorHighestHashNotFoundMessage {}
message BlockHeadersMessage {
repeated BlockHeader blockHeaders = 1;
}
message BlockHeadersMessage { repeated BlockHeader blockHeaders = 1; }
message RequestPruningPointAndItsAnticoneMessage {
}
message RequestPruningPointAndItsAnticoneMessage {}
message RequestNextPruningPointAndItsAnticoneBlocksMessage{
}
message RequestNextPruningPointAndItsAnticoneBlocksMessage {}
message BlockWithTrustedDataMessage {
BlockMessage block = 1;
@ -258,26 +211,19 @@ message BluesAnticoneSizes {
uint32 anticoneSize = 2;
}
message DoneBlocksWithTrustedDataMessage {
}
message DoneBlocksWithTrustedDataMessage {}
message PruningPointsMessage {
repeated BlockHeader headers = 1;
}
message PruningPointsMessage { repeated BlockHeader headers = 1; }
message RequestPruningPointProofMessage {
}
message RequestPruningPointProofMessage {}
message PruningPointProofMessage {
repeated PruningPointProofHeaderArray headers = 1;
}
message PruningPointProofHeaderArray {
repeated BlockHeader headers = 1;
}
message PruningPointProofHeaderArray { repeated BlockHeader headers = 1; }
message ReadyMessage {
}
message ReadyMessage {}
message BlockWithTrustedDataV4Message {
BlockMessage block = 1;

View File

@ -1,11 +1,14 @@
// RPC-related types. Request messages, response messages, and dependant types.
//
// Clients are expected to build RequestMessages and wrap them in KaspadMessage. (see messages.proto)
// Clients are expected to build RequestMessages and wrap them in KaspadMessage.
// (see messages.proto)
//
// Having received a RequestMessage, (wrapped in a KaspadMessage) the RPC server will respond with a
// ResponseMessage (likewise wrapped in a KaspadMessage) respective to the original RequestMessage.
// Having received a RequestMessage, (wrapped in a KaspadMessage) the RPC server
// will respond with a ResponseMessage (likewise wrapped in a KaspadMessage)
// respective to the original RequestMessage.
//
// **IMPORTANT:** This API is a work in progress and is subject to break between versions.
// **IMPORTANT:** This API is a work in progress and is subject to break between
// versions.
//
syntax = "proto3";
package protowire;
@ -14,10 +17,9 @@ option go_package = "github.com/kaspanet/kaspad/protowire";
// RPCError represents a generic non-internal error.
//
// Receivers of any ResponseMessage are expected to check whether its error field is not null.
message RPCError{
string message = 1;
}
// Receivers of any ResponseMessage are expected to check whether its error
// field is not null.
message RPCError { string message = 1; }
message RpcBlock {
RpcBlockHeader header = 1;
@ -40,9 +42,7 @@ message RpcBlockHeader {
uint64 blueScore = 13;
}
message RpcBlockLevelParents {
repeated string parentHashes = 1;
}
message RpcBlockLevelParents { repeated string parentHashes = 1; }
message RpcBlockVerboseData {
string hash = 1;
@ -66,7 +66,7 @@ message RpcTransaction {
uint64 gas = 6;
string payload = 8;
RpcTransactionVerboseData verboseData = 9;
uint64 mass = 10; // <<< BPS10 - Add mass to RpcTransaction
uint64 mass = 10;
}
message RpcTransactionInput {
@ -108,19 +108,18 @@ message RpcTransactionVerboseData{
uint64 blockTime = 14;
}
message RpcTransactionInputVerboseData{
}
message RpcTransactionInputVerboseData {}
message RpcTransactionOutputVerboseData {
string scriptPublicKeyType = 5;
string scriptPublicKeyAddress = 6;
}
// GetCurrentNetworkRequestMessage requests the network kaspad is currently running against.
// GetCurrentNetworkRequestMessage requests the network kaspad is currently
// running against.
//
// Possible networks are: Mainnet, Testnet, Simnet, Devnet
message GetCurrentNetworkRequestMessage{
}
message GetCurrentNetworkRequestMessage {}
message GetCurrentNetworkResponseMessage {
string currentNetwork = 1;
@ -128,7 +127,8 @@ message GetCurrentNetworkResponseMessage{
}
// SubmitBlockRequestMessage requests to submit a block into the DAG.
// Blocks are generally expected to have been generated using the getBlockTemplate call.
// Blocks are generally expected to have been generated using the
// getBlockTemplate call.
//
// See: GetBlockTemplateRequestMessage
message SubmitBlockRequestMessage {
@ -147,7 +147,8 @@ message SubmitBlockResponseMessage{
}
// GetBlockTemplateRequestMessage requests a current block template.
// Callers are expected to solve the block template and submit it using the submitBlock call
// Callers are expected to solve the block template and submit it using the
// submitBlock call
//
// See: SubmitBlockRequestMessage
message GetBlockTemplateRequestMessage {
@ -160,36 +161,32 @@ message GetBlockTemplateResponseMessage{
RpcBlock block = 3;
// Whether kaspad thinks that it's synced.
// Callers are discouraged (but not forbidden) from solving blocks when kaspad is not synced.
// That is because when kaspad isn't in sync with the rest of the network there's a high
// chance the block will never be accepted, thus the solving effort would have been wasted.
// Callers are discouraged (but not forbidden) from solving blocks when kaspad
// is not synced. That is because when kaspad isn't in sync with the rest of
// the network there's a high chance the block will never be accepted, thus
// the solving effort would have been wasted.
bool isSynced = 2;
RPCError error = 1000;
}
// NotifyBlockAddedRequestMessage registers this connection for blockAdded notifications.
// NotifyBlockAddedRequestMessage registers this connection for blockAdded
// notifications.
//
// See: BlockAddedNotificationMessage
message NotifyBlockAddedRequestMessage{
}
message NotifyBlockAddedRequestMessage {}
message NotifyBlockAddedResponseMessage{
RPCError error = 1000;
}
message NotifyBlockAddedResponseMessage { RPCError error = 1000; }
// BlockAddedNotificationMessage is sent whenever a blocks has been added (NOT accepted)
// into the DAG.
// BlockAddedNotificationMessage is sent whenever a blocks has been added (NOT
// accepted) into the DAG.
//
// See: NotifyBlockAddedRequestMessage
message BlockAddedNotificationMessage{
RpcBlock block = 3;
}
message BlockAddedNotificationMessage { RpcBlock block = 3; }
// GetPeerAddressesRequestMessage requests the list of known kaspad addresses in the
// current network. (mainnet, testnet, etc.)
message GetPeerAddressesRequestMessage{
}
// GetPeerAddressesRequestMessage requests the list of known kaspad addresses in
// the current network. (mainnet, testnet, etc.)
message GetPeerAddressesRequestMessage {}
message GetPeerAddressesResponseMessage {
repeated GetPeerAddressesKnownAddressMessage addresses = 1;
@ -197,22 +194,19 @@ message GetPeerAddressesResponseMessage{
RPCError error = 1000;
}
message GetPeerAddressesKnownAddressMessage {
string Addr = 1;
}
message GetPeerAddressesKnownAddressMessage { string Addr = 1; }
// GetSelectedTipHashRequestMessage requests the hash of the current virtual's
// selected parent.
message GetSelectedTipHashRequestMessage{
}
message GetSelectedTipHashRequestMessage {}
message GetSelectedTipHashResponseMessage {
string selectedTipHash = 1;
RPCError error = 1000;
}
// GetMempoolEntryRequestMessage requests information about a specific transaction
// in the mempool.
// GetMempoolEntryRequestMessage requests information about a specific
// transaction in the mempool.
message GetMempoolEntryRequestMessage {
// The transaction's TransactionID.
string txId = 1;
@ -226,8 +220,8 @@ message GetMempoolEntryResponseMessage{
RPCError error = 1000;
}
// GetMempoolEntriesRequestMessage requests information about all the transactions
// currently in the mempool.
// GetMempoolEntriesRequestMessage requests information about all the
// transactions currently in the mempool.
message GetMempoolEntriesRequestMessage {
bool includeOrphanPool = 1;
bool filterTransactionPool = 2;
@ -245,10 +239,9 @@ message MempoolEntry{
bool isOrphan = 4;
}
// GetConnectedPeerInfoRequestMessage requests information about all the p2p peers
// currently connected to this kaspad.
message GetConnectedPeerInfoRequestMessage{
}
// GetConnectedPeerInfoRequestMessage requests information about all the p2p
// peers currently connected to this kaspad.
message GetConnectedPeerInfoRequestMessage {}
message GetConnectedPeerInfoResponseMessage {
repeated GetConnectedPeerInfoMessage infos = 1;
@ -286,9 +279,7 @@ message AddPeerRequestMessage{
bool isPermanent = 2;
}
message AddPeerResponseMessage{
RPCError error = 1000;
}
message AddPeerResponseMessage { RPCError error = 1000; }
// SubmitTransactionRequestMessage submits a transaction to the mempool
message SubmitTransactionRequestMessage {
@ -303,7 +294,8 @@ message SubmitTransactionResponseMessage{
RPCError error = 1000;
}
// NotifyVirtualSelectedParentChainChangedRequestMessage registers this connection for virtualSelectedParentChainChanged notifications.
// NotifyVirtualSelectedParentChainChangedRequestMessage registers this
// connection for virtualSelectedParentChainChanged notifications.
//
// See: VirtualSelectedParentChainChangedNotificationMessage
message NotifyVirtualSelectedParentChainChangedRequestMessage {
@ -314,8 +306,8 @@ message NotifyVirtualSelectedParentChainChangedResponseMessage{
RPCError error = 1000;
}
// VirtualSelectedParentChainChangedNotificationMessage is sent whenever the DAG's selected parent
// chain had changed.
// VirtualSelectedParentChainChangedNotificationMessage is sent whenever the
// DAG's selected parent chain had changed.
//
// See: NotifyVirtualSelectedParentChainChangedRequestMessage
message VirtualSelectedParentChainChangedNotificationMessage {
@ -325,7 +317,8 @@ message VirtualSelectedParentChainChangedNotificationMessage{
// The chain blocks that were added, in low-to-high order
repeated string addedChainBlockHashes = 3;
// Will be filled only if `includeAcceptedTransactionIds = true` in the notify request.
// Will be filled only if `includeAcceptedTransactionIds = true` in the notify
// request.
repeated AcceptedTransactionIds acceptedTransactionIds = 2;
}
@ -346,17 +339,15 @@ message GetBlockResponseMessage{
// GetSubnetworkRequestMessage requests information about a specific subnetwork
//
// Currently unimplemented
message GetSubnetworkRequestMessage{
string subnetworkId = 1;
}
message GetSubnetworkRequestMessage { string subnetworkId = 1; }
message GetSubnetworkResponseMessage {
uint64 gasLimit = 1;
RPCError error = 1000;
}
// GetVirtualSelectedParentChainFromBlockRequestMessage requests the virtual selected
// parent chain from some startHash to this kaspad's current virtual
// GetVirtualSelectedParentChainFromBlockRequestMessage requests the virtual
// selected parent chain from some startHash to this kaspad's current virtual
message GetVirtualSelectedParentChainFromBlockRequestMessage {
string startHash = 1;
bool includeAcceptedTransactionIds = 2;
@ -375,14 +366,15 @@ message GetVirtualSelectedParentChainFromBlockResponseMessage{
repeated string addedChainBlockHashes = 3;
// The transactions accepted by each block in addedChainBlockHashes.
// Will be filled only if `includeAcceptedTransactionIds = true` in the request.
// Will be filled only if `includeAcceptedTransactionIds = true` in the
// request.
repeated AcceptedTransactionIds acceptedTransactionIds = 2;
RPCError error = 1000;
}
// GetBlocksRequestMessage requests blocks between a certain block lowHash up to this
// kaspad's current virtual.
// GetBlocksRequestMessage requests blocks between a certain block lowHash up to
// this kaspad's current virtual.
message GetBlocksRequestMessage {
string lowHash = 1;
bool includeBlocks = 2;
@ -395,10 +387,9 @@ message GetBlocksResponseMessage{
RPCError error = 1000;
}
// GetBlockCountRequestMessage requests the current number of blocks in this kaspad.
// Note that this number may decrease as pruning occurs.
message GetBlockCountRequestMessage{
}
// GetBlockCountRequestMessage requests the current number of blocks in this
// kaspad. Note that this number may decrease as pruning occurs.
message GetBlockCountRequestMessage {}
message GetBlockCountResponseMessage {
uint64 blockCount = 1;
@ -406,10 +397,9 @@ message GetBlockCountResponseMessage{
RPCError error = 1000;
}
// GetBlockDagInfoRequestMessage requests general information about the current state
// of this kaspad's DAG.
message GetBlockDagInfoRequestMessage{
}
// GetBlockDagInfoRequestMessage requests general information about the current
// state of this kaspad's DAG.
message GetBlockDagInfoRequestMessage {}
message GetBlockDagInfoResponseMessage {
string networkName = 1;
@ -424,36 +414,24 @@ message GetBlockDagInfoResponseMessage{
RPCError error = 1000;
}
message ResolveFinalityConflictRequestMessage{
string finalityBlockHash = 1;
}
message ResolveFinalityConflictRequestMessage { string finalityBlockHash = 1; }
message ResolveFinalityConflictResponseMessage{
RPCError error = 1000;
}
message ResolveFinalityConflictResponseMessage { RPCError error = 1000; }
message NotifyFinalityConflictsRequestMessage{
}
message NotifyFinalityConflictsRequestMessage {}
message NotifyFinalityConflictsResponseMessage{
RPCError error = 1000;
}
message NotifyFinalityConflictsResponseMessage { RPCError error = 1000; }
message FinalityConflictNotificationMessage{
string violatingBlockHash = 1;
}
message FinalityConflictNotificationMessage { string violatingBlockHash = 1; }
message FinalityConflictResolvedNotificationMessage {
string finalityBlockHash = 1;
}
// ShutDownRequestMessage shuts down this kaspad.
message ShutDownRequestMessage{
}
message ShutDownRequestMessage {}
message ShutDownResponseMessage{
RPCError error = 1000;
}
message ShutDownResponseMessage { RPCError error = 1000; }
// GetHeadersRequestMessage requests headers between the given startHash and the
// current virtual, up to the given limit.
@ -468,8 +446,8 @@ message GetHeadersResponseMessage{
RPCError error = 1000;
}
// NotifyUtxosChangedRequestMessage registers this connection for utxoChanged notifications
// for the given addresses.
// NotifyUtxosChangedRequestMessage registers this connection for utxoChanged
// notifications for the given addresses.
//
// This call is only available when this kaspad was started with `--utxoindex`
//
@ -478,11 +456,10 @@ message NotifyUtxosChangedRequestMessage {
repeated string addresses = 1; // Leave empty to get all updates
}
message NotifyUtxosChangedResponseMessage {
RPCError error = 1000;
}
message NotifyUtxosChangedResponseMessage { RPCError error = 1000; }
// UtxosChangedNotificationMessage is sent whenever the UTXO index had been updated.
// UtxosChangedNotificationMessage is sent whenever the UTXO index had been
// updated.
//
// See: NotifyUtxosChangedRequestMessage
message UtxosChangedNotificationMessage {
@ -496,8 +473,8 @@ message UtxosByAddressesEntry {
RpcUtxoEntry utxoEntry = 3;
}
// StopNotifyingUtxosChangedRequestMessage unregisters this connection for utxoChanged notifications
// for the given addresses.
// StopNotifyingUtxosChangedRequestMessage unregisters this connection for
// utxoChanged notifications for the given addresses.
//
// This call is only available when this kaspad was started with `--utxoindex`
//
@ -506,16 +483,13 @@ message StopNotifyingUtxosChangedRequestMessage {
repeated string addresses = 1;
}
message StopNotifyingUtxosChangedResponseMessage {
RPCError error = 1000;
}
message StopNotifyingUtxosChangedResponseMessage { RPCError error = 1000; }
// GetUtxosByAddressesRequestMessage requests all current UTXOs for the given kaspad addresses
// GetUtxosByAddressesRequestMessage requests all current UTXOs for the given
// kaspad addresses
//
// This call is only available when this kaspad was started with `--utxoindex`
message GetUtxosByAddressesRequestMessage {
repeated string addresses = 1;
}
message GetUtxosByAddressesRequestMessage { repeated string addresses = 1; }
message GetUtxosByAddressesResponseMessage {
repeated UtxosByAddressesEntry entries = 1;
@ -523,12 +497,11 @@ message GetUtxosByAddressesResponseMessage {
RPCError error = 1000;
}
// GetBalanceByAddressRequest returns the total balance in unspent transactions towards a given address
// GetBalanceByAddressRequest returns the total balance in unspent transactions
// towards a given address
//
// This call is only available when this kaspad was started with `--utxoindex`
message GetBalanceByAddressRequestMessage {
string address = 1;
}
message GetBalanceByAddressRequestMessage { string address = 1; }
message GetBalanceByAddressResponseMessage {
uint64 balance = 1;
@ -536,9 +509,7 @@ message GetBalanceByAddressResponseMessage {
RPCError error = 1000;
}
message GetBalancesByAddressesRequestMessage {
repeated string addresses = 1;
}
message GetBalancesByAddressesRequestMessage { repeated string addresses = 1; }
message BalancesByAddressEntry {
string address = 1;
@ -553,10 +524,9 @@ message GetBalancesByAddressesResponseMessage {
RPCError error = 1000;
}
// GetVirtualSelectedParentBlueScoreRequestMessage requests the blue score of the current selected parent
// of the virtual block.
message GetVirtualSelectedParentBlueScoreRequestMessage {
}
// GetVirtualSelectedParentBlueScoreRequestMessage requests the blue score of
// the current selected parent of the virtual block.
message GetVirtualSelectedParentBlueScoreRequestMessage {}
message GetVirtualSelectedParentBlueScoreResponseMessage {
uint64 blueScore = 1;
@ -564,19 +534,18 @@ message GetVirtualSelectedParentBlueScoreResponseMessage {
RPCError error = 1000;
}
// NotifyVirtualSelectedParentBlueScoreChangedRequestMessage registers this connection for
// virtualSelectedParentBlueScoreChanged notifications.
// NotifyVirtualSelectedParentBlueScoreChangedRequestMessage registers this
// connection for virtualSelectedParentBlueScoreChanged notifications.
//
// See: VirtualSelectedParentBlueScoreChangedNotificationMessage
message NotifyVirtualSelectedParentBlueScoreChangedRequestMessage {
}
message NotifyVirtualSelectedParentBlueScoreChangedRequestMessage {}
message NotifyVirtualSelectedParentBlueScoreChangedResponseMessage {
RPCError error = 1000;
}
// VirtualSelectedParentBlueScoreChangedNotificationMessage is sent whenever the blue score
// of the virtual's selected parent changes.
// VirtualSelectedParentBlueScoreChangedNotificationMessage is sent whenever the
// blue score of the virtual's selected parent changes.
//
// See NotifyVirtualSelectedParentBlueScoreChangedRequestMessage
message VirtualSelectedParentBlueScoreChangedNotificationMessage {
@ -587,12 +556,9 @@ message VirtualSelectedParentBlueScoreChangedNotificationMessage {
// virtualDaaScoreChanged notifications.
//
// See: VirtualDaaScoreChangedNotificationMessage
message NotifyVirtualDaaScoreChangedRequestMessage {
}
message NotifyVirtualDaaScoreChangedRequestMessage {}
message NotifyVirtualDaaScoreChangedResponseMessage {
RPCError error = 1000;
}
message NotifyVirtualDaaScoreChangedResponseMessage { RPCError error = 1000; }
// VirtualDaaScoreChangedNotificationMessage is sent whenever the DAA score
// of the virtual changes.
@ -608,55 +574,42 @@ message VirtualDaaScoreChangedNotificationMessage {
// This call is only available when this kaspad was started with `--utxoindex`
//
// See: NotifyPruningPointUTXOSetOverrideResponseMessage
message NotifyPruningPointUTXOSetOverrideRequestMessage {
}
message NotifyPruningPointUTXOSetOverrideRequestMessage {}
message NotifyPruningPointUTXOSetOverrideResponseMessage {
RPCError error = 1000;
}
// PruningPointUTXOSetOverrideNotificationMessage is sent whenever the UTXO index
// resets due to pruning point change via IBD.
// PruningPointUTXOSetOverrideNotificationMessage is sent whenever the UTXO
// index resets due to pruning point change via IBD.
//
// See NotifyPruningPointUTXOSetOverrideRequestMessage
message PruningPointUTXOSetOverrideNotificationMessage {
}
message PruningPointUTXOSetOverrideNotificationMessage {}
// StopNotifyingPruningPointUTXOSetOverrideRequestMessage unregisters this connection for
// pruning point UTXO set override notifications.
// StopNotifyingPruningPointUTXOSetOverrideRequestMessage unregisters this
// connection for pruning point UTXO set override notifications.
//
// This call is only available when this kaspad was started with `--utxoindex`
//
// See: PruningPointUTXOSetOverrideNotificationMessage
message StopNotifyingPruningPointUTXOSetOverrideRequestMessage {
}
message StopNotifyingPruningPointUTXOSetOverrideRequestMessage {}
message StopNotifyingPruningPointUTXOSetOverrideResponseMessage {
RPCError error = 1000;
}
// BanRequestMessage bans the given ip.
message BanRequestMessage{
string ip = 1;
}
message BanRequestMessage { string ip = 1; }
message BanResponseMessage{
RPCError error = 1000;
}
message BanResponseMessage { RPCError error = 1000; }
// UnbanRequestMessage unbans the given ip.
message UnbanRequestMessage{
string ip = 1;
}
message UnbanRequestMessage { string ip = 1; }
message UnbanResponseMessage{
RPCError error = 1000;
}
message UnbanResponseMessage { RPCError error = 1000; }
// GetInfoRequestMessage returns info about the node.
message GetInfoRequestMessage{
}
message GetInfoRequestMessage {}
message GetInfoResponseMessage {
string p2pId = 1;
@ -681,19 +634,15 @@ message EstimateNetworkHashesPerSecondResponseMessage{
// NewBlockTemplate notifications.
//
// See: NewBlockTemplateNotificationMessage
message NotifyNewBlockTemplateRequestMessage {
}
message NotifyNewBlockTemplateRequestMessage {}
message NotifyNewBlockTemplateResponseMessage {
RPCError error = 1000;
}
message NotifyNewBlockTemplateResponseMessage { RPCError error = 1000; }
// NewBlockTemplateNotificationMessage is sent whenever a new updated block template is
// available for miners.
// NewBlockTemplateNotificationMessage is sent whenever a new updated block
// template is available for miners.
//
// See NotifyNewBlockTemplateRequestMessage
message NewBlockTemplateNotificationMessage {
}
message NewBlockTemplateNotificationMessage {}
message MempoolEntryByAddress {
string address = 1;
@ -713,18 +662,18 @@ message GetMempoolEntriesByAddressesResponseMessage{
RPCError error = 1000;
}
message GetCoinSupplyRequestMessage{
}
message GetCoinSupplyRequestMessage {}
message GetCoinSupplyResponseMessage {
uint64 maxSompi = 1; // note: this is a hard coded maxSupply, actual maxSupply is expected to deviate by upto -5%, but cannot be measured exactly.
uint64 maxSompi =
1; // note: this is a hard coded maxSupply, actual maxSupply is expected
// to deviate by upto -5%, but cannot be measured exactly.
uint64 circulatingSompi = 2;
RPCError error = 1000;
}
message PingRequestMessage{
}
message PingRequestMessage {}
message PingResponseMessage { RPCError error = 1000; }