Skip to content

Commit

Permalink
Merge branch 'master' into v1.0-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Oct 18, 2023
2 parents d3dd754 + 8948eac commit 4620941
Show file tree
Hide file tree
Showing 38 changed files with 340 additions and 206 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dashevo/platform",
"version": "0.25.3",
"version": "0.25.5",
"private": true,
"scripts": {
"setup": "yarn install && yarn run build && yarn run configure",
Expand Down
2 changes: 1 addition & 1 deletion packages/bench-suite/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dashevo/bench-suite",
"private": true,
"version": "0.25.3",
"version": "0.25.5",
"description": "Dash Platform benchmark tool",
"scripts": {
"bench": "node ./bin/bench.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/dapi-grpc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dashevo/dapi-grpc",
"version": "0.25.3",
"version": "0.25.5",
"description": "DAPI GRPC definition file and generated clients",
"browser": "browser.js",
"main": "node.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/dapi/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dashevo/dapi",
"private": true,
"version": "0.25.3",
"version": "0.25.5",
"description": "A decentralized API for the Dash network",
"scripts": {
"api": "node scripts/api.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/dash-spv/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dashevo/dash-spv",
"version": "0.25.3",
"version": "0.25.5",
"description": "Repository containing SPV functions used by @dashevo",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/dashmate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dashmate",
"version": "0.25.3",
"version": "0.25.5",
"description": "Distribution package for Dash node installation",
"scripts": {
"lint": "eslint .",
Expand Down
2 changes: 1 addition & 1 deletion packages/dashpay-contract/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dashevo/dashpay-contract",
"version": "0.25.3",
"version": "0.25.5",
"description": "Reference contract of the DashPay DPA on Dash Evolution",
"scripts": {
"lint": "eslint .",
Expand Down
2 changes: 1 addition & 1 deletion packages/dpns-contract/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dashevo/dpns-contract",
"version": "0.25.3",
"version": "0.25.5",
"description": "A contract and helper scripts for DPNS DApp",
"scripts": {
"lint": "eslint .",
Expand Down
2 changes: 1 addition & 1 deletion packages/feature-flags-contract/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dashevo/feature-flags-contract",
"version": "0.25.3",
"version": "0.25.5",
"description": "Data Contract to store Dash Platform feature flags",
"scripts": {
"build": "",
Expand Down
2 changes: 1 addition & 1 deletion packages/js-dapi-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dashevo/dapi-client",
"version": "0.25.3",
"version": "0.25.5",
"description": "Client library used to access Dash DAPI endpoints",
"main": "lib/index.js",
"contributors": [
Expand Down
2 changes: 1 addition & 1 deletion packages/js-dash-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash",
"version": "3.25.3",
"version": "3.25.5",
"description": "Dash library for JavaScript/TypeScript ecosystem (Wallet, DAPI, Primitives, BLS, ...)",
"main": "build/index.js",
"unpkg": "dist/dash.min.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/js-dpp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dashevo/dpp",
"version": "0.25.3",
"version": "0.25.5",
"description": "The JavaScript implementation of the Dash Platform Protocol",
"scripts": {
"lint": "eslint .",
Expand Down
2 changes: 1 addition & 1 deletion packages/js-grpc-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dashevo/grpc-common",
"version": "0.25.3",
"version": "0.25.5",
"description": "Common GRPC library",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/masternode-reward-shares-contract/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dashevo/masternode-reward-shares-contract",
"version": "0.25.3",
"version": "0.25.5",
"description": "A contract and helper scripts for reward sharing",
"scripts": {
"lint": "eslint .",
Expand Down
2 changes: 1 addition & 1 deletion packages/platform-test-suite/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dashevo/platform-test-suite",
"private": true,
"version": "0.25.3",
"version": "0.25.5",
"description": "Dash Network end-to-end tests",
"scripts": {
"test": "yarn exec bin/test.sh",
Expand Down
11 changes: 6 additions & 5 deletions packages/rs-drive-abci/src/abci/handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ where
if let Some(proposal_info) = block_execution_context.proposer_results() {
tracing::debug!(
method = "process_proposal",
"we knew block hash, block execution context already had a proposer result {:?}",
proposal_info
?proposal_info, // TODO: It might be too big for debug
"we knew block hash, block execution context already had a proposer result",
);
// We were the proposer as well, so we have the result in cache
return Ok(ResponseProcessProposal {
Expand All @@ -298,8 +298,9 @@ where

if current_block_hash.as_slice() == request.hash {
// We were not the proposer, just drop the execution context
tracing::debug!(
tracing::warn!(
method = "process_proposal",
?request, // Shumkov, lklimek: this structure might be very big and we already logged it such as all other ABCI requests and responses
"block execution context already existed, but we are running it again for same height {}/round {}",
request.height,
request.round,
Expand All @@ -320,10 +321,10 @@ where
)))?;
};

tracing::debug!(
tracing::trace!(
method = "process_proposal",
"we didn't know block hash (we were most likely proposer), block execution context already had a proposer result {:?}",
proposal_info
proposal_info,
);

// Cloning all required properties from proposal_info and then dropping it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ where
// Start by getting information from the state
let state = self.state.read().unwrap();

if tracing::enabled!(tracing::Level::TRACE) {
tracing::trace!(
method = "run_block_proposal_v0",
?block_proposal,
?epoch_info,
platform_state_fingerprint = hex::encode(state.fingerprint()),
"running a block proposal on epoch {}",
epoch_info.current_epoch_index()
);
}

let last_block_time_ms = state.last_block_time_ms();
let last_block_height =
state.known_height_or(self.config.abci.genesis_height.saturating_sub(1));
Expand Down Expand Up @@ -153,6 +164,43 @@ where
.epoch_info
.is_epoch_change_but_not_genesis()
{
tracing::info!(
epoch_index = block_execution_context.epoch_info.current_epoch_index(),
"epoch change occurring from epoch {} to epoch {}",
block_execution_context
.epoch_info
.previous_epoch_index()
.expect("must be set since we aren't on genesis"),
block_execution_context.epoch_info.current_epoch_index(),
);

if block_execution_context
.block_platform_state
.current_protocol_version_in_consensus()
== block_execution_context
.block_platform_state
.next_epoch_protocol_version()
{
tracing::trace!(
epoch_index = block_execution_context.epoch_info.current_epoch_index(),
"protocol version remains the same {}",
block_execution_context
.block_platform_state
.current_protocol_version_in_consensus(),
);
} else {
tracing::info!(
epoch_index = block_execution_context.epoch_info.current_epoch_index(),
"protocol version changed from {} to {}",
block_execution_context
.block_platform_state
.current_protocol_version_in_consensus(),
block_execution_context
.block_platform_state
.next_epoch_protocol_version(),
);
}

// Set current protocol version to the version from upcoming epoch
block_execution_context
.block_platform_state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ where
{
tracing::debug!(
method = "validator_set_update_v0",
"rotation: previous quorum finished members"
"rotation: previous quorum finished members. quorum rotation expected"
);
perform_rotation = true;
}
Expand All @@ -48,7 +48,7 @@ where
{
tracing::debug!(
method = "validator_set_update_v0",
"rotation: new quorums not containing current quorum current {:?}, {}",
"rotation: new quorums not containing current quorum current {:?}, {}. quorum rotation expected˚",
block_execution_context
.block_platform_state()
.validator_sets()
Expand Down Expand Up @@ -143,7 +143,7 @@ where
} else {
tracing::debug!(
method = "validator_set_update_v0",
"no validator set update"
"no validator set update",
);
Ok(None)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::platform_types::platform::Platform;
use crate::platform_types::platform_state::v0::PlatformStateV0Methods;
use crate::platform_types::platform_state::PlatformState;
use crate::rpc::core::CoreRPCLike;
use dashcore_rpc::dashcore::hashes::Hash;
use dpp::block::block_info::BlockInfo;
use dpp::block::extended_block_info::v0::ExtendedBlockInfoV0Getters;
use dpp::version::PlatformVersion;
Expand Down Expand Up @@ -48,7 +47,7 @@ where
tracing::debug!(
method = "update_masternode_list_v0",
"no update mnl at height {}",
core_block_height
core_block_height,
);
return Ok(()); // no need to do anything
}
Expand Down Expand Up @@ -87,6 +86,16 @@ where
&platform_version.drive,
)?;
}

if tracing::enabled!(tracing::Level::TRACE) {
let block_platform_state_fingerprint =
hex::encode(block_platform_state.fingerprint());
tracing::trace!(
block_platform_state_fingerprint,
method = "update_masternode_list_v0",
"masternode list updated",
);
}
}

Ok(())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ use crate::error::Error;
use crate::platform_types::platform::Platform;
use crate::platform_types::platform_state::v0::PlatformStateV0Methods;
use crate::platform_types::platform_state::PlatformState;
use std::collections::BTreeMap;

use crate::platform_types::validator_set::v0::{ValidatorSetV0, ValidatorSetV0Getters};
use crate::platform_types::validator_set::ValidatorSet;
use crate::rpc::core::CoreRPCLike;

use dpp::dashcore::QuorumHash;
use std::collections::BTreeMap;
use tracing::Level;

impl<C> Platform<C>
Expand Down Expand Up @@ -50,19 +50,21 @@ where
return Ok(()); // no need to do anything
}

let all_quorums_by_type = self
let mut extended_quorum_list = self
.core_rpc
.get_quorum_listextended_by_type(Some(core_block_height))?;

let validator_quorums_list =
all_quorums_by_type
.get(&self.config.quorum_type())
.ok_or(Error::Execution(ExecutionError::DashCoreBadResponseError(
format!(
"expected quorums of type {}, but did not receive any from Dash Core",
self.config.quorum_type
),
)))?;
.get_quorum_listextended(Some(core_block_height))?;

let validator_quorums_list: BTreeMap<_, _> = extended_quorum_list
.quorums_by_type
.remove(&self.config.quorum_type())
.ok_or(Error::Execution(ExecutionError::DashCoreBadResponseError(
format!(
"expected quorums of type {}, but did not receive any from Dash Core",
self.config.quorum_type
),
)))?
.into_iter()
.collect();

// Remove validator_sets entries that are no longer valid for the core block height
block_platform_state
Expand Down Expand Up @@ -152,7 +154,13 @@ where
}
});

block_platform_state.set_quorums_extended_info(all_quorums_by_type);
if tracing::enabled!(tracing::Level::TRACE) {
tracing::trace!(
method = "update_quorum_info_v0",
block_platform_state_fingerprint = hex::encode(block_platform_state.fingerprint()),
"quorum info updated",
);
}

Ok(())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ mod tests {
last_committed_block_info: None,
current_protocol_version_in_consensus: 0,
next_epoch_protocol_version: 0,
quorums_extended_info: Default::default(),
current_validator_set_quorum_hash: QuorumHash::all_zeros(),
next_validator_set_quorum_hash: None,
validator_sets: Default::default(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ mod tests {
last_committed_block_info: None,
current_protocol_version_in_consensus: 0,
next_epoch_protocol_version: 0,
quorums_extended_info: Default::default(),
current_validator_set_quorum_hash: QuorumHash::all_zeros(),
next_validator_set_quorum_hash: None,
validator_sets: Default::default(),
Expand Down
Loading

0 comments on commit 4620941

Please sign in to comment.