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

Rc/v0.2.0 #76

Merged
merged 72 commits into from
Dec 17, 2018
Merged
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
ef65f8b
chore: delete CHANGELOG from develop
doitian Nov 27, 2018
781d5f5
feat: add get_current_cell rpc for fetching unspent cells
xxuejie Nov 27, 2018
b7d092c
feat: Print full config error instead of just description (#23)
xxuejie Nov 27, 2018
f4644b8
fix: Fix network unexpected connections to self (#21)
jjyr Nov 27, 2018
c7fbc92
fix: fix integration tests
xxuejie Nov 27, 2018
80faf9c
Merge pull request #24 from nervosnetwork/xxuejie/get-current-cell-rpc
xxuejie Nov 27, 2018
d126e51
chore: Update dependency bigint:0.2.3
ashchan Nov 27, 2018
682333d
fix typo
driftluo Nov 28, 2018
8d1daf1
chore: Depend `ckb-vm` via Cargo (#25)
doitian Nov 28, 2018
9962bac
doc: fix typo (#30)
u2 Nov 28, 2018
46e0219
Merge pull request #27 from nervosnetwork/fix-typo
TheWaWaR Nov 28, 2018
f59c030
doc: vm is no longer a submodule (#32)
doitian Nov 28, 2018
ab0649c
chore: move explorer to new repo
quake Nov 28, 2018
7c09312
Merge pull request #34 from nervosnetwork/quake/separate_explorer
Nov 28, 2018
2494aa7
chore: add `make stats` for counting lines of code (#37)
rainchen Nov 28, 2018
4c2c173
Merge pull request #28 from nervosnetwork/update-dep-bigint
zhangsoledad Nov 28, 2018
1ca3090
chore: add `make security-audit` to audit crates with security vulner…
rainchen Nov 28, 2018
d4ca022
feat: add new syscall to fetch current script hash (#42)
xxuejie Nov 30, 2018
2f8cd66
doc: change the RPC verify command in README (#43)
lgn21st Nov 30, 2018
51b1675
fix: fix missing output lock hash (#46)
xxuejie Nov 30, 2018
c314ecd
doc: better description of RPC verification command (#45)
Dec 1, 2018
a81b2b7
doc: add badges (#35)
doitian Dec 1, 2018
26f043a
chore: upgrade crate `jsonrpc-http-server`
doitian Nov 29, 2018
4c9b397
chore: remove dependency on YAML
doitian Nov 29, 2018
f93e1da
feat: dockerfile for hub (#48)
zhangsoledad Dec 4, 2018
5fa2d7f
chore: upgrade outdated deps
zhangsoledad Dec 4, 2018
af64b05
chore: module-level attributes to skip generated code rustfmt clippy
zhangsoledad Dec 4, 2018
be5ca52
Merge pull request #50 from zhangsoledad/zhangsoledad/upgrade_dep
zhangsoledad Dec 4, 2018
f036763
chore: allow CI on all branches (#49)
doitian Dec 4, 2018
62defc8
Merge pull request #51 from zhangsoledad/zhangsoledad/skip_attributes
zhangsoledad Dec 4, 2018
8c8382a
fix: fix IBD sync process
jjyr Dec 5, 2018
2585e0a
chore(typo): correct minor grammar issues in TODO comment (#66)
ashchan Dec 6, 2018
542860c
Merge pull request #64 from nervosnetwork/jjyr/fix-IBD-sync-headers-p…
zhangsoledad Dec 6, 2018
7fef14d
refactor: rpc and miner (#52)
quake Dec 10, 2018
0cd755c
chore: upgrade crossbeam-channel (#69)
quake Dec 10, 2018
2cb8aca
refactor: replace ethereum-types with numext
zhangsoledad Nov 27, 2018
1b55d0d
build: bump rust-toolchain
zhangsoledad Dec 3, 2018
9a02165
Merge pull request #67 from zhangsoledad/zhangsoledad/numext
jjyr Dec 10, 2018
b6ae37a
chore(deps): bump faster-hex from 0.1.0 to 0.1.1
dependabot-support Dec 10, 2018
cfb984c
chore(deps): bump serde_derive from 1.0.80 to 1.0.81
dependabot-support Dec 10, 2018
206edf4
Merge pull request #68 from nervosnetwork/dependabot/cargo/faster-hex…
zhangsoledad Dec 10, 2018
b2f8674
Merge pull request #72 from nervosnetwork/dependabot/cargo/serde_deri…
zhangsoledad Dec 10, 2018
2c9361c
chore(deps): bump serde from 1.0.80 to 1.0.81
dependabot-support Dec 10, 2018
1fa1086
chore(deps): bump indicatif from 0.10.2 to 0.10.3
dependabot-support Dec 10, 2018
2d71b79
Merge pull request #73 from nervosnetwork/dependabot/cargo/serde-1.0.81
zhangsoledad Dec 10, 2018
880d0c7
Merge pull request #65 from nervosnetwork/dependabot/cargo/indicatif-…
zhangsoledad Dec 11, 2018
313b2ea
refactor: embrace Rust 2018 (#75)
zhangsoledad Dec 11, 2018
9573905
refactor: VM syscall refactoring
xxuejie Dec 10, 2018
c9364f2
feat: add LOAD_INPUT_BY_FIELD syscall
xxuejie Dec 11, 2018
7727360
fix: rustfmt
xxuejie Dec 11, 2018
707d661
fix: in case of missing cell, return ITEM_MISSING error instead of ha…
xxuejie Dec 11, 2018
342fb48
fix: Rust 2018 fixes
xxuejie Dec 11, 2018
506410a
Merge pull request #74 from nervosnetwork/xxuejie/syscall-refactoring
xxuejie Dec 11, 2018
c21f5de
fix: fix syscall number
xxuejie Dec 11, 2018
f7ee06e
Merge pull request #77 from nervosnetwork/xxuejie/fix-syscall-number
zhangsoledad Dec 11, 2018
62e784f
fix: fix rpc_url
ashchan Dec 11, 2018
fba929c
Merge pull request #78 from nervosnetwork/fix-rpc-url
zhangsoledad Dec 11, 2018
722b505
fix(build): docker tag (#81)
zhangsoledad Dec 12, 2018
c07b493
fix(build): docker port
zhangsoledad Dec 12, 2018
6d80ea4
fix: fix syscall length calculation (#82)
xxuejie Dec 12, 2018
d248ed4
fix: remove hash caches to avoid JSON deserialization bug (#84)
xxuejie Dec 12, 2018
2c85cba
Merge pull request #85 from zhangsoledad/zhangsoledad/docker_port
zhangsoledad Dec 12, 2018
789f8ca
chore: add script to bump versions
doitian Dec 12, 2018
c4b0a21
chore: run cargo check after bumping version
doitian Dec 12, 2018
1eebf75
fix: remove unsound test
zhangsoledad Dec 12, 2018
edb2658
doc: add link to CHANGELOG in README
doitian Dec 12, 2018
01e02e2
fix: resolve mining old block issue (#87)
quake Dec 12, 2018
2b0976f
fix: uncheck subtract overflow (#88)
zhangsoledad Dec 13, 2018
0be27e4
chore: bump to v0.2.0
doitian Dec 13, 2018
1b49477
chore: CHANGELOG for v0.2.0
doitian Dec 13, 2018
ee446c8
Merge branch 'master' into rc/v0.2.0
doitian Dec 14, 2018
13a6634
chore: amend CHANGELOG for v0.2.0
doitian Dec 17, 2018
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
Prev Previous commit
Next Next commit
refactor: embrace Rust 2018 (#75)
zhangsoledad authored and doitian committed Dec 11, 2018
commit 313b2ea4ede2a03ede6cd29ebe2ac04adde6712c
2 changes: 1 addition & 1 deletion .cargo/config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[cargo-new]
name = "Nervos Core Dev"
email = "[email protected]"

edition = "2018"
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -3,14 +3,16 @@ name = "ckb"
version = "0.1.0"
license = "MIT"
authors = ["Nervos Core Dev <[email protected]>"]
edition = "2018"
build = "build.rs"

[dependencies]
clap = { version = "2" }
serde = "1.0"
serde_derive = "1.0"
log = "0.4"
crossbeam-channel = "0.3"
channel = { package= "crossbeam-channel", version = "0.3" }
config-tool = { package= "config", version = "0.9" }
ckb-util = { path = "util" }
ckb-core = { path = "core" }
ckb-chain = { path = "chain" }
@@ -33,7 +35,6 @@ dir = { path = "util/dir" }
ctrlc = { version = "3.1", features = ["termination"] }
lazy_static = "1.0"
ckb-sync = { path = "sync"}
config = "0.9"
serde_json = "1.0"
crypto = { path = "util/crypto"}
ckb-instrument = { path = "util/instrument", features = ["progress_bar"] }
1 change: 1 addition & 0 deletions benches/Cargo.toml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ name = "ckb-benches"
version = "0.1.0"
license = "MIT"
authors = ["Nervos Core Dev <[email protected]>"]
edition = "2018"

[dependencies]

6 changes: 1 addition & 5 deletions benches/benches/cuckoo.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#[macro_use]
extern crate criterion;
extern crate ckb_pow;

use ckb_pow::Cuckoo;
use criterion::Criterion;
use criterion::{criterion_group, criterion_main, Criterion};

const TESTSET: [([u8; 80], [u32; 6]); 3] = [
(
2 changes: 0 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
extern crate build_info;

fn main() {
// Don't rebuild even if nothing changed
println!("cargo:rerun-if-changed=build.rs");
4 changes: 3 additions & 1 deletion chain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ name = "ckb-chain"
version = "0.1.0"
license = "MIT"
authors = ["Nervos Core Dev <[email protected]>"]
edition = "2018"

[dependencies]
serde = "1.0"
@@ -21,7 +22,8 @@ numext-fixed-hash = { version = "0.1", features = ["support_rand", "support_heap
numext-fixed-uint = { version = "0.1", features = ["support_rand", "support_heapsize", "support_serde"] }
lru-cache = { git = "https://github.com/nervosnetwork/lru-cache" }
fnv = "1.0.3"
crossbeam-channel = "0.3"
channel = { package= "crossbeam-channel", version = "0.3" }


[dev-dependencies]
env_logger = "0.6"
6 changes: 3 additions & 3 deletions chain/src/chain.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use channel::{self, Receiver, Sender};
use crate::error::ProcessBlockError;
use channel::{self, select, Receiver, Sender};
use ckb_chain_spec::consensus::Consensus;
use ckb_core::block::Block;
use ckb_core::extras::BlockExt;
@@ -11,8 +12,7 @@ use ckb_shared::index::ChainIndex;
use ckb_shared::shared::{ChainProvider, Shared, TipHeader};
use ckb_time::now_ms;
use ckb_verification::{BlockVerifier, Verifier};
use error::ProcessBlockError;
use log;
use log::{self, debug, error, log_enabled};
use numext_fixed_hash::H256;
use numext_fixed_uint::U256;
use std::cmp;
19 changes: 0 additions & 19 deletions chain/src/lib.rs
Original file line number Diff line number Diff line change
@@ -7,24 +7,5 @@
//! - [Chain](chain::chain::Chain) represent a struct which
//! implement `ChainProvider`

extern crate ckb_chain_spec;
extern crate ckb_core;
extern crate ckb_db;
extern crate ckb_notify;
extern crate ckb_shared;
extern crate ckb_time;
extern crate ckb_verification;
extern crate numext_fixed_hash;
extern crate numext_fixed_uint;
#[macro_use]
extern crate log;
#[macro_use]
extern crate crossbeam_channel as channel;

#[cfg(test)]
extern crate rand;
#[cfg(test)]
extern crate tempfile;

pub mod chain;
pub mod error;
3 changes: 2 additions & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ name = "ckb-core"
version = "0.1.0"
license = "MIT"
authors = ["Nervos Core Dev <[email protected]>"]
edition = "2018"

[dependencies]
serde = "1.0"
@@ -14,7 +15,7 @@ hash = {path = "../util/hash"}
crypto = {path = "../util/crypto"}
ckb-time = { path = "../util/time" }
bit-vec = "0.5.0"
crossbeam-channel = "0.3"
channel = { package= "crossbeam-channel", version = "0.3" }
rayon = "1.0"
ckb-util = { path = "../util" }
fnv = "1.0.3"
7 changes: 4 additions & 3 deletions core/src/block.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use crate::header::{Header, HeaderBuilder};
use crate::transaction::{ProposalShortId, Transaction};
use crate::uncle::{uncles_hash, UncleBlock};
use fnv::FnvHashSet;
use header::{Header, HeaderBuilder};
use merkle_root::merkle_root;
use numext_fixed_hash::H256;
use transaction::{ProposalShortId, Transaction};
use uncle::{uncles_hash, UncleBlock};
use serde_derive::{Deserialize, Serialize};

#[derive(Clone, Serialize, Deserialize, Eq, Default, Debug)]
pub struct Block {
2 changes: 1 addition & 1 deletion core/src/cell.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::transaction::{CellOutput, OutPoint, Transaction};
use numext_fixed_hash::H256;
use std::collections::HashSet;
use std::iter::Chain;
use std::slice;
use transaction::{CellOutput, OutPoint, Transaction};

#[derive(Clone, PartialEq, Debug)]
pub enum CellStatus {
1 change: 1 addition & 0 deletions core/src/extras.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use numext_fixed_hash::H256;
use numext_fixed_uint::U256;
use serde_derive::{Deserialize, Serialize};

#[derive(Clone, Serialize, Deserialize, PartialEq, Default, Debug)]
pub struct BlockExt {
3 changes: 2 additions & 1 deletion core/src/header.rs
Original file line number Diff line number Diff line change
@@ -2,8 +2,9 @@ use bincode::{deserialize, serialize};
use hash::sha3_256;
use numext_fixed_hash::H256;
use numext_fixed_uint::U256;
use serde_derive::{Deserialize, Serialize};

pub use BlockNumber;
pub use crate::BlockNumber;

#[derive(Clone, Serialize, Deserialize, PartialEq, Eq, Debug, Default)]
pub struct Seal {
15 changes: 1 addition & 14 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -2,19 +2,6 @@
//!
//! This Library provides the essential types for building ckb.

extern crate bincode;
extern crate ckb_util;
extern crate crypto;
extern crate hash;
extern crate numext_fixed_hash;
#[macro_use]
extern crate serde_derive;
extern crate bit_vec;
extern crate crossbeam_channel as channel;
extern crate fnv;
extern crate merkle_root;
extern crate numext_fixed_uint;

pub mod block;
pub mod cell;
pub mod chain;
@@ -28,7 +15,7 @@ pub mod transaction;
pub mod transaction_meta;
pub mod uncle;

pub use error::Error;
pub use crate::error::Error;

pub type PublicKey = numext_fixed_hash::H512;
pub type BlockNumber = u64;
1 change: 1 addition & 0 deletions core/src/script.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use hash::sha3_256;
use numext_fixed_hash::H256;
use serde_derive::{Deserialize, Serialize};
use std::io::Write;

// TODO: when flatbuffer work is done, remove Serialize/Deserialize here and
8 changes: 4 additions & 4 deletions core/src/transaction.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//! Transaction using Cell.
//! It is similar to Bitcoin Tx <https://en.bitcoin.it/wiki/Protocol_documentation#tx/>
use crate::script::Script;
use crate::BlockNumber;
pub use crate::Capacity;
use bincode::{deserialize, serialize};
use ckb_util::u64_to_bytes;
use hash::sha3_256;
use header::BlockNumber;
use numext_fixed_hash::H256;
use script::Script;
use serde_derive::{Deserialize, Serialize};
use std::mem;
use std::ops::{Deref, DerefMut};

pub const VERSION: u32 = 0;

pub use Capacity;

#[derive(Clone, Serialize, Deserialize, Eq, PartialEq, Hash, Debug)]
pub struct OutPoint {
// Hash of Transaction
1 change: 1 addition & 0 deletions core/src/transaction_meta.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use bit_vec::BitVec;
use serde_derive::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
#[serde(remote = "BitVec")]
9 changes: 5 additions & 4 deletions core/src/uncle.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use crate::block::Block;
use crate::header::Header;
use crate::transaction::{ProposalShortId, Transaction};
use crate::BlockNumber;
use bincode::serialize;
use block::Block;
use hash::sha3_256;
use header::Header;
use numext_fixed_hash::H256;
use transaction::{ProposalShortId, Transaction};
use BlockNumber;
use serde_derive::{Deserialize, Serialize};

#[derive(Clone, Serialize, Deserialize, PartialEq, Eq, Default, Debug)]
pub struct UncleBlock {
1 change: 1 addition & 0 deletions db/Cargo.toml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ name = "ckb-db"
version = "0.1.0"
license = "MIT"
authors = ["Nervos Core Dev <[email protected]>"]
edition = "2018"

[dependencies]
bincode = "1.0"
4 changes: 2 additions & 2 deletions db/src/diskdb.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use batch::{Batch, Col, Operation};
use kvdb::{ErrorKind, KeyValueDB, Result};
use crate::batch::{Batch, Col, Operation};
use crate::kvdb::{ErrorKind, KeyValueDB, Result};
use rocksdb::{ColumnFamily, Options, WriteBatch, DB};
use std::ops::Range;
use std::path::Path;
2 changes: 1 addition & 1 deletion db/src/kvdb.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use batch::{Batch, Col};
use crate::batch::{Batch, Col};
use bincode::Error as BcError;
use rocksdb::Error as RdbError;
use std::error::Error as StdError;
8 changes: 0 additions & 8 deletions db/src/lib.rs
Original file line number Diff line number Diff line change
@@ -3,15 +3,7 @@
//! This Library contains the `KeyValueDB` traits
//! which provides key-value store interface

extern crate bincode;
extern crate ckb_util;
extern crate fnv;
extern crate rocksdb;

pub mod batch;
pub mod diskdb;
pub mod kvdb;
pub mod memorydb;

#[cfg(test)]
extern crate tempfile;
4 changes: 2 additions & 2 deletions db/src/memorydb.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use batch::{Batch, Col, Operation};
use crate::batch::{Batch, Col, Operation};
use crate::kvdb::{ErrorKind, KeyValueDB, Result};
use ckb_util::RwLock;
use fnv::FnvHashMap;
use kvdb::{ErrorKind, KeyValueDB, Result};
use std::ops::Range;

pub type MemoryKey = Vec<u8>;
3 changes: 2 additions & 1 deletion miner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ name = "ckb-miner"
version = "0.1.0"
license = "MIT"
authors = ["Nervos Core Dev <[email protected]>"]
edition = "2018"

[dependencies]
log = "0.4"
@@ -18,7 +19,7 @@ flatbuffers = "0.5.0"
rand = "0.6"
serde = "1.0"
serde_derive = "1.0"
crossbeam-channel = "0.3"
channel = { package= "crossbeam-channel", version = "0.3" }
fnv = "1.0.3"
jsonrpc = { git = "https://github.com/quake/rust-jsonrpc" }
serde_json = "1.0"
5 changes: 3 additions & 2 deletions miner/src/agent.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use channel::{self, Receiver, Sender};
use crate::types::BlockTemplate;
use channel::{self, select, Receiver, Sender};
use ckb_core::block::{Block, BlockBuilder};
use ckb_core::header::{Header, HeaderBuilder};
use ckb_core::service::{Request, DEFAULT_CHANNEL_SIZE};
@@ -11,11 +12,11 @@ use ckb_shared::index::ChainIndex;
use ckb_shared::shared::{ChainProvider, Shared};
use ckb_time::now_ms;
use fnv::{FnvHashMap, FnvHashSet};
use log::error;
use numext_fixed_hash::H256;
use std::cmp;
use std::sync::Arc;
use std::thread::{self, JoinHandle};
use types::BlockTemplate;

const MINER_AGENT_SUBSCRIBER: &str = "miner_agent";

4 changes: 3 additions & 1 deletion miner/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use crate::types::{BlockTemplate, Config, Shared};
use channel::Sender;
use ckb_core::block::Block;
use ckb_util::RwLockUpgradableReadGuard;
use jsonrpc::client::Client as JsonRpcClient;
use log::{debug, error, info};
use numext_fixed_hash::H256;
use serde_json::json;
use std::{thread, time};
use types::{BlockTemplate, Config, Shared};

#[derive(Clone)]
pub struct Client {
28 changes: 4 additions & 24 deletions miner/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
extern crate ckb_core;
extern crate ckb_notify;
extern crate ckb_pool;
extern crate ckb_pow;
extern crate ckb_shared;
extern crate ckb_time;
extern crate ckb_util;
extern crate fnv;
extern crate jsonrpc;
extern crate numext_fixed_hash;
extern crate rand;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate log;
#[macro_use]
extern crate serde_json;
#[macro_use]
extern crate crossbeam_channel as channel;

mod agent;
mod client;
mod miner;
mod types;

pub use agent::{Agent, AgentController, AgentReceivers};
pub use client::Client;
pub use miner::Miner;
pub use types::{BlockTemplate, Config, Shared};
pub use crate::agent::{Agent, AgentController, AgentReceivers};
pub use crate::client::Client;
pub use crate::miner::Miner;
pub use crate::types::{BlockTemplate, Config, Shared};
Loading