Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: merges feature-dan into development #4913

Merged
merged 35 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2252f6a
chore: merge development into feature-dan (#4496)
stringhandler Aug 18, 2022
9153f9a
chore: development merge
stringhandler Aug 29, 2022
8ee5a05
feat(core): add template registration sidechain features (#4470)
sdbondi Aug 29, 2022
96a30c1
feat: add validator node registration (#4507)
Cifko Sep 6, 2022
0fd3256
feat: add grpc to get shard key for public key (#4654)
Cifko Sep 12, 2022
2772ec4
Merge branch 'development' into dev-merge
sdbondi Sep 16, 2022
b117861
fix merge issues
sdbondi Sep 16, 2022
d9a0d79
Merge pull request #4687 from sdbondi/dev-merge
stringhandler Sep 16, 2022
0fef174
feat(core): add validator registration sidechain feature (#4690)
sdbondi Sep 16, 2022
613b655
fix(core): bring validator node MR inline with other merkle root code…
sdbondi Sep 20, 2022
87765a2
Merge branch 'development' into feature-dan
stringhandler Sep 20, 2022
e7f2d34
fix after merge
stringhandler Sep 21, 2022
cfa05be
feat(base_node_grpc_client): add getActiveValidatorNodes method (#4719)
mrnaveira Sep 23, 2022
e3a4af2
Merge branch 'development' into feature-dan
stringhandler Sep 26, 2022
72018f4
fix: fix validator node registration logic (#4718)
stringhandler Sep 27, 2022
27f77b2
feat(core): store and fetch templates from lmdb (#4726)
mrnaveira Sep 27, 2022
3a4dd50
fix: fix get shard key (#4744)
stringhandler Sep 30, 2022
73976e3
Merge branch 'development' into merge-feature-dan-development
sdbondi Oct 3, 2022
98c6fe7
Merge pull request #4764 from sdbondi/merge-feature-dan-development
stringhandler Oct 5, 2022
788889b
Merge branch 'development' into feature-dan
stringhandler Oct 5, 2022
4060935
fix(wallet/grpc): add transaction id and template_address to template…
sdbondi Oct 11, 2022
64002e9
fix: computation of vn mmr (#4772)
Cifko Oct 11, 2022
9e81c7b
fix(core)!: adds utxo and block info to get_template_registrations re…
sdbondi Oct 11, 2022
2dbceaa
refactor: split tari_base_node and tari_console_wallet into a lib com…
mrnaveira Oct 19, 2022
ce35b65
chore: merge development into feature-dan (#4815)
sdbondi Oct 19, 2022
ce6c22f
feat: add missing fields to grpc consensus constants interface (#4845)
jorgeantonio21 Oct 25, 2022
df5d78e
fix: remove unused config for validator node (#4849)
sdbondi Oct 25, 2022
23b4313
feat: add block height to input request to get network consensus cons…
jorgeantonio21 Oct 26, 2022
371855c
Merge branch 'development' into merge-dev-feature-dan
sdbondi Nov 7, 2022
bd49bf2
fix: correct value for validator_node_timeout consensus constant in l…
mrnaveira Nov 7, 2022
40f4f6a
Merge branch 'feature-dan' into merge-dev-feature-dan
sdbondi Nov 7, 2022
392d541
fix(core)!: remove unused get_committees call from base node (#4880)
sdbondi Nov 7, 2022
1c3eff1
Merge pull request #4895 from sdbondi/merge-dev-feature-dan
stringhandler Nov 7, 2022
62e3256
Merge branch 'feature-dan' into merge-feature-dan
sdbondi Nov 14, 2022
d3b1523
bad merge: remove tracing
sdbondi Nov 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 53 additions & 2 deletions applications/tari_app_grpc/proto/base_node.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import "types.proto";
import "transaction.proto";
import "block.proto";
import "network.proto";
import "sidechain_types.proto";

package tari.rpc;

Expand All @@ -39,7 +40,7 @@ service BaseNode {
// Returns the block timing for the chain heights
rpc GetBlockTiming(HeightRequest) returns (BlockTimingResponse);
// Returns the network Constants
rpc GetConstants(Empty) returns (ConsensusConstants);
rpc GetConstants(BlockHeight) returns (ConsensusConstants);
// Returns Block Sizes
rpc GetBlockSize (BlockGroupRequest) returns (BlockGroupResponse);
// Returns Block Fees
Expand Down Expand Up @@ -88,7 +89,12 @@ service BaseNode {
rpc ListConnectedPeers(Empty) returns (ListConnectedPeersResponse);
// Get mempool stats
rpc GetMempoolStats(Empty) returns (MempoolStatsResponse);

// Get VNs
rpc GetActiveValidatorNodes(GetActiveValidatorNodesRequest) returns (stream GetActiveValidatorNodesResponse);
rpc GetShardKey(GetShardKeyRequest) returns (GetShardKeyResponse);
// Get templates
rpc GetTemplateRegistrations(GetTemplateRegistrationsRequest) returns (stream GetTemplateRegistrationResponse);
rpc GetSideChainUtxos(GetSideChainUtxosRequest) returns (stream GetSideChainUtxosResponse);
}

message GetAssetMetadataRequest {
Expand Down Expand Up @@ -435,3 +441,48 @@ message MempoolStatsResponse {
uint64 unconfirmed_weight = 4;
}

message GetActiveValidatorNodesRequest {
uint64 height = 1;
}

message GetActiveValidatorNodesResponse {
bytes shard_key = 1;
bytes public_key = 2;
}

message GetShardKeyRequest {
uint64 height = 1;
bytes public_key = 2;
}

message GetShardKeyResponse {
bytes shard_key = 1;
bool found = 2;
}

message GetTemplateRegistrationsRequest {
bytes start_hash = 1;
uint64 count = 2;
}

message GetTemplateRegistrationResponse {
bytes utxo_hash = 1;
TemplateRegistration registration = 2;
}

message BlockInfo {
uint64 height = 1;
bytes hash = 2;
bytes next_block_hash = 3;
}

message GetSideChainUtxosRequest {
bytes start_hash = 1;
uint64 count = 2;
}

message GetSideChainUtxosResponse {
BlockInfo block_info = 1;
repeated TransactionOutput outputs = 2;
}

2 changes: 2 additions & 0 deletions applications/tari_app_grpc/proto/block.proto
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ message BlockHeader {
uint64 output_mmr_size = 14;
// Sum of script offsets for all kernels in this block.
bytes total_script_offset = 15;
// Merkle root of validator nodes
bytes validator_node_mr = 16;
}

// Metadata required for validating the Proof of Work calculation
Expand Down
39 changes: 38 additions & 1 deletion applications/tari_app_grpc/proto/sidechain_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,42 @@ syntax = "proto3";

package tari.rpc;

message SideChainFeatures {
import "types.proto";

message SideChainFeature {
oneof side_chain_feature {
ValidatorNodeRegistration validator_node_registration = 1;
TemplateRegistration template_registration = 2;
}
}

message ValidatorNodeRegistration {
bytes public_key = 1;
Signature signature = 2;
}

message TemplateRegistration {
bytes author_public_key = 1;
Signature author_signature = 2;
string template_name = 3;
uint32 template_version = 4;
TemplateType template_type = 5;
BuildInfo build_info = 6;
bytes binary_sha = 7;
string binary_url = 8;
}

message TemplateType {
oneof template_type {
WasmInfo wasm = 1;
}
}

message WasmInfo {
uint32 abi_version = 1;
}

message BuildInfo {
string repo_url = 1;
bytes commit_hash = 2;
}
2 changes: 1 addition & 1 deletion applications/tari_app_grpc/proto/transaction.proto
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ message OutputFeatures {
// require a min maturity of the Coinbase_lock_height, this should be checked on receiving new blocks.
uint64 maturity = 3;
bytes metadata = 4;
SideChainFeatures sidechain_features = 5;
SideChainFeature sidechain_feature = 5;
}


Expand Down
65 changes: 65 additions & 0 deletions applications/tari_app_grpc/proto/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,20 @@ syntax = "proto3";

package tari.rpc;

/// An unsigned range interface to more accurately represent Rust native Range's
message Range {
uint64 min = 1;
uint64 max = 2;
}

/// An Empty placeholder for endpoints without request parameters
message Empty {}

/// Define an interface for block height
message BlockHeight {
uint64 block_height = 1;
}

// Define the explicit Signature implementation for the Tari base layer. A different signature scheme can be
// employed by redefining this type.
message Signature {
Expand All @@ -41,6 +52,36 @@ message ComSignature {
bytes signature_v = 3;
}

/// PoW Algorithm constants
message PowAlgorithmConstants {
uint64 max_target_time = 1;
uint64 min_difficulty = 2;
uint64 max_difficulty = 3;
uint64 target_time = 4;
}

/// Weight params
message WeightParams {
uint64 kernel_weight = 1;
uint64 input_weight = 2;
uint64 output_weight = 3;
uint64 metadata_bytes_per_gram = 4;
}

/// Output version
message OutputsVersion {
Range outputs = 1;
Range features = 2;
}

/// Output types
enum OutputType {
STANDARD = 0;
COINBASE = 1;
BURN = 2;
VALIDATOR_NODE_REGISTRATION = 3;
CODE_TEMPLATE_REGISTRATION = 4;
}

/// Consensus Constants response
message ConsensusConstants {
Expand Down Expand Up @@ -76,4 +117,28 @@ message ConsensusConstants {
uint64 block_weight_outputs = 15;
/// Block weight for kernels
uint64 block_weight_kernels = 16;
/// This is to keep track of the value inside of the genesis block
uint64 faucet_value = 17;
/// Maximum byte size of TariScript
uint64 max_script_byte_size = 18;
/// How long does it take to timeout validator node registration
uint64 validator_node_timeout = 19;
/// The height at which these constants become effective
uint64 effective_from_height = 20;
/// Current version of the blockchain
Range valid_blockchain_version_range = 21;
/// This is the maximum age a monero merge mined seed can be reused
uint64 max_randomx_seed_height = 22;
/// This keeps track of the block split targets and which algo is accepted
map<uint32, PowAlgorithmConstants> proof_of_work = 23;
/// Transaction Weight params
WeightParams transaction_weight = 24;
/// Range of valid transaction input versions
Range input_version_range = 26;
/// Range of valid transaction output (and features) versions
OutputsVersion output_version_range = 27;
/// Range of valid transaction kernel versions
Range kernel_version_range = 28;
/// An allowlist of output types
repeated OutputType permitted_output_types = 29;
}
2 changes: 1 addition & 1 deletion applications/tari_app_grpc/proto/validator_node.proto
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ message Authority {
bytes proxied_by = 3;
}

message InvokeMethodRequest{
message InvokeMethodRequest {
bytes contract_id = 1;
uint32 template_id = 2;
string method = 3;
Expand Down
28 changes: 28 additions & 0 deletions applications/tari_app_grpc/proto/wallet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ service Wallet {
rpc ClaimShaAtomicSwapTransaction(ClaimShaAtomicSwapRequest) returns (ClaimShaAtomicSwapResponse);
// This will claim a HTLC refund transaction
rpc ClaimHtlcRefundTransaction(ClaimHtlcRefundRequest) returns (ClaimHtlcRefundResponse);
// Creates a transaction with a template registration output
rpc CreateTemplateRegistration(CreateTemplateRegistrationRequest) returns (CreateTemplateRegistrationResponse);
rpc SetBaseNode(SetBaseNodeRequest) returns (SetBaseNodeResponse);

rpc StreamTransactionEvents(TransactionEventRequest) returns (stream TransactionEventResponse);

rpc RegisterValidatorNode(RegisterValidatorNodeRequest) returns (RegisterValidatorNodeResponse);
}

message GetVersionRequest { }
Expand All @@ -97,6 +101,7 @@ message CreateBurnTransactionRequest{
string message = 3;
}


message PaymentRecipient {
string address = 1;
uint64 amount = 2;
Expand Down Expand Up @@ -257,6 +262,16 @@ message ImportUtxosResponse {
repeated uint64 tx_ids = 1;
}

message CreateTemplateRegistrationRequest {
TemplateRegistration template_registration = 1;
uint64 fee_per_gram = 2;
}

message CreateTemplateRegistrationResponse {
uint64 tx_id = 1;
bytes template_address = 2;
}

message CancelTransactionRequest {
uint64 tx_id = 1;
}
Expand Down Expand Up @@ -307,3 +322,16 @@ message TransactionEvent {
message TransactionEventResponse {
TransactionEvent transaction = 1;
}

message RegisterValidatorNodeRequest {
bytes validator_node_public_key = 1;
Signature validator_node_signature = 2;
uint64 fee_per_gram = 3;
string message = 4;
}

message RegisterValidatorNodeResponse {
uint64 transaction_id = 1;
bool is_success = 2;
string failure_message = 3;
}
2 changes: 2 additions & 0 deletions applications/tari_app_grpc/src/conversions/block_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ impl From<BlockHeader> for grpc::BlockHeader {
pow_algo: pow_algo.as_u64(),
pow_data: h.pow.pow_data,
}),
validator_node_mr: h.validator_node_mr.to_vec(),
}
}
}
Expand Down Expand Up @@ -91,6 +92,7 @@ impl TryFrom<grpc::BlockHeader> for BlockHeader {
total_script_offset,
nonce: header.nonce,
pow,
validator_node_mr: FixedHash::try_from(header.validator_node_mr).map_err(|err| err.to_string())?,
})
}
}
Loading