tari-project / tari-dan Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
Currently, all proposals only use the PayloadId. The payload is distributed via the NewView messages. The problem is that a VN may receive a proposal, but have not yet received the payload via mempool. NewView messages are only sent to the leader of the round, so it would not have received it that way either.
One way to solve this is to send another message to the nodes, but maybe a good solution is to just include the full payload in the first proposal (i.e. when PayloadHeight = 0)
The config file generated when starting the validator node has all the settings from the base layer. These are unnecessary and misleading
Protocol
sequenceDiagram
Alice->>+Bob: msg_a
Bob-->>Alice: Ack(msg_a)
sequenceDiagram
Alice-->>Bob: delayed msg_b
Alice->>Bob: ack timeout, resend msg_b
Bob-->>Alice: Ack(msg_b) (confirmed)
Bob-->>Alice: delayed Ack(msg_b) (Alice ignores)
Acceptance criteria:
To reproduce:
// use tari_template_macros::template;
//
// #[template]
// mod counter {
// pub struct Counter {
// value: u32,
// }
//
// impl Counter {
// pub fn new() -> Self {
// Self { value: 0 }
// }
//
// pub fn value(&self) -> u32 {
// self.value
// }
//
// pub fn increase(&mut self) {
// self.value += 1;
// }
// }
// }
new
Expected: transaction is processed
Expected: transaction is removed from mempool
Actual: transaction is still in mempool.
Acceptance criteria:
Specificallly, we need:
validator_node_timeout
(To be used to know when to reregister)Currently, validator node registration UTXOs are not stored.
The validator_nodes table already exists.
File: https://github.com/tari-project/tari-dan/blob/development/README.md needs to be rewritten
When the vn starts up, it starts a web server on port 6000.
It uses the jsonrpc (with javascript) to display stats of the validator node, including:
currently it panics
Submitting a transaction sometimes results in
09:53 ERROR Error while processing new payload (on_next_sync_view): Epoch manager error: No epoch found Epoch(0)
VN should require an explicit initial registration, once registered, it should auto re-register (enabled via configuration)
Acceptance criteria:
./validator_node_cli register
Download and store template binary - only http urls need to be supported for now
Blocked by "[base-layer-scanner] detect and store info about code templates on base layer"
Acceptance criteria:
template_store/[author_public_key]/[binary_hash].wasm
valid
otherwise invalid
Current status: Currently download to sql database, we should abstract wasm template storage from the template manager and use the above file structure.
Urls are in multiaddr form on the base layer e.g /dns4/github.com/tcp/443/http/tari-project/wasm_examples/releases/download/v0.0.6/erc20.wasm
(typed as a string because rust multiaddr does not support the entire multiaddr spec (http paths) :/) however this is given as is to reqwest. Multiaddr is preferable because it supports ipfs, p2p links etc.
As a hack for now, we can look for /http and parse the first part as a multiaddr and the second part as a path
fn parse_http_multiaddr(s: &str) -> Result<(Multiaddr, String)>
The memory shard db was useful for unit tests, but it is duplicate code of the sqlite shard transaction.
I suggest removing the memory db and instead using a TempDb like we do in the base layer for unit tests.
This will test more of the functionality instead of testing the mocked memory db.
Note: Each test should create a random temp file and it should be deleted after every test
The base layer scanner stores the height so that it doesn't scan the base layer over and over. It should also save the vns that it scanned, otherwise when it starts again it will not have the data.
Acceptance criteria:
This also means we can retry downloads by UPDATE templates SET status='Pending' where status = 'DownloadFailed'
and restarting
Currently, if the VN can't connect to the base layer, the process continues, even though it can't function properly.
Expected:
If there is a problem connecting (e.g. bad config, or the base node is not running), the process should exit
Need to wire up the payload processor to the InstructionProcessor
Acceptance criteria:
In hotstuff_waiter
on_receive_proposal
, the vote message is created and signed here:
let mut vote_msg = VoteMessage::new(*local_node.hash(), local_shard, decision, votes.clone());
vote_msg.sign();
However, vote_msg.sign
is just a stub right now:
pub fn sign(&mut self) {
// TODO: better signature
self.signature = Some(ValidatorSignature::from_bytes(&[9u8; 32]).unwrap())
}
This should be implemented and tested.
Acceptance criteria:
Currently we build the web-ui in the build.rs, and this requires npm to be setup in the environment.
This means that a node environment is required to be setup to build the vn which can be annoying when running the VN from a different shell (like intelij run) leading to confusing build failures.
I suggest rather that we have to manually run npm to build the web-ui to be included in the binary.
There are a few options from here:
--webui-root ./whatever
that overrides the content served on the web-ui port.no 1. is simpler, we'll have to allow CORS in development because you may want to dev on the web-ui using npm serve
no 2. allows the updated content to be served directly from the VN, making dev easier. But you can serve from a node server anyway so YAGNI
Both are fine for me, but 2 is a feature that needs to be added that may/may not be generally useful.
For production builds, we add the npm build to the process (build script or whatever).
Acceptance criteria:
At the moment, the base node is continually getting asked and erroring with this:
09:43 ERROR BaseNodeService failed to handle local request ChainStorageError(ValueNotFound { entity: "ShardKey", field: "public_key", value: "222f59f59229dda1f3453a143b12eb2947e2217664be1373a85b25d9cb3ab642" })
09:43 ERROR Error Chain storage error: The requested ShardKey was not found via public_key:222f59f59229dda1f3453a143b12eb2947e2217664be1373a85b25d9cb3ab642 in the database
get_code_template(template_id) -> WasmModule
Blocked by "[code-template-service] Download the template binary from the URL"
template_id will likely be the UTXO hash/commmitment but could be any info that is uniquely identifiable and indexable from the public blockchain. A wallet will have to provide the ID when building a transaction involving a template.
Acceptance criteria:
valid
or deprecated
statushttps://github.com/cucumber-rs/cucumber
In either case, using cucumber and/or rust integration tests, we'll need some process/instance builder.
let vn1 = ValidatorNode::builder("vn1")...spawn();
let vn2 = ValidatorNode::builder("vn2")..with_seed_peers(..)...spawn();
vn1.jrpc().submit_transaction(....).await?;
Acceptance criteria:
Possible future work (not required now):
network![ Alice, Bob, Carol ]
When starting the validator node, it should use the network specific ports for gRPC when connecting to the base node.
Currently, the leader will send a proposal as soon as it receives the first NewView message. Doing this is risky because it may send out a proposal that is based on a lower justify
height than the majority of VNs has. If this is the case, the other VNs will not vote for it and it will fail consensus.
What it should do is store each high_qc received from the NewView messages and only send once it has received n - f
Currently, the number of hotstuff rounds required are hard coded as '4' in many places. This should be made a consensus constant and can be changed per network
Acceptance criteria:
Acceptance criteria:
For me, ideally in typescript, which similar to rust, ends up saving on time spend debugging typos, type mismatches etc IMO generally more maintainable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.