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

Commit

Permalink
Merge branch 'master' into chore/use-parity-common
Browse files Browse the repository at this point in the history
* master:
  Clean up deprecated options and add CHECK macro (#9036)
  Replace `std::env::home_dir` with `dirs::home_dir` (#9077)
  fix warning in secret-store test (#9074)
  SeedHashCompute remove needless `new` impl (#9063)
  remove trait bounds from several structs (#9055)
  docs: add changelog for 1.10.9 stable and 1.11.6 beta (#9069)
  Enable test in `miner/pool/test` (#9072)
  • Loading branch information
dvdplm committed Jul 10, 2018
2 parents 7e86cda + c63452e commit b0c25b7
Show file tree
Hide file tree
Showing 25 changed files with 411 additions and 161 deletions.
79 changes: 79 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,82 @@
## Parity [v1.11.6](https://github.com/paritytech/parity/releases/tag/v1.11.6) (2018-07-09)

Parity 1.11.6 is a bug-fix release to improve performance and stability.

The full list of included changes:

- Beta: 1.11.6 backports ([#9015](https://github.com/paritytech/parity/pull/9015))
- Parity-version: bump beta to 1.11.6
- Scripts: remove md5 checksums ([#8884](https://github.com/paritytech/parity/pull/8884))
- Add support for --chain tobalaba
- Convert indents to tabs :)
- Fixes for misbehavior reporting in AuthorityRound ([#8998](https://github.com/paritytech/parity/pull/8998))
- Aura: only report after checking for repeated skipped primaries
- Aura: refactor duplicate code for getting epoch validator set
- Aura: verify_external: report on validator set contract instance
- Aura: use correct validator set epoch number when reporting
- Aura: use epoch set when verifying blocks
- Aura: report skipped primaries when generating seal
- Aura: handle immediate transitions
- Aura: don't report skipped steps from genesis to first block
- Aura: fix reporting test
- Aura: refactor duplicate code to handle immediate_transitions
- Aura: let reporting fail on verify_block_basic
- Aura: add comment about possible failure of reporting
- Only return error log for rustls ([#9025](https://github.com/paritytech/parity/pull/9025))
- Transaction Pool improvements ([#8470](https://github.com/paritytech/parity/pull/8470))
- Don't use ethereum_types in transaction pool.
- Hide internal insertion_id.
- Fix tests.
- Review grumbles.
- Improve should_replace on NonceAndGasPrice ([#8980](https://github.com/paritytech/parity/pull/8980))
- Additional tests for NonceAndGasPrice::should_replace.
- Fix should_replace in the distinct sender case.
- Use natural priority ordering to simplify should_replace.
- Minimal effective gas price in the queue ([#8934](https://github.com/paritytech/parity/pull/8934))
- Minimal effective gas price.
- Fix naming, add test
- Fix minimal entry score and add test.
- Fix worst_transaction.
- Remove effective gas price threshold.
- Don't leak gas_price decisions out of Scoring.
- Never drop local transactions from different senders. ([#9002](https://github.com/paritytech/parity/pull/9002))
- Recently rejected cache for transaction queue ([#9005](https://github.com/paritytech/parity/pull/9005))
- Store recently rejected transactions.
- Don't cache AlreadyImported rejections.
- Make the size of transaction verification queue dependent on pool size.
- Add a test for recently rejected.
- Fix logging for recently rejected.
- Make rejection cache smaller.
- Obsolete test removed
- Obsolete test removed
- Construct cache with_capacity.
- Optimize pending transactions filter ([#9026](https://github.com/paritytech/parity/pull/9026))
- Rpc: return unordered transactions in pending transactions filter
- Ethcore: use LruCache for nonce cache
- Only clear the nonce cache when a block is retracted
- Revert "ethcore: use LruCache for nonce cache"
- This reverts commit b382c19.
- Use only cached nonces when computing pending hashes.
- Give filters their own locks, so that they don't block one another.
- Fix pending transaction count if not sealing.
- Clear cache only when block is enacted.
- Fix RPC tests.
- Address review comments.
- A last bunch of txqueue performance optimizations ([#9024](https://github.com/paritytech/parity/pull/9024))
- Clear cache only when block is enacted.
- Add tracing for cull.
- Cull split.
- Cull after creating pending block.
- Add constant, remove sync::read tracing.
- Reset debug.
- Remove excessive tracing.
- Use struct for NonceCache.
- Fix build
- Remove warnings.
- Fix build again.
- Miner: add missing macro use for trace_time
- Ci: remove md5 merge leftovers

## Parity [v1.11.5](https://github.com/paritytech/parity/releases/tag/v1.11.5) (2018-06-29)

Parity 1.11.5 is a bug-fix release to improve performance and stability.
Expand Down
19 changes: 15 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions docs/CHANGELOG-1.10.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
## Parity [v1.10.9](https://github.com/paritytech/parity/releases/tag/v1.10.9) (2018-07-07)

Parity 1.10.9 is a bug-fix release to improve performance and stability.

The full list of included changes:

- Stable: 1.10.9 backports ([#9016](https://github.com/paritytech/parity/pull/9016))
- Parity-version: bump stable to 1.10.9
- Scripts: remove md5 checksums ([#8884](https://github.com/paritytech/parity/pull/8884))
- Add support for --chain tobalaba ([#8870](https://github.com/paritytech/parity/pull/8870))
- Add support for --chain tobalaba
- Only return error log for rustls ([#9025](https://github.com/paritytech/parity/pull/9025))
- Fixes for misbehavior reporting in AuthorityRound ([#8998](https://github.com/paritytech/parity/pull/8998))
- Aura: only report after checking for repeated skipped primaries
- Aura: refactor duplicate code for getting epoch validator set
- Aura: verify_external: report on validator set contract instance
- Aura: use correct validator set epoch number when reporting
- Aura: use epoch set when verifying blocks
- Aura: report skipped primaries when generating seal
- Aura: handle immediate transitions
- Aura: don't report skipped steps from genesis to first block
- Aura: fix reporting test
- Aura: refactor duplicate code to handle immediate_transitions
- Aura: let reporting fail on verify_block_basic
- Aura: add comment about possible failure of reporting

## Parity [v1.10.8](https://github.com/paritytech/parity/releases/tag/v1.10.8) (2018-06-29)

Parity 1.10.8 is a bug-fix release to improve performance and stability.
Expand Down
2 changes: 1 addition & 1 deletion ethash/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl NodeCacheBuilder {

pub fn new<T: Into<Option<OptimizeFor>>>(optimize_for: T) -> Self {
NodeCacheBuilder {
seedhash: Arc::new(Mutex::new(SeedHashCompute::new())),
seedhash: Arc::new(Mutex::new(SeedHashCompute::default())),
optimize_for: optimize_for.into().unwrap_or_default(),
}
}
Expand Down
17 changes: 5 additions & 12 deletions ethash/src/seed_compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,13 @@ use keccak::{keccak_256, H256};

use std::cell::Cell;

#[derive(Default)]
pub struct SeedHashCompute {
prev_epoch: Cell<u64>,
prev_seedhash: Cell<H256>,
}

impl SeedHashCompute {
#[inline]
pub fn new() -> SeedHashCompute {
SeedHashCompute {
prev_epoch: Cell::new(0),
prev_seedhash: Cell::new([0u8; 32]),
}
}

#[inline]
fn reset_cache(&self) {
self.prev_epoch.set(0);
Expand Down Expand Up @@ -77,20 +70,20 @@ mod tests {

#[test]
fn test_seed_compute_once() {
let seed_compute = SeedHashCompute::new();
let seed_compute = SeedHashCompute::default();
let hash = [241, 175, 44, 134, 39, 121, 245, 239, 228, 236, 43, 160, 195, 152, 46, 7, 199, 5, 253, 147, 241, 206, 98, 43, 3, 104, 17, 40, 192, 79, 106, 162];
assert_eq!(seed_compute.hash_block_number(486382), hash);
}

#[test]
fn test_seed_compute_zero() {
let seed_compute = SeedHashCompute::new();
let seed_compute = SeedHashCompute::default();
assert_eq!(seed_compute.hash_block_number(0), [0u8; 32]);
}

#[test]
fn test_seed_compute_after_older() {
let seed_compute = SeedHashCompute::new();
let seed_compute = SeedHashCompute::default();
// calculating an older value first shouldn't affect the result
let _ = seed_compute.hash_block_number(50000);
let hash = [241, 175, 44, 134, 39, 121, 245, 239, 228, 236, 43, 160, 195, 152, 46, 7, 199, 5, 253, 147, 241, 206, 98, 43, 3, 104, 17, 40, 192, 79, 106, 162];
Expand All @@ -99,7 +92,7 @@ mod tests {

#[test]
fn test_seed_compute_after_newer() {
let seed_compute = SeedHashCompute::new();
let seed_compute = SeedHashCompute::default();
// calculating an newer value first shouldn't affect the result
let _ = seed_compute.hash_block_number(972764);
let hash = [241, 175, 44, 134, 39, 121, 245, 239, 228, 236, 43, 160, 195, 152, 46, 7, 199, 5, 253, 147, 241, 206, 98, 43, 3, 104, 17, 40, 192, 79, 106, 162];
Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/cache_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use std::hash::Hash;

const COLLECTION_QUEUE_SIZE: usize = 8;

pub struct CacheManager<T> where T: Eq + Hash {
pub struct CacheManager<T> {
pref_cache_size: usize,
max_cache_size: usize,
bytes_per_cache_entry: usize,
Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/executive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl TransactOptions<trace::NoopTracer, trace::NoopVMTracer> {
}

/// Transaction executor.
pub struct Executive<'a, B: 'a + StateBackend> {
pub struct Executive<'a, B: 'a> {
state: &'a mut State<B>,
info: &'a EnvInfo,
machine: &'a Machine,
Expand Down
4 changes: 1 addition & 3 deletions ethcore/src/externalities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ impl OriginInfo {
}

/// Implementation of evm Externalities.
pub struct Externalities<'a, T: 'a, V: 'a, B: 'a>
where T: Tracer, V: VMTracer, B: StateBackend
{
pub struct Externalities<'a, T: 'a, V: 'a, B: 'a> {
state: &'a mut State<B>,
env_info: &'a EnvInfo,
machine: &'a Machine,
Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/miner/stratum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl StratumJobDispatcher {
/// New stratum job dispatcher given the miner and client
fn new(miner: Weak<Miner>, client: Weak<Client>) -> StratumJobDispatcher {
StratumJobDispatcher {
seed_compute: Mutex::new(SeedHashCompute::new()),
seed_compute: Mutex::new(SeedHashCompute::default()),
client: client,
miner: miner,
}
Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ pub fn prove_transaction<H: AsHashDB<KeccakHasher> + Send + Sync>(
/// checkpoint can be discarded with `discard_checkpoint`. All of the orignal
/// backed-up values are moved into a parent checkpoint (if any).
///
pub struct State<B: Backend> {
pub struct State<B> {
db: B,
root: H256,
cache: RefCell<HashMap<Address, AccountEntry>>,
Expand Down
12 changes: 9 additions & 3 deletions ethcore/types/src/account_diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use bytes::Bytes;

#[derive(Debug, PartialEq, Eq, Clone)]
/// Diff type for specifying a change (or not).
pub enum Diff<T> where T: Eq {
pub enum Diff<T> {
/// Both sides are the same.
Same,
/// Left (pre, source) side doesn't include value, right side (post, destination) does.
Expand All @@ -35,9 +35,15 @@ pub enum Diff<T> where T: Eq {
Died(T),
}

impl<T> Diff<T> where T: Eq {
impl<T> Diff<T> {
/// Construct new object with given `pre` and `post`.
pub fn new(pre: T, post: T) -> Self { if pre == post { Diff::Same } else { Diff::Changed(pre, post) } }
pub fn new(pre: T, post: T) -> Self where T: Eq {
if pre == post {
Diff::Same
} else {
Diff::Changed(pre, post)
}
}

/// Get the before value, if there is one.
pub fn pre(&self) -> Option<&T> { match *self { Diff::Died(ref x) | Diff::Changed(ref x, _) => Some(x), _ => None } }
Expand Down
2 changes: 1 addition & 1 deletion miner/src/pool/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ fn should_avoid_reverifying_recently_rejected_transactions() {
assert_eq!(txq.status().status.transaction_count, 0);
}


#[test]
fn should_reject_early_in_case_gas_price_is_less_than_min_effective() {
// given
let txq = TransactionQueue::new(
Expand Down
2 changes: 1 addition & 1 deletion miner/src/work_notify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl WorkPoster {
client: fetch,
remote: remote,
urls: urls,
seed_compute: Mutex::new(SeedHashCompute::new()),
seed_compute: Mutex::new(SeedHashCompute::default()),
}
}
}
Expand Down
Loading

0 comments on commit b0c25b7

Please sign in to comment.