xian-network / xian-core Goto Github PK
View Code? Open in Web Editor NEWXian Network node implementation based on CometBFT
Home Page: https://xian.org
License: Apache License 2.0
Xian Network node implementation based on CometBFT
Home Page: https://xian.org
License: Apache License 2.0
Transaction environment relates to how we create verifyable, deterministic randomness in smart contracts.
Also related to using the time which comes from the begin_block
event. We need to decide how we are replacing the legacy way of creating a block hash, salt etc.
Do we want to produce empty blocks?
https://docs.cometbft.com/v0.38/core/using-cometbft
To get the process_tx
logic to work, I commented out a bunch of stuff. Some of this had to do with signature and hashes in the final return object.
We need to determine what we want to include here and what we can permanently do without.
Parallel processing is definitely possible with our stack and worth trying.
Currently the blockchain is capable of processing low 100's of simple transactions per second.
This implementation could be used to significantly increase the throughput of the blockchain, based on the amount of cores available.
A few modifications would be needed to support this.
1 ) The user's transaction must detail all the values on the blockchain it will be altering. Let's call this a claim
.
2 ) The begin_block
method would need knowledge of all the transactions from the block it's processing.
3 ) n lightweight contracting processes to run transactions in separate threads, these do not write to disk, but instead return the list of writes to the ABCI app.
begin_block
is called, retrieves all transactions in the block.{
# This tx is processed by a side process.
"tx_1"{
"parallel": true,
"success": true,
"data"{...
} // this is the tx output to return in the deliver_tx response
},
# This tx was was rejected due to invalid claim
"tx_2"{
"parallel": true,
"success": false,
"data"{...
} // this is the tx output to return in the deliver_tx response
},
# To be process as normal, in sequence at deliver_tx
"tx_3"{
"parallel": false
}
}
begin_block
function completes and the blockchain now iterates through all transactions.deliver_tx
is called for each transaction, for async txns the appropriate data is returned in the response, as if the transaction was normally. Sync transactions are processed normally, however the claim is still validated against the transaction result.end_block
and commit
are called.We need to decide how we're going to appoint validators, what the requirements will be and agree on a high level design for this.
We should rename the currency
contract to something else. Because if we at some point want to interact with another network like Lamden, it might be an issue if their TAU and our XIAN are both the same contract.
Either we name it xian
if we are sure about the name or we call it something more abstract.
Would be more nice I think if we can provide a swagger ui for our API.
CometBFT has an approach for time. Important thing here is that it will allow for deterministic replication of state across nodes when compiling blocks.
Time is passed in the req object on the begin_block
event.
That said, if the transactions contain some internal value, like an order/nonce/sequence number, the application can reject transactions that are out of order. So if a node receives tx3, then tx1, it can reject tx3 and then accept tx1. The sender can then retry sending tx3, which should probably be rejected until the node has seen tx2.
Let's have a discussion about the structure of the project and how we can make it as nice a place to work as possible.
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.