Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion packages/rs-drive-abci/src/execution/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,12 @@ where
self.update_quorum_info(&mut state_cache, block_info.core_height)?;

// TODO: re-enable
self.update_masternode_list(&mut state_cache, block_info.core_height, transaction)?;
self.update_masternode_list(
&mut state_cache,
block_info.core_height,
&block_info,
transaction,
)?;

state_cache.last_committed_block_info = Some(block_info.clone());

Expand Down
9 changes: 9 additions & 0 deletions packages/rs-drive-abci/src/execution/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use dashcore::ProTxHash;
use std::collections::BTreeSet;

use dashcore_rpc::json::{MasternodeListDiffWithMasternodes, MasternodeType};
use drive::drive::block_info::BlockInfo;
use drive::grovedb::Transaction;

use crate::error::execution::ExecutionError;
Expand Down Expand Up @@ -128,6 +129,7 @@ where
&self,
state: &mut PlatformState,
core_block_height: u32,
block_info: &BlockInfo,
transaction: &Transaction,
) -> Result<(), Error> {
let previous_core_height = state.core_height();
Expand Down Expand Up @@ -191,6 +193,13 @@ where
.retain(|key, _| !deleted_masternodes.contains(key));

//Todo: masternode identities
self.update_masternode_identities(
previous_core_height,
core_block_height,
&block_info,
state,
&transaction,
)?;

//For all deleted masternodes we need to remove them from the state of the app version votes

Expand Down
8 changes: 7 additions & 1 deletion packages/rs-drive-abci/src/execution/initialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::rpc::core::CoreRPCLike;
use dashcore::hashes::Hash;
use dashcore::QuorumHash;
use dpp::identity::TimestampMillis;
use drive::drive::block_info::BlockInfo;
use tenderdash_abci::proto::abci::RequestInitChain;
use tenderdash_abci::proto::serializers::timestamp::ToMilis;

Expand Down Expand Up @@ -32,7 +33,12 @@ where

self.update_quorum_info(&mut state_cache, request.initial_core_height)?;

self.update_masternode_list(&mut state_cache, request.initial_core_height, &transaction)?;
self.update_masternode_list(
&mut state_cache,
request.initial_core_height,
&BlockInfo::genesis(),
&transaction,
)?;

state_cache.current_validator_set_quorum_hash = QuorumHash::from_slice(
request
Expand Down
Loading