Skip to content

Commit

Permalink
Merge branch 'development' into core-sync-latency-based-peer-switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron Hambly committed Feb 8, 2022
2 parents 87e54cb + 74df1d0 commit 9a8011a
Show file tree
Hide file tree
Showing 74 changed files with 1,905 additions and 439 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ node_modules

# ignore output files from windows ISS
buildtools/Output/
/applications/tari_collectibles/src-tauri/data
/applications/tari_collectibles/src-tauri/data

# Asset files
assets/
4 changes: 3 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 25 additions & 9 deletions applications/launchpad/gui-vue/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 @@ -99,4 +99,4 @@ message InvokeMethodRequest{
message InvokeMethodResponse {
string status = 1;
bytes result = 2;
}
}
6 changes: 3 additions & 3 deletions applications/tari_collectibles/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions applications/tari_validator_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = "2018"

[dependencies]
tari_app_utilities = { path = "../tari_app_utilities" }
tari_app_grpc = {path = "../tari_app_grpc" }
tari_app_grpc = { path = "../tari_app_grpc" }
tari_common = { path = "../../common" }
tari_comms = { path = "../../comms" }
tari_comms_dht = { path = "../../comms/dht" }
Expand All @@ -20,10 +20,11 @@ tari_p2p = { path = "../../base_layer/p2p" }
tari_service_framework = { path = "../../base_layer/service_framework" }
tari_shutdown = { path = "../../infrastructure/shutdown" }
tari_storage = { path = "../../infrastructure/storage" }
tari_core = {path = "../../base_layer/core"}
tari_dan_core = {path = "../../dan_layer/core"}
tari_dan_storage_sqlite = {path = "../../dan_layer/storage_sqlite"}
tari_common_types = {path = "../../base_layer/common_types"}
tari_core = { path = "../../base_layer/core" }
tari_dan_core = { path = "../../dan_layer/core" }
tari_dan_storage_sqlite = { path = "../../dan_layer/storage_sqlite" }
tari_dan_common_types = { path = "../../dan_layer/common_types" }
tari_common_types = { path = "../../base_layer/common_types" }

anyhow = "1.0.53"
async-trait = "0.1.50"
Expand All @@ -37,7 +38,7 @@ prost = "0.9"
prost-types = "0.9"
serde = "1.0.126"
thiserror = "^1.0.20"
tokio = { version="1.10", features = ["macros", "time", "sync"]}
tokio = { version = "1.10", features = ["macros", "time", "sync"] }
tokio-stream = { version = "0.1.7", features = ["sync"] }
tonic = "0.6.2"

Expand All @@ -47,7 +48,7 @@ bytecodec = { version = "0.4.14", features = ["bincode_codec"] }
serde_json = "1.0.64"

[dev-dependencies]
tari_test_utils = "0.8.1"
tari_test_utils = { path = "../../infrastructure/test_utils" }

[build-dependencies]
tari_common = { path = "../../common", features = ["build"] }
3 changes: 2 additions & 1 deletion applications/tari_validator_node/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

fn main() -> Result<(), Box<dyn std::error::Error>> {
tari_common::build::ProtobufCompiler::new()
.proto_paths(&["proto/p2p"])
.proto_paths(&["proto/dan"])
.include_paths(&["proto/dan"])
.emit_rerun_if_changed_directives()
.compile()
.unwrap();
Expand Down
27 changes: 27 additions & 0 deletions applications/tari_validator_node/proto/dan/common.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
syntax = "proto3";

package tari.dan.common;

message SideChainBlock {
Node node = 1;
InstructionSet instructions = 2;
}

message Node {
bytes hash = 1;
bytes parent = 2;
uint32 height = 3;
bool is_committed = 4;
}

message Instruction {
uint32 template_id = 1;
string method = 2;
bytes args = 3;
// bytes token_id = 5;
// bytes signature = 6;
}

message InstructionSet{
repeated Instruction instructions = 1;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
syntax = "proto3";

package tari.p2p.dan;
package tari.dan.consensus;

import "common.proto";

enum HotStuffMessageType {
HOT_STUFF_MESSAGE_TYPE_UNKNOWN = 0;
Expand Down Expand Up @@ -41,22 +43,10 @@ message Signature{
}

message TariDanPayload {
InstructionSet instruction_set = 1;
tari.dan.common.InstructionSet instruction_set = 1;
CheckpointData checkpoint = 2;
}

message CheckpointData {
// todo: fill this in
}

message InstructionSet{
repeated Instruction instructions = 1;
}
message Instruction {
bytes asset_public_key = 1;
uint32 template_id = 2;
string method = 3;
bytes args = 4;
// bytes token_id = 5;
// bytes signature = 6;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto3";

package tari.p2p.validator_node;
package tari.dan.validator_node;

import "common.proto";

service ValidatorNode {
rpc GetTokenData(GetTokenDataRequest) returns (GetTokenDataResponse);
Expand Down Expand Up @@ -64,4 +66,15 @@ message InvokeMethodRequest{
message InvokeMethodResponse {
bytes result = 1;
Status status = 2;
}
}

message GetSidechainBlocksRequest {
bytes asset_public_key = 1;
bytes start_hash = 2;
bytes end_hash = 3;
}


message GetSidechainBlocksResponse {
tari.dan.common.SideChainBlock block = 1;
}
25 changes: 11 additions & 14 deletions applications/tari_validator_node/src/dan_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl DanNode {
}
}
info!(target: LOG_TARGET, "Adding asset {:?}", asset.public_key);
let node_identitiy = node_identity.as_ref().clone();
let node_identity = node_identity.as_ref().clone();
let mempool = mempool_service.clone();
let handles = handles.clone();
let subscription_factory = subscription_factory.clone();
Expand All @@ -124,19 +124,16 @@ impl DanNode {
let db_factory = db_factory.clone();
tasks.insert(
asset.public_key.clone(),
task::spawn(async move {
DanNode::start_asset_worker(
asset.clone(),
node_identitiy,
mempool,
handles,
subscription_factory,
shutdown,
dan_config,
db_factory,
)
.await
}),
task::spawn(DanNode::start_asset_worker(
asset.clone(),
node_identity,
mempool,
handles,
subscription_factory,
shutdown,
dan_config,
db_factory,
)),
);
}
}
Expand Down

0 comments on commit 9a8011a

Please sign in to comment.