Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Authority round consensus engine #3426

Merged
merged 96 commits into from
Nov 16, 2016
Merged
Show file tree
Hide file tree
Changes from 92 commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
c31eab5
add non renewing timer
Sep 1, 2016
3a68fab
new simple authority engine
Sep 8, 2016
747898d
add new engine to spec
Sep 8, 2016
fc3d01e
add tests, fixes, simplifications
Sep 8, 2016
965dde8
enable TestNet with custom spec
Sep 9, 2016
4e75686
separate block preparation methods
Sep 10, 2016
cadca64
Split internal sealing from work sealing, add cli option
Sep 11, 2016
c0201bd
replace cli with engine method, simplify
Sep 12, 2016
d6e5637
Merge branch 'master' into split-internal-seal
Sep 12, 2016
d98f69c
Merge remote-tracking branch 'parity/split-internal-seal' into auth-r…
Sep 12, 2016
4bfdeea
More docs about sealing types. Bypass work in external txs.
Sep 12, 2016
1e20716
Merge remote-tracking branch 'parity/split-internal-seal' into auth-r…
Sep 12, 2016
e41b6c4
split requires_reseal, add test and new test miner
Sep 13, 2016
8b9e7c0
Merge remote-tracking branch 'parity/split-internal-seal' into auth-r…
Sep 13, 2016
6760132
make test helpers not test, add some docs
Sep 13, 2016
6a33f8b
state constructor used only in tests
Sep 13, 2016
eee6be1
implement new predicate trait
Sep 13, 2016
da2f117
new test_net holding Client
Sep 13, 2016
0994681
Merge remote-tracking branch 'parity/master' into auth-round
Sep 13, 2016
bdba423
Merge remote-tracking branch 'parity/master'
Sep 13, 2016
fef9420
enable internal sealing based on author
Sep 13, 2016
2bd8226
add tests, keep track of engine sealing status
Sep 13, 2016
0880d4a
method to check if default address is_sealer
Sep 14, 2016
7f05021
Merge remote-tracking branch 'parity/should-seal' into auth-round
Sep 14, 2016
ddb6fec
add new test specs
Sep 14, 2016
bedbe6e
update test spec loading
Sep 14, 2016
28a088e
add client own_tx import through client
Sep 14, 2016
7eac946
remove unused original TestNet method
Sep 14, 2016
faa9c7f
add new TestNet transaction issuing
Sep 14, 2016
b2c0a9d
introduce ethkey dependency to generate txs
Sep 14, 2016
68fd862
simplify constructors
Sep 14, 2016
c6c951d
Merge remote-tracking branch 'parity/should-seal' into auth-round
Sep 14, 2016
7c82a10
fix typo
Sep 14, 2016
a44e2b0
Merge remote-tracking branch 'parity/should-seal' into auth-round
Sep 14, 2016
c482b8f
enable sealing only is authority
Sep 14, 2016
bb59c22
docs on authority spec
Sep 14, 2016
d3ec858
new constructor that takes AccountProvider
Sep 14, 2016
44fe864
new highway to miner, set_author
Sep 14, 2016
3419549
revamp dummy_client to take accounts
Sep 14, 2016
b144bd2
add tracing
Sep 19, 2016
b31e732
temporary is_sealer check disable
Sep 19, 2016
c6c45db
add devtools dependency
Sep 19, 2016
6af888f
disable TemporaryPath panic
Sep 19, 2016
fdcda41
add tracing
Sep 19, 2016
49b8e14
initial mocknet with chain notify
Sep 19, 2016
ce3e875
additional consensus test
Sep 19, 2016
551b5d7
Merge remote-tracking branch 'parity/master'
Sep 19, 2016
49fba0b
Merge branch 'master' into auth-round
Sep 19, 2016
7f177f2
revert dummy_client changes
Sep 19, 2016
d84f949
add proposer step to seal
Sep 19, 2016
44c4845
fix up step switching test
Sep 19, 2016
9d23915
more simulation methods
Sep 20, 2016
c57e3ce
sync check method
Sep 21, 2016
ec058cd
reseal on timeout
Sep 27, 2016
cf88641
more mocknet tests
Sep 27, 2016
5fac941
Merge remote-tracking branch 'parity/master'
Sep 27, 2016
0c69d4a
Merge remote-tracking branch 'parity/master' into auth-round
Sep 27, 2016
28cf91c
remove mocknet stuff, clean up debug
Sep 27, 2016
1c801c9
revert random path drop panic
Sep 27, 2016
7e1d714
block time in decimal
Sep 27, 2016
44f42ac
Merge remote-tracking branch 'parity/master' into auth-round-no-mocknet
Oct 12, 2016
303f922
steps based on unix epoch
Oct 15, 2016
aa05823
Merge remote-tracking branch 'parity/master' into auth-round-no-mocknet
Oct 24, 2016
4ee669b
Merge remote-tracking branch 'parity/master'
Oct 26, 2016
3ff26dd
Merge branch 'master' into auth-round-no-mocknet
Oct 26, 2016
63cc5c0
Merge remote-tracking branch 'parity/master'
Oct 28, 2016
7976f46
Merge branch 'master' into auth-round-no-mocknet
Oct 28, 2016
37ca1fa
Merge remote-tracking branch 'parity/master'
Oct 30, 2016
fc4664a
Merge branch 'master' into auth-round-no-mocknet
Oct 30, 2016
a33e2f2
fix deadlock after merge
Nov 1, 2016
3a6b56e
check double signing, tracing
Nov 1, 2016
da32531
ignore block timeout when sealing internally
Nov 2, 2016
26155f5
proper calculation of remaining step time
Nov 2, 2016
03c9760
Merge remote-tracking branch 'parity/master' into auth-round-no-mocknet
Nov 2, 2016
b2a3851
Merge remote-tracking branch 'auth/auth-round-no-mocknet' into auth-r…
Nov 2, 2016
00a3619
header methods
Nov 2, 2016
045a65c
Merge remote-tracking branch 'auth/auth-round-no-mocknet' into auth-r…
Nov 2, 2016
12125dc
Merge branch 'master' into auth-round
Nov 3, 2016
255ec0c
Merge branch 'master' into auth-round
Nov 4, 2016
9de910c
Merge branch 'master' into auth-round
Nov 4, 2016
0e5060d
update schedule
Nov 4, 2016
a8b688b
allow permanent unlock for internal sealing
Nov 4, 2016
49f2a72
Merge branch 'master' into auth-round
Nov 9, 2016
501f6d3
Merge branch 'master' into auth-round
Nov 14, 2016
b5c8918
fix merge
Nov 14, 2016
165e2be
modify proposer test
Nov 14, 2016
8a86c11
enable force sealing
Nov 14, 2016
8be8b3e
ensure no double proposals
Nov 14, 2016
5de7d50
add test for multi proposals
Nov 14, 2016
1e3ae9f
typos, header functions
Nov 14, 2016
06ebd5f
remove most panics
Nov 14, 2016
ae5ae76
Merge branch 'master' into auth-round
Nov 14, 2016
9d46401
revert to try!
Nov 14, 2016
071e66c
fix flaky test
Nov 14, 2016
fde6ff2
nicer extra info
Nov 15, 2016
8efaf08
typos and warning
Nov 15, 2016
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
42 changes: 42 additions & 0 deletions ethcore/res/authority_round.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "TestAuthorityRound",
"engine": {
"AuthorityRound": {
"params": {
"gasLimitBoundDivisor": "0x0400",
"stepDuration": "1",
"authorities" : [
"0x7d577a597b2742b498cb5cf0c26cdcd726d39e6e",
"0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1"
]
}
}
},
"params": {
"accountStartNonce": "0x0",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID" : "0x69"
},
"genesis": {
"seal": {
"generic": {
"fields": 1,
"rlp": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"
}
},
"difficulty": "0x20000",
"author": "0x0000000000000000000000000000000000000000",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x2fefd8"
},
"accounts": {
"0000000000000000000000000000000000000001": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } },
"0000000000000000000000000000000000000002": { "balance": "1", "nonce": "1048576", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } },
"0000000000000000000000000000000000000003": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
"0000000000000000000000000000000000000004": { "balance": "1", "nonce": "1048576", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
"9cce34f7ab185c7aba1b7c8140d620b4bda941d6": { "balance": "1606938044258990275541962092341162602522202993782792835301376", "nonce": "1048576" }
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "TestAuthority",
"name": "TestBasicAuthority",
"engine": {
"BasicAuthority": {
"params": {
Expand Down
10 changes: 9 additions & 1 deletion ethcore/src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,13 +554,19 @@ impl Client {

/// Import transactions from the IO queue
pub fn import_queued_transactions(&self, transactions: &[Bytes]) -> usize {
trace!(target: "external_tx", "Importing queued");
let _timer = PerfTimer::new("import_queued_transactions");
self.queue_transactions.fetch_sub(transactions.len(), AtomicOrdering::SeqCst);
let txs = transactions.iter().filter_map(|bytes| UntrustedRlp::new(bytes).as_val().ok()).collect();
let results = self.miner.import_external_transactions(self, txs);
results.len()
}

/// Used by PoA to try sealing on period change.
pub fn update_sealing(&self) {
self.miner.update_sealing(self)
}

/// Attempt to get a copy of a specific block's final state.
///
/// This will not fail if given BlockID::Latest.
Expand Down Expand Up @@ -1193,7 +1199,9 @@ impl BlockChainClient for Client {
}

fn queue_transactions(&self, transactions: Vec<Bytes>) {
if self.queue_transactions.load(AtomicOrdering::Relaxed) > MAX_TX_QUEUE_SIZE {
let queue_size = self.queue_transactions.load(AtomicOrdering::Relaxed);
trace!(target: "external_tx", "Queue size: {}", queue_size);
if queue_size > MAX_TX_QUEUE_SIZE {
debug!("Ignoring {} transactions: queue is full", transactions.len());
} else {
let len = transactions.len();
Expand Down
10 changes: 10 additions & 0 deletions ethcore/src/client/test_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ impl TestBlockChainClient {
/// Creates new test client with specified extra data for each block
pub fn new_with_extra_data(extra_data: Bytes) -> Self {
let spec = Spec::new_test();
TestBlockChainClient::new_with_spec_and_extra(spec, extra_data)
}

/// Create test client with custom spec.
pub fn new_with_spec(spec: Spec) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convention/unrelated: with_X as opposed to new_with_X

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen it done above in existing methods and would not be nice to have it differently for a few, maybe a separate PR renaming all of them?

TestBlockChainClient::new_with_spec_and_extra(spec, Bytes::new())
}

/// Create test client with custom spec and extra data.
pub fn new_with_spec_and_extra(spec: Spec, extra_data: Bytes) -> Self {
let mut client = TestBlockChainClient {
blocks: RwLock::new(HashMap::new()),
numbers: RwLock::new(HashMap::new()),
Expand Down
Loading