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

Release 0.9.4 #85

Merged
merged 25 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3aa6cab
format
SurfingNerd Nov 3, 2023
061e160
ChainSyncing::is_syncing(&self) : are we syncing in any means ?
SurfingNerd Nov 4, 2023
5b1ce14
is_syncing() for BlockChainTestClient +
SurfingNerd Nov 5, 2023
c30c0b6
hbbft peers management: improved error messag
SurfingNerd Nov 6, 2023
5ef3d6a
prometheus update
SurfingNerd Nov 6, 2023
bb0984f
added real prometheus labels again.
SurfingNerd Nov 6, 2023
7b198a0
experimental try for adding label.
SurfingNerd Nov 6, 2023
8562350
other_node labels without n-prefix
SurfingNerd Nov 6, 2023
ffab76b
prometheus: fixed bug where last_message_good gauge was displaying th…
SurfingNerd Nov 6, 2023
920e0cd
Merge branch 'i73-is-major-syncing' into dev_0_9_4
SurfingNerd Nov 6, 2023
ecd8582
fixed missing documentation warning for fn is_syncing(&self) -> bool;
SurfingNerd Nov 7, 2023
c145cd2
refactoring prometheus interface for message memo: made register_gaug…
SurfingNerd Nov 7, 2023
d742f49
https://github.com/DMDcoin/diamond-node/issues/14
SurfingNerd Nov 8, 2023
fb71a0a
https://github.com/DMDcoin/diamond-node/issues/14
SurfingNerd Nov 8, 2023
405a33b
fixed bug calculating cumulative lateness
SurfingNerd Nov 8, 2023
c86028c
fixed calculation of non_tracked_cumulative_lateness
SurfingNerd Nov 8, 2023
2e560b3
cumulative lateness: filling gaps of missing hbbft messages
SurfingNerd Nov 9, 2023
bd6f70f
cargo fmt --all -- --config imports_granularity=Crate
SurfingNerd Nov 9, 2023
b3cdf28
fixed bug in tracking last message good and last message faulty
SurfingNerd Nov 9, 2023
88640a2
do not report last_block information of any kind, if the information …
SurfingNerd Nov 9, 2023
c6c19dd
redesigned cumulative lateness gap calculation to be used on all Bloc…
SurfingNerd Nov 9, 2023
eab2e6d
is_syncing for Hbbft tests
SurfingNerd Nov 10, 2023
fba4d3b
counting cumulative lateness in hbbft message memorium + unit tests
SurfingNerd Nov 11, 2023
adb42ea
changelog for upcomming 0.9.4
SurfingNerd Nov 12, 2023
dc026a0
version update of tomls
SurfingNerd Nov 12, 2023
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Diamond Node Software 3.3.5-hbbft-0.9.4

- [Fixed: is major syncing information is wrong.] (https://github.com/DMDcoin/diamond-node/issues/73)
- [Improvements for HBBFT Message Tracking] (https://github.com/DMDcoin/openethereum-3.x/issues/17)

## Diamond Node Software 3.3.5-hbbft-0.9.3

[Autoshutdown after a period without block import] https://github.com/DMDcoin/diamond-node/issues/78
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "Diamond Node"
name = "diamond-node"
# NOTE Make sure to update util/version/Cargo.toml as well
version = "3.3.5-hbbft-0.9.3"
version = "3.3.5-hbbft-0.9.4"
license = "GPL-3.0"
authors = [
"bit.diamonds developers",
Expand Down
12 changes: 12 additions & 0 deletions bin/oe/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ use node_filter::NodeFilter;
use parity_rpc::{informant, is_major_importing, NetworkSettings};
use parity_runtime::Runtime;
use parity_version::version;
use sync::SyncState;

// How often we attempt to take a snapshot: only snapshot on blocknumbers that are multiples of this.
const SNAPSHOT_PERIOD: u64 = 20000;
Expand Down Expand Up @@ -160,6 +161,17 @@ impl ChainSyncing for SyncProviderWrapper {
None => true,
}
}

/// are we syncing in any means ?
fn is_syncing(&self) -> bool {
match self.sync_provider.upgrade() {
Some(sync_arc) => {
return sync_arc.status().state != SyncState::Idle;
}
// We also indicate the "syncing" state when the SyncProvider has already been destroyed.
None => true,
}
}
}

/// Executes the given run command.
Expand Down
21 changes: 18 additions & 3 deletions crates/ethcore/src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2886,6 +2886,16 @@ impl BlockChainClient for Client {
}
}

fn is_syncing(&self) -> bool {
// so far we know, this lock cannot result into a deadlock.
match &*self.sync_provider.lock() {
Some(sync_provider) => sync_provider.is_syncing(),
// We also indicate the "syncing" state when the SyncProvider has not been set,
// which usually only happens when the client is not fully configured yet.
None => true,
}
}

fn next_nonce(&self, address: &Address) -> U256 {
self.importer.miner.next_nonce(self, address)
}
Expand Down Expand Up @@ -3652,9 +3662,14 @@ impl PrometheusMetrics for Client {
chain.best_block_number as i64,
);

let is_syncing_val: i64 = self.is_major_syncing() as i64;
// 0 or 1 if we are syncing.
r.register_gauge("is_major_syncing", "syncing, boolean", is_syncing_val);
// 0 or 1 if we are major syncing.
r.register_gauge(
"is_major_syncing",
"syncing, boolean",
self.is_major_syncing() as i64,
);

r.register_gauge("is_syncing", "syncing, boolean", self.is_syncing() as i64);

// prunning info
let prunning = self.pruning_info();
Expand Down
4 changes: 4 additions & 0 deletions crates/ethcore/src/client/test_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
self.disabled.load(AtomicOrder::SeqCst)
}

pub fn set_new_transaction_hashes_producer(

Check warning on line 425 in crates/ethcore/src/client/test_client.rs

View workflow job for this annotation

GitHub Actions / Check

missing documentation for a method

Check warning on line 425 in crates/ethcore/src/client/test_client.rs

View workflow job for this annotation

GitHub Actions / Check

missing documentation for a method

Check warning on line 425 in crates/ethcore/src/client/test_client.rs

View workflow job for this annotation

GitHub Actions / Test and Build (ubuntu-latest, 1.72)

missing documentation for a method

Check warning on line 425 in crates/ethcore/src/client/test_client.rs

View workflow job for this annotation

GitHub Actions / Test and Build (ubuntu-latest, 1.72)

missing documentation for a method
&self,
new_transaction_hashes: crossbeam_channel::Sender<H256>,
) {
Expand Down Expand Up @@ -1114,6 +1114,10 @@
false
}

fn is_syncing(&self) -> bool {
false
}

fn next_nonce(&self, address: &Address) -> U256 {
self.miner.next_nonce(self, address)
}
Expand Down
8 changes: 7 additions & 1 deletion crates/ethcore/src/client/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ pub trait EngineInfo {

/// Provides information about the chain sync state.
pub trait ChainSyncing: Send + Sync {
/// are we syncing?
fn is_syncing(&self) -> bool;

/// are we in the middle of a major sync?
fn is_major_syncing(&self) -> bool;
}
Expand Down Expand Up @@ -524,9 +527,12 @@ pub trait BlockChainClient:
/// Used by engines to queue transactions without causing deadlocks due to re-entrant calls.
fn transact_silently(&self, tx_request: TransactionRequest) -> Result<(), transaction::Error>;

/// Returns true if the chain is currently syncing.
/// Returns true if the chain is currently syncing in major states.
fn is_major_syncing(&self) -> bool;

/// Returns true if the chain is currently syncing.
fn is_syncing(&self) -> bool;

/// Returns the next nonce for the given address, taking the transaction queue into account.
fn next_nonce(&self, address: &Address) -> U256;

Expand Down
4 changes: 1 addition & 3 deletions crates/ethcore/src/engines/hbbft/hbbft_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,7 @@ impl IoHandler<()> for TransitionHandler {
}

let id: usize = std::process::id() as usize;

let thread_id = std::thread::current().id();

info!(target: "engine", "Waiting for Signaling shutdown to process ID: {id} thread: {:?}", thread_id);

if let Some(ref weak) = *self.client.read() {
Expand Down Expand Up @@ -1153,7 +1151,7 @@ impl HoneyBadgerBFT {

fn is_syncing(&self, client: &Arc<dyn EngineClient>) -> bool {
match client.as_full_client() {
Some(full_client) => full_client.is_major_syncing(),
Some(full_client) => full_client.is_syncing(),
// We only support full clients at this point.
None => true,
}
Expand Down
Loading
Loading