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
2 changes: 1 addition & 1 deletion packages/rs-drive-abci/src/abci/handler/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ where
// Better to restart the Drive, so we might self-heal the node
// reloading state form the disk
panic!(
"drive and platform state app hash mismatch: drive_storage_root_hash: {:?}, platform_state_app_hash: {:?}",
"drive and platform state app hash mismatch (info): drive_storage_root_hash: {:?}, platform_state_app_hash: {:?}",
drive_storage_root_hash, platform_state_app_hash
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ where
// Better to restart the Drive, so we might self-heal the node
// reloading state form the disk
panic!(
"drive and platform state app hash mismatch: drive_storage_root_hash: {:?}, platform_state_app_hash: {:?}",
"drive and platform state app hash mismatch (prepare proposal): drive_storage_root_hash: {:?}, platform_state_app_hash: {:?}",
drive_storage_root_hash, platform_state_app_hash
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ where
// Better to restart the Drive, so we might self-heal the node
// reloading state form the disk
panic!(
"drive and platform state app hash mismatch: drive_storage_root_hash: {:?}, platform_state_app_hash: {:?}",
"drive and platform state app hash mismatch (process proposal): drive_storage_root_hash: {:?}, platform_state_app_hash: {:?}",
drive_storage_root_hash, platform_state_app_hash
);
}
Expand Down
1 change: 1 addition & 0 deletions packages/rs-drive-abci/tests/strategy_tests/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,7 @@ pub(crate) fn continue_chain_for_strategy(
.unwrap();
let (state_transitions, finalize_block_operations) = strategy.state_transitions_for_block(
platform,
block_start,
&block_info,
&mut current_identities,
&mut current_identity_nonce_counter,
Expand Down
29 changes: 17 additions & 12 deletions packages/rs-drive-abci/tests/strategy_tests/strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,6 @@ impl NetworkStrategy {
let old_id = contract.id();
let new_id =
DataContract::generate_data_contract_id_v0(identity.id, identity_nonce);
println!("new contract id is {}", new_id);
contract.set_id(new_id);

if let Some(contract_updates) = contract_updates {
Expand Down Expand Up @@ -1596,6 +1595,7 @@ impl NetworkStrategy {
pub fn state_transitions_for_block(
&mut self,
platform: &Platform<MockCoreRPCLike>,
start_block_height: BlockHeight,
block_info: &BlockInfo,
current_identities: &mut Vec<Identity>,
identity_nonce_counter: &mut BTreeMap<Identifier, u64>,
Expand Down Expand Up @@ -1631,17 +1631,22 @@ impl NetworkStrategy {

current_identities.append(&mut identities);

if block_info.height == 1 {
// add contracts on block 1
let mut contract_state_transitions = self.initial_contract_state_transitions(
current_identities,
signer,
contract_nonce_counter,
rng,
platform_version,
);
state_transitions.append(&mut contract_state_transitions);
} else {
let should_do_operation_transitions =
if block_info.height == start_block_height && !current_identities.is_empty() {
// add contracts on block 1
let mut contract_state_transitions = self.initial_contract_state_transitions(
current_identities,
signer,
contract_nonce_counter,
rng,
platform_version,
);
state_transitions.append(&mut contract_state_transitions);
block_info.height != 1
} else {
true
};
if should_do_operation_transitions {
// Don't do any state transitions on block 1
let (mut document_state_transitions, mut add_to_finalize_block_operations) = self
.operations_based_transitions(
Expand Down
Loading
Loading