From e2397de284ef018551f6cb474ec50ac00d641e32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Kami=C5=84ski?= Date: Tue, 13 Aug 2024 11:29:14 +0200 Subject: [PATCH 1/4] Revert the changes keeping zero bids in the auction state --- .../test/regression/regression_20210831.rs | 6 +- .../src/test/system_contracts/auction/bids.rs | 18 +---- .../system_contracts/auction/distribute.rs | 59 ++++++-------- node/src/reactor/main_reactor/tests.rs | 32 +++----- storage/src/system/auction.rs | 23 +++--- storage/src/system/auction/detail.rs | 76 +++---------------- 6 files changed, 60 insertions(+), 154 deletions(-) diff --git a/execution_engine_testing/tests/src/test/regression/regression_20210831.rs b/execution_engine_testing/tests/src/test/regression/regression_20210831.rs index 0d94c521ed..9fe1e74bf1 100644 --- a/execution_engine_testing/tests/src/test/regression/regression_20210831.rs +++ b/execution_engine_testing/tests/src/test/regression/regression_20210831.rs @@ -439,10 +439,8 @@ fn regression_20210831_should_fail_to_activate_bid() { builder.exec(withdraw_bid_request).expect_success().commit(); let bids = builder.get_bids(); - let bid = bids - .validator_bid(&DEFAULT_ACCOUNT_PUBLIC_KEY) - .expect("should have zero bid"); - assert!(bid.staked_amount().is_zero()); + let bid = bids.validator_bid(&DEFAULT_ACCOUNT_PUBLIC_KEY); + assert!(bid.is_none()); let sender = *ACCOUNT_2_ADDR; let activate_bid_args = runtime_args! { diff --git a/execution_engine_testing/tests/src/test/system_contracts/auction/bids.rs b/execution_engine_testing/tests/src/test/system_contracts/auction/bids.rs index 3c13e92b53..61e209c22e 100644 --- a/execution_engine_testing/tests/src/test/system_contracts/auction/bids.rs +++ b/execution_engine_testing/tests/src/test/system_contracts/auction/bids.rs @@ -2054,11 +2054,7 @@ fn should_undelegate_delegators_when_validator_unbonds() { .expect_success(); let bids_after = builder.get_bids(); - assert!(bids_after - .validator_bid(&VALIDATOR_1) - .expect("should still have zero bid") - .staked_amount() - .is_zero()); + assert!(bids_after.validator_bid(&VALIDATOR_1).is_none()); let unbonding_purses_after: UnbondingPurses = builder.get_unbonds(); assert_ne!(unbonding_purses_after, unbonding_purses_before); @@ -2261,11 +2257,7 @@ fn should_undelegate_delegators_when_validator_fully_unbonds() { .expect_success(); let bids_after = builder.get_bids(); - assert!(bids_after - .validator_bid(&VALIDATOR_1) - .expect("should still have zero bid") - .staked_amount() - .is_zero()); + assert!(bids_after.validator_bid(&VALIDATOR_1).is_none()); let unbonding_purses_before: UnbondingPurses = builder.get_unbonds(); @@ -2324,9 +2316,6 @@ fn should_undelegate_delegators_when_validator_fully_unbonds() { timestamp_millis += TIMESTAMP_MILLIS_INCREMENT; } - let bids_after_2 = builder.get_bids(); - assert!(bids_after_2.validator_bid(&VALIDATOR_1).is_none()); - let validator_1_balance_after = builder.get_purse_balance(validator_1.main_purse()); let delegator_1_balance_after = builder.get_purse_balance(delegator_1.main_purse()); let delegator_2_balance_after = builder.get_purse_balance(delegator_2.main_purse()); @@ -4312,9 +4301,6 @@ fn should_enforce_max_delegators_per_validator_cap() { assert_eq!(current_delegator_count, 1); - // Make the undelegation go through and remove the bid completely. - builder.advance_eras_by(DEFAULT_UNBONDING_DELAY + 1); - let delegation_request_3 = ExecuteRequestBuilder::standard( *DELEGATOR_1_ADDR, CONTRACT_DELEGATE, diff --git a/execution_engine_testing/tests/src/test/system_contracts/auction/distribute.rs b/execution_engine_testing/tests/src/test/system_contracts/auction/distribute.rs index 54ce15f384..9980693cab 100644 --- a/execution_engine_testing/tests/src/test/system_contracts/auction/distribute.rs +++ b/execution_engine_testing/tests/src/test/system_contracts/auction/distribute.rs @@ -378,22 +378,27 @@ fn should_distribute_delegation_rate_zero() { VALIDATOR_1.clone(), validator_1_actual_payout + U512::from(VALIDATOR_1_STAKE), ); - get_validator_bid(&mut builder, VALIDATOR_1.clone()) - .expect("should still have zero bid") - .staked_amount() + assert!(get_validator_bid(&mut builder, VALIDATOR_1.clone()).is_none()); + U512::zero() }; assert_eq!(validator_1_balance, U512::zero()); - let delegator_1_balance = - get_delegator_bid(&mut builder, VALIDATOR_1.clone(), DELEGATOR_1.clone()) - .expect("validator withdrawing full stake also removes delegator 1 reinvested funds") - .staked_amount(); + let delegator_1_balance = { + assert!( + get_delegator_bid(&mut builder, VALIDATOR_1.clone(), DELEGATOR_1.clone()).is_none(), + "validator withdrawing full stake also removes delegator 1 reinvested funds" + ); + U512::zero() + }; assert_eq!(delegator_1_balance, U512::zero()); - let delegator_2_balance = - get_delegator_bid(&mut builder, VALIDATOR_1.clone(), DELEGATOR_2.clone()) - .expect("validator withdrawing full stake also removes delegator 1 reinvested funds") - .staked_amount(); + let delegator_2_balance = { + assert!( + get_delegator_bid(&mut builder, VALIDATOR_1.clone(), DELEGATOR_2.clone()).is_none(), + "validator withdrawing full stake also removes delegator 1 reinvested funds" + ); + U512::zero() + }; assert!(delegator_2_balance.is_zero()); let era_info = get_era_info(&mut builder); @@ -651,10 +656,7 @@ fn should_withdraw_bids_after_distribute() { undelegate_amount, ); assert!( - get_delegator_bid(&mut builder, VALIDATOR_1.clone(), DELEGATOR_1.clone()) - .expect("should still have zero bid") - .staked_amount() - .is_zero(), + get_delegator_bid(&mut builder, VALIDATOR_1.clone(), DELEGATOR_1.clone()).is_none(), "delegator 1 did not unstake full expected amount" ); delegator_1_actual_payout @@ -678,10 +680,7 @@ fn should_withdraw_bids_after_distribute() { undelegate_amount, ); assert!( - get_delegator_bid(&mut builder, VALIDATOR_1.clone(), DELEGATOR_2.clone()) - .expect("should still have zero bid") - .staked_amount() - .is_zero(), + get_delegator_bid(&mut builder, VALIDATOR_1.clone(), DELEGATOR_2.clone()).is_none(), "delegator 2 did not unstake full expected amount" ); delegator_2_actual_payout @@ -704,10 +703,7 @@ fn should_withdraw_bids_after_distribute() { withdraw_bid_amount, ); - assert!(get_validator_bid(&mut builder, VALIDATOR_1.clone()) - .expect("should still have zero bid") - .staked_amount() - .is_zero()); + assert!(get_validator_bid(&mut builder, VALIDATOR_1.clone()).is_none()); withdraw_bid_amount }; @@ -3169,10 +3165,7 @@ fn should_not_restake_after_full_unbond() { U512::from(DELEGATOR_1_STAKE), ); let delegator = get_delegator_bid(&mut builder, VALIDATOR_1.clone(), DELEGATOR_1.clone()); - assert!(delegator - .expect("should still have zero bid") - .staked_amount() - .is_zero()); + assert!(delegator.is_none()); let withdraws = builder.get_unbonds(); let unbonding_purses = withdraws @@ -3196,13 +3189,10 @@ fn should_not_restake_after_full_unbond() { builder.advance_era(); - // Delegator's stake should remain at zero even though they were eligible for rewards in the + // Delegator should not remain delegated even though they were eligible for rewards in the // second era. let delegator = get_delegator_bid(&mut builder, VALIDATOR_1.clone(), DELEGATOR_1.clone()); - assert!(delegator - .expect("should have zero bid") - .staked_amount() - .is_zero()); + assert!(delegator.is_none()); } // In this test, we set up a delegator and a validator, the delegator delegates to the validator. @@ -3351,8 +3341,5 @@ fn delegator_full_unbond_during_first_reward_era() { // Delegator's stake should remain at zero delegated even though they were eligible for rewards // in the second era. let delegator = get_delegator_bid(&mut builder, VALIDATOR_1.clone(), DELEGATOR_1.clone()); - assert!(delegator - .expect("should still have zero bid") - .staked_amount() - .is_zero()); + assert!(delegator.is_none()); } diff --git a/node/src/reactor/main_reactor/tests.rs b/node/src/reactor/main_reactor/tests.rs index 3bf9e94142..394938d384 100644 --- a/node/src/reactor/main_reactor/tests.rs +++ b/node/src/reactor/main_reactor/tests.rs @@ -1826,26 +1826,24 @@ async fn run_withdraw_bid_network() { .run_until_executed_transaction(&txn_hash, TEN_SECS) .await; - // Ensure execution succeeded and that there is a Write transform for the bid's key. + // Ensure execution succeeded and that there is a Prune transform for the bid's key. let bid_key = Key::BidAddr(BidAddr::from(alice_public_key.clone())); fixture .successful_execution_transforms(&txn_hash) .iter() .find(|transform| match transform.kind() { - TransformKindV2::Write(StoredValue::BidKind(bid_kind)) => { - Key::from(bid_kind.bid_addr()) == bid_key - } + TransformKindV2::Prune(prune_key) => prune_key == &bid_key, _ => false, }) - .expect("should have a write record for bid"); + .expect("should have a prune record for bid"); // Crank the network forward until the era ends. fixture .run_until_stored_switch_block_header(ERA_ONE, ONE_MIN) .await; - // The bid record should still exist for now. - fixture.check_bid_existence_at_tip(&alice_public_key, None, true); + // The bid record should have been pruned once unbonding ran. + fixture.check_bid_existence_at_tip(&alice_public_key, None, false); // Crank the network forward until the unbonds are processed. fixture @@ -1854,9 +1852,6 @@ async fn run_withdraw_bid_network() { ONE_MIN * 2, ) .await; - - // The bid record should have been pruned once unbonding ran. - fixture.check_bid_existence_at_tip(&alice_public_key, None, false); } #[tokio::test] @@ -2035,27 +2030,25 @@ async fn run_undelegate_bid_network() { .run_until_executed_transaction(&txn_hash, TEN_SECS) .await; - // Ensure execution succeeded and that there is a Write transform for the bid's key. + // Ensure execution succeeded and that there is a Prune transform for the bid's key. fixture .successful_execution_transforms(&txn_hash) .iter() .find(|transform| match transform.kind() { - TransformKindV2::Write(StoredValue::BidKind(bid_kind)) => { - Key::from(bid_kind.bid_addr()) == bid_key - } + TransformKindV2::Prune(prune_key) => prune_key == &bid_key, _ => false, }) - .expect("should have a write record for undelegated bid"); + .expect("should have a prune record for undelegated bid"); // Crank the network forward until the era ends. fixture .run_until_stored_switch_block_header(ERA_ONE, ONE_MIN) .await; - // Ensure the validator records are still present. + // Ensure the validator records are still present but the undelegated bid is gone. fixture.check_bid_existence_at_tip(&alice_public_key, None, true); fixture.check_bid_existence_at_tip(&bob_public_key, None, true); - fixture.check_bid_existence_at_tip(&bob_public_key, Some(&alice_public_key), true); + fixture.check_bid_existence_at_tip(&bob_public_key, Some(&alice_public_key), false); // Crank the network forward until the unbonds are processed. fixture @@ -2064,11 +2057,6 @@ async fn run_undelegate_bid_network() { ONE_MIN * 2, ) .await; - - // Ensure the validator records are still present but the undelegated bid is gone. - fixture.check_bid_existence_at_tip(&alice_public_key, None, true); - fixture.check_bid_existence_at_tip(&bob_public_key, None, true); - fixture.check_bid_existence_at_tip(&bob_public_key, Some(&alice_public_key), false); } #[tokio::test] diff --git a/storage/src/system/auction.rs b/storage/src/system/auction.rs index 927d34da0b..c5228f02af 100644 --- a/storage/src/system/auction.rs +++ b/storage/src/system/auction.rs @@ -201,17 +201,15 @@ pub trait Auction: let delegator_bid_addr = BidAddr::new_from_public_keys(&public_key, Some(&delegator_public_key)); - // Keep the bids for now - they will be pruned when the validator's unbonds get - // processed. - self.write_bid( - delegator_bid_addr.into(), - BidKind::Delegator(Box::new(delegator)), - )?; + debug!("pruning delegator bid {}", delegator_bid_addr); + self.prune_bid(delegator_bid_addr) } + debug!("pruning validator bid {}", validator_bid_addr); + self.prune_bid(validator_bid_addr); + } else { + self.write_bid(validator_bid_key, BidKind::Validator(validator_bid))?; } - self.write_bid(validator_bid_key, BidKind::Validator(validator_bid))?; - Ok(updated_stake) } @@ -299,8 +297,12 @@ pub trait Auction: updated_stake ); - // Keep the bid for now - it will get pruned when the unbonds are processed. - self.write_bid(delegator_bid_addr.into(), BidKind::Delegator(delegator_bid))?; + if updated_stake.is_zero() { + debug!("pruning delegator bid {}", delegator_bid_addr); + self.prune_bid(delegator_bid_addr); + } else { + self.write_bid(delegator_bid_addr.into(), BidKind::Delegator(delegator_bid))?; + } Ok(updated_stake) } @@ -616,7 +618,6 @@ pub trait Auction: .chain( unlocked_validators .into_iter() - .filter(|(_, stake)| !stake.is_zero()) .take(remaining_auction_slots), ) .collect() diff --git a/storage/src/system/auction/detail.rs b/storage/src/system/auction/detail.rs index 597a55fc15..de97a9bc14 100644 --- a/storage/src/system/auction/detail.rs +++ b/storage/src/system/auction/detail.rs @@ -1,8 +1,4 @@ -use std::{ - collections::{BTreeMap, BTreeSet, HashSet}, - convert::TryInto, - ops::Mul, -}; +use std::{collections::BTreeMap, convert::TryInto, ops::Mul}; use num_rational::Ratio; @@ -397,9 +393,6 @@ pub fn process_unbond_requests( let unbonding_delay = get_unbonding_delay(provider)?; - let mut processed_validators = BTreeSet::new(); - let mut still_unbonding_public_keys = HashSet::new(); - for unbonding_list in unbonding_purses.values_mut() { let mut new_unbonding_list = Vec::new(); @@ -408,11 +401,13 @@ pub fn process_unbond_requests( // current era id + unbonding delay is equal or greater than the `era_of_creation` that // was calculated on `unbond` attempt. if current_era_id >= unbonding_purse.era_of_creation() + unbonding_delay { - // remember the validator's key, so that we can later check if we can prune their - // bid now that the unbond has been processed - processed_validators.insert(unbonding_purse.validator_public_key().clone()); - match handle_redelegation(provider, unbonding_purse, max_delegators_per_validator)? - { + let redelegation_result = + handle_redelegation(provider, unbonding_purse, max_delegators_per_validator) + .map_err(|err| { + error!(?err, ?unbonding_purse, "error processing unbond"); + err + })?; + match redelegation_result { UnbondRedelegationOutcome::SuccessfullyRedelegated => { // noop; on successful redelegation, no actual unbond occurs } @@ -424,58 +419,18 @@ pub fn process_unbond_requests( | uro @ UnbondRedelegationOutcome::Withdrawal => { // Move funds from bid purse to unbonding purse provider.unbond(unbonding_purse).map_err(|err| { - error!("Error unbonding purse {err:?} ({uro:?})"); + error!(?err, ?uro, "error unbonding purse"); ApiError::from(Error::TransferToUnbondingPurse) })? } } } else { new_unbonding_list.push(unbonding_purse.clone()); - // remember the key of the unbonder that is still not fully unbonded - so that we - // don't prune bids of validators that still have delegators waiting for unbonding, - // or the waiting delegators - still_unbonding_public_keys.insert(unbonding_purse.unbonder_public_key().clone()); } } *unbonding_list = new_unbonding_list; } - // revisit the validators for which we processed some unbonds and see if we can now prune their - // or their delegators' bids - for validator_public_key in processed_validators { - let validator_bid_addr = BidAddr::new_from_public_keys(&validator_public_key, None); - let validator_bid = read_current_validator_bid(provider, validator_bid_addr.into())?; - let validator_public_key = validator_bid.validator_public_key().clone(); // use the current - // public key - let mut delegator_bids = read_delegator_bids(provider, &validator_public_key)?; - - // prune the delegators that have no stake and no remaining unbonds to be processed - delegator_bids.retain(|delegator| { - if delegator.staked_amount().is_zero() - && !still_unbonding_public_keys.contains(delegator.delegator_public_key()) - { - let delegator_bid_addr = BidAddr::new_from_public_keys( - &validator_public_key, - Some(delegator.delegator_public_key()), - ); - debug!("pruning delegator bid {}", delegator_bid_addr); - provider.prune_bid(delegator_bid_addr); - false - } else { - true - } - }); - - // if the validator has no delegators, no stake and no remaining unbonds, prune them, too - if !still_unbonding_public_keys.contains(&validator_public_key) - && delegator_bids.is_empty() - && validator_bid.staked_amount().is_zero() - { - debug!("pruning validator bid {}", validator_bid_addr); - provider.prune_bid(validator_bid_addr); - } - } - set_unbonding_purses(provider, unbonding_purses)?; Ok(()) } @@ -642,16 +597,13 @@ where { let bid_key: Key = BidAddr::from(validator_public_key.clone()).into(); let bonding_purse = match read_current_validator_bid(provider, bid_key) { - Ok(mut validator_bid) if !validator_bid.staked_amount().is_zero() => { - // Only distribute to the bonding purse if the staked amount is not zero - an amount of - // zero indicates a validator that has unbonded, but whose unbonds haven't been - // processed yet. + Ok(mut validator_bid) => { let purse = *validator_bid.bonding_purse(); validator_bid.increase_stake(amount)?; provider.write_bid(bid_key, BidKind::Validator(validator_bid))?; purse } - Ok(_) | Err(Error::ValidatorNotFound) => { + Err(Error::ValidatorNotFound) => { // check to see if there are unbond entries for this recipient, and if there are // apply the amount to the unbond entry with the highest era. let account_hash = validator_public_key.to_account_hash(); @@ -773,12 +725,6 @@ where return Err(Error::DelegationAmountTooLarge.into()); } - if validator_bid.staked_amount().is_zero() { - // The validator has unbonded, but the unbond has not yet been processed, and so an empty - // bid still exists. Treat this case as if there was no such validator. - return Err(Error::ValidatorNotFound.into()); - } - // is there already a record for this delegator? let delegator_bid_key = BidAddr::new_from_public_keys(&validator_public_key, Some(&delegator_public_key)).into(); From b3bcdc9a3d8daf4d819ca2e8c39283846736b93a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Kami=C5=84ski?= Date: Tue, 13 Aug 2024 12:43:28 +0200 Subject: [PATCH 2/4] Add some debug messages --- node/src/components/contract_runtime/operations.rs | 4 ++++ node/src/reactor/main_reactor/keep_up.rs | 7 +++++++ storage/src/system/auction.rs | 6 ++++++ storage/src/system/auction/detail.rs | 10 +++++++++- 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/node/src/components/contract_runtime/operations.rs b/node/src/components/contract_runtime/operations.rs index 825422b9ea..ceb2ac2c70 100644 --- a/node/src/components/contract_runtime/operations.rs +++ b/node/src/components/contract_runtime/operations.rs @@ -715,6 +715,7 @@ pub fn execute_finalized_block( let step_processing_start = Instant::now(); // force undelegate delegators outside delegation limits before the auction runs + debug!("starting forced undelegations"); let forced_undelegate_req = ForcedUndelegateRequest::new( native_runtime_config.clone(), state_root_hash, @@ -734,7 +735,9 @@ pub fn execute_finalized_block( state_root_hash = post_state_hash; } } + debug!("forced undelegations success"); + debug!("committing step"); let step_effects = match commit_step( native_runtime_config, &scratch_state, @@ -758,6 +761,7 @@ pub fn execute_finalized_block( effects } }; + debug!("step committed"); let era_validators_req = EraValidatorsRequest::new(state_root_hash, protocol_version); let era_validators_result = data_access_layer.era_validators(era_validators_req); diff --git a/node/src/reactor/main_reactor/keep_up.rs b/node/src/reactor/main_reactor/keep_up.rs index 012ef81182..6f30ee3d05 100644 --- a/node/src/reactor/main_reactor/keep_up.rs +++ b/node/src/reactor/main_reactor/keep_up.rs @@ -594,6 +594,7 @@ impl MainReactor { match self.storage.get_highest_orphaned_block_header() { HighestOrphanedBlockResult::Orphan(highest_orphaned_block_header) => { if let Some(synched) = self.synched(&highest_orphaned_block_header)? { + debug!(?synched, "synched result"); return Ok(Some(synched)); } let (sync_hash, sync_era) = @@ -647,13 +648,19 @@ impl MainReactor { .map_err(|err| err.to_string())? .last() { + debug!( + highest_switch_timestamp=?highest_switch_block_header.timestamp(), + highest_orphaned_timestamp=?highest_orphaned_block_header.timestamp(), + "checking max ttl"); let max_ttl: MaxTtl = self.chainspec.transaction_config.max_ttl.into(); if max_ttl.synced_to_ttl( highest_switch_block_header.timestamp(), highest_orphaned_block_header, ) { + debug!("is synced to ttl"); return Ok(Some(SyncBackInstruction::TtlSynced)); } + debug!("is not synced to ttl"); } Ok(None) diff --git a/storage/src/system/auction.rs b/storage/src/system/auction.rs index c5228f02af..76cf48e82a 100644 --- a/storage/src/system/auction.rs +++ b/storage/src/system/auction.rs @@ -550,6 +550,8 @@ pub trait Auction: include_credits: bool, credit_cap: Ratio, ) -> Result<(), ApiError> { + debug!("run_auction called"); + if self.get_caller() != PublicKey::System.to_account_hash() { return Err(Error::InvalidCaller.into()); } @@ -563,7 +565,9 @@ pub trait Auction: let mut era_id: EraId = detail::get_era_id(self)?; // Process unbond requests + debug!("processing unbond requests"); detail::process_unbond_requests(self, max_delegators_per_validator)?; + debug!("processing unbond request successful"); let mut validator_bids_detail = detail::get_validator_bids(self, era_id)?; @@ -657,6 +661,8 @@ pub trait Auction: detail::set_validator_bids(self, validator_bids)?; } + debug!("run_auction successful"); + Ok(()) } diff --git a/storage/src/system/auction/detail.rs b/storage/src/system/auction/detail.rs index de97a9bc14..4a01ccde42 100644 --- a/storage/src/system/auction/detail.rs +++ b/storage/src/system/auction/detail.rs @@ -661,7 +661,10 @@ where let validator_bid_addr = BidAddr::from(public_key.clone()); match read_current_validator_bid(provider, validator_bid_addr.into()) { Ok(validator_bid) => validator_bid.validator_public_key().clone(), - Err(_) => return Ok(UnbondRedelegationOutcome::NonexistantRedelegationTarget), + Err(err) => { + error!(?err, ?unbonding_purse, redelegate_to=?public_key, "error redelegating"); + return Ok(UnbondRedelegationOutcome::NonexistantRedelegationTarget); + } } } None => return Ok(UnbondRedelegationOutcome::Withdrawal), @@ -809,6 +812,11 @@ where match provider.read_bid(&bid_key)? { Some(BidKind::Validator(validator_bid)) => return Ok(validator_bid), Some(BidKind::Bridge(bridge)) => { + debug!( + ?bid_key, + ?bridge, + "read_current_validator_bid: bridge found" + ); let validator_bid_addr = BidAddr::from(bridge.new_validator_public_key().clone()); bid_key = validator_bid_addr.into(); } From 712fb18c55872a37a541b69a4d504273eb48fab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Kami=C5=84ski?= Date: Tue, 13 Aug 2024 14:14:03 +0200 Subject: [PATCH 3/4] Fix one overlooked assertion --- .../tests/src/test/system_contracts/auction/distribute.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/execution_engine_testing/tests/src/test/system_contracts/auction/distribute.rs b/execution_engine_testing/tests/src/test/system_contracts/auction/distribute.rs index 9980693cab..3a2fc46dbe 100644 --- a/execution_engine_testing/tests/src/test/system_contracts/auction/distribute.rs +++ b/execution_engine_testing/tests/src/test/system_contracts/auction/distribute.rs @@ -3315,10 +3315,7 @@ fn delegator_full_unbond_during_first_reward_era() { U512::from(DELEGATOR_1_STAKE), ); let delegator = get_delegator_bid(&mut builder, VALIDATOR_1.clone(), DELEGATOR_1.clone()); - assert!(delegator - .expect("should still have zero bid") - .staked_amount() - .is_zero()); + assert!(delegator.is_none()); let withdraws = builder.get_unbonds(); let unbonding_purses = withdraws From ed3a2641bc3f27042ec1e910cd120c764cb38bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Kami=C5=84ski?= Date: Wed, 14 Aug 2024 19:41:17 +0200 Subject: [PATCH 4/4] Remove a debug message --- node/src/reactor/main_reactor/keep_up.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/node/src/reactor/main_reactor/keep_up.rs b/node/src/reactor/main_reactor/keep_up.rs index 6f30ee3d05..5344f6508d 100644 --- a/node/src/reactor/main_reactor/keep_up.rs +++ b/node/src/reactor/main_reactor/keep_up.rs @@ -660,7 +660,6 @@ impl MainReactor { debug!("is synced to ttl"); return Ok(Some(SyncBackInstruction::TtlSynced)); } - debug!("is not synced to ttl"); } Ok(None)