codechain-io / codechain Goto Github PK
View Code? Open in Web Editor NEWCodeChain's official implementation in Rust.
Home Page: https://codechain.io/
License: GNU Affero General Public License v3.0
CodeChain's official implementation in Rust.
Home Page: https://codechain.io/
License: GNU Affero General Public License v3.0
Currently, a block can be arbitrarily large.
Currently, Travis only builds Mac OS X binary. Add Linux build.
Dump transaction queue on shutdown and then reload it on startup.
[codechain]
quiet = false
db_path = "db"
chain_type = "tendermint"
enable_block_sync = true
enable_tx_relay = true
secret_key = "0x0000000000000000000000000000000000000000000000000000000000000001"
warning: method is never used: `exists_and_is_null`
--> core/src/state/mod.rs:98:5
|
98 | fn exists_and_is_null(&self) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: method is never used: `insert_cache_asset`
--> core/src/state/mod.rs:395:5
|
395 | fn insert_cache_asset(&self, address: &AssetAddress, asset: Entry<Asset>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: method is never used: `note_cache_asset`
--> core/src/state/mod.rs:419:5
|
419 | fn note_cache_asset(&self, address: &AssetAddress) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: method is never used: `require_asset`
--> core/src/state/mod.rs:801:5
|
801 | / fn require_asset<'a, F>(&'a self, a: &AssetAddress, default: F) -> trie::Result<RefMut<'a, Asset>>
802 | | where
803 | | F: FnOnce() -> Asset, {
804 | | self.require_asset_or_from(a, default, |_| {})
805 | | }
| |_____^
warning: method is never used: `require_asset_or_from`
--> core/src/state/mod.rs:851:5
|
851 | / fn require_asset_or_from<'a, F, G>(
852 | | &'a self,
853 | | a: &AssetAddress,
854 | | default: F,
... |
888 | | }))
889 | | }
| |_____^
warning: struct is never used: `CanonVerifier`
--> core/src/verification/canon_verifier.rs:25:1
|
25 | pub struct CanonVerifier;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
The method name connect
is misleading because it just negotiates the protocol name and version on top of the already established connection.
warning: warning: unknown warning option '-Wno-nonnull-compare'; did you mean '-Wno-enum-compare'? [-Wunknown-warning-option]
warning: warning: unknown warning option '-Wno-nonnull-compare'; did you mean '-Wno-enum-compare'? [-Wunknown-warning-option]
It's not a significant matter because the attempt fails.
Describe what CodeChain is.
Add maximum_extra_data_size
field to CommonParams
and reject transactions whose size exceed the maximum.
AssetMint creates an Asset object and an AssetScheme object. Each field is related to one between the two, but, currently, it is confused which is related to one or not.
Current:
AssetMint {
metadata: String,
lock_script_hash: H256,
parameters: Vec<Bytes>,
amount: Option<u64>,
registrar: Option<Address>,
nonce: u64,
},
Proposed:
AssetMint {
metadata: String,
registrar: Option<Address>,
nonce: u32,
output: AssetMintOutput
}
struct AssetMintOutput {
lock_script_hash: H256,
parameters: Vec<Bytes>,
amount: u64,
}
Validators can join/leave the network.
Currently, extension user must call negotiate API on node_added
event.
It was designed to support the extension which doesn't want to negotiate with some peers.
But until now, there are no that kinds of extensions, and it just makes the control flow complicate.
So I suggest changing the API as below.
pub trait Api: Send + Sync {
fn send(&self, node: &NodeId, message: &[u8]);
- fn negotiate(&self, node: &NodeId);
fn set_timer(&self, timer: TimerToken, d: Duration) -> Result<()>;
fn set_timer_once(&self, timer: TimerToken, d: Duration) -> Result<()>;
fn clear_timer(&self, timer: TimerToken) -> Result<()>;
fn send_local_message(&self, message: &Encodable);
}
pub trait Extension: Send + Sync {
fn name(&self) -> String;
fn need_encryption(&self) -> bool;
+ fn versions(&self) -> Vec<Version>;
fn on_initialize(&self, api: Arc<Api>);
- fn on_node_added(&self, _node: &NodeId) {}
+ fn on_node_added(&self, version: Version, _node: &NodeId) {}
fn on_node_removed(&self, _node: &NodeId) {}
- fn on_negotiated(&self, _node: &NodeId) {}
- fn on_negotiation_allowed(&self, _node: &NodeId) {}
- fn on_negotiation_denied(&self, _node: &NodeId) {}
fn on_message(&self, _node: &NodeId, _message: &[u8]) {}
fn on_timeout(&self, _timer: TimerToken) {}
fn on_local_message(&self, _message: &[u8]) {}
}
Currently, SetRegularKey
has no effect.
Currently, there is no penalty for Byzantine validators. Make them deposit certain amount of CCC and slash it.
Show information about version when -v or --version option is given.
We need a bug tracker like sentry.
Currently, discovery extensions share all addresses in the routing table.
add_blocks
of test client doesn't assign it now.
The same block can have different block hashes because the same block from different validators can have different set of COMMIT signatures.
Specify which transactions should force the node to reseal a block.
The default is own
.
ripemd160 is the only 160 bit hash function which is secure. It is required to implement atomic swap with Bitcoin and Ethereum.
Specify the block author (aka "coinbase") address for sending block rewards from sealed blocks.
Add block reward to solo
and solo_authority
.
https://github.com/CodeChain-io/codechain/blob/master/spec/Block-Synchronization-Extension.md
Depends on: #1884
Todo:
Good To Have:
Currently, we use debug_assert
in most cases because we check the assertions in tests and we don't want to check them again in the release binary.
But it's not sustainable. Bugs will occur for any reason. It seems better to use assert
to crash early because we have a plan to add a bug tracker.
I think we need a guideline to decide when to use assert
or debug_assert
.
data
field is no longer necessary once actions are added.
Specify the address which should be used to sign consensus messages and issue blocks.
Don't use hardcoded target value when logging.
trace!(target: "txqueue",
"Dropping transaction without sufficient balance: {:?} ({} < {})",
tx.hash(),
client_account.balance,
tx.fee
);
We need pre-defined constants for targets.
Report the proposer if no proposal was received.
We may punish the proposer if it keeps not proposing blocks.
How to add or remove validators safely?
warning: method is never used: `contains_registered`
--> network/src/p2p/session_candidate.rs:40:5
|
40 | pub fn contains_registered(&self, nonce: &Nonce) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(dead_code)] on by default
Make it possible to slash deposit if double-vote is detected.
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.