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

chore(release): bump version to v2.4.11 #514

Merged
merged 21 commits into from
Sep 21, 2023
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 DashSync.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Pod::Spec.new do |s|
s.ios.framework = 'UIKit'
s.macos.framework = 'Cocoa'
s.compiler_flags = '-Wno-comma'
s.dependency 'DashSharedCore', '0.4.10'
s.dependency 'DashSharedCore', '0.4.11'
s.dependency 'CocoaLumberjack', '3.7.2'
s.ios.dependency 'DWAlertController', '0.2.1'
s.dependency 'DSDynamicOptions', '0.1.2'
Expand Down
4 changes: 2 additions & 2 deletions DashSync/shared/DashSync.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ - (void)startSyncForChain:(DSChain *)chain {
- (void)stopSyncAllChains {
NSArray *chains = [[DSChainsManager sharedInstance] chains];
for (DSChain *chain in chains) {
[[[DSChainsManager sharedInstance] chainManagerForChain:chain].peerManager disconnect];
[[[DSChainsManager sharedInstance] chainManagerForChain:chain].peerManager disconnect: DSDisconnectReason_ChainWipe];
}
}

Expand All @@ -136,7 +136,7 @@ - (void)wipePeerDataForChain:(DSChain *)chain inContext:(NSManagedObjectContext

[self stopSyncForChain:chain];
[[[DSChainsManager sharedInstance] chainManagerForChain:chain].peerManager removeTrustedPeerHost];
[[[DSChainsManager sharedInstance] chainManagerForChain:chain].peerManager clearPeers];
[[[DSChainsManager sharedInstance] chainManagerForChain:chain].peerManager clearPeers:DSDisconnectReason_ChainWipe];
[context performBlockAndWait:^{
DSChainEntity *chainEntity = [chain chainEntityInContext:context];
[DSPeerEntity deletePeersForChainEntity:chainEntity];
Expand Down
562 changes: 276 additions & 286 deletions DashSync/shared/Models/Chain/DSChain.m

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ - (void)updateAttributesFromSimplifiedMasternodeEntry:(DSSimplifiedMasternodeEnt

- (void)updateAttributesFromSimplifiedMasternodeEntry:(DSSimplifiedMasternodeEntry *)simplifiedMasternodeEntry atBlockHeight:(uint32_t)blockHeight knownOperatorAddresses:(NSDictionary<NSString *, DSAddressEntity *> *)knownOperatorAddresses knownVotingAddresses:(NSDictionary<NSString *, DSAddressEntity *> *)knownVotingAddresses localMasternodes:(NSDictionary<NSData *, DSLocalMasternodeEntity *> *)localMasternodes {
if (self.updateHeight < blockHeight) {
NSAssert(simplifiedMasternodeEntry.updateHeight == blockHeight, @"the block height should be the same as the entry update height");
//NSAssert(simplifiedMasternodeEntry.updateHeight == blockHeight, @"the block height should be the same as the entry update height");
pankcuf marked this conversation as resolved.
Show resolved Hide resolved
self.updateHeight = blockHeight;
//we should only update if the data received is the most recent
if (!uint128_eq(self.ipv6Address.UInt128, simplifiedMasternodeEntry.address)) {
Expand Down Expand Up @@ -156,6 +156,7 @@ - (void)setAttributesFromSimplifiedMasternodeEntry:(DSSimplifiedMasternodeEntry
if (simplifiedMasternodeEntry.updateHeight != blockHeight) {
DSLog(@"• setAttributesFromSimplifiedMasternodeEntry: list.height %u != entry.height %u", blockHeight, simplifiedMasternodeEntry.updateHeight);
}
// TODO: make sure we're doing
// NSAssert(simplifiedMasternodeEntry.updateHeight == blockHeight, ([NSString stringWithFormat:@"the block height (%i) for %@ should be the same as the entry update height (%i)", blockHeight, uint256_hex(simplifiedMasternodeEntry.providerRegistrationTransactionHash), simplifiedMasternodeEntry.updateHeight]));
if (!chainEntity) {
self.chain = [simplifiedMasternodeEntry.chain chainEntityInContext:self.managedObjectContext];
Expand Down
18 changes: 11 additions & 7 deletions DashSync/shared/Models/Managers/Chain Managers/DSChainManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,8 @@ - (double)combinedSyncProgress {
DSLog(@"combinedSyncProgress breakdown %f %f %f", self.terminalHeaderSyncProgress, self.masternodeManager.masternodeListAndQuorumsSyncProgress, self.chainSyncProgress);
#endif
if ((self.terminalHeaderSyncWeight + self.chainSyncWeight + self.masternodeListSyncWeight) == 0) {
if (self.peerManager.connected) {
return 1;
} else {
return 0;
@synchronized (self.peerManager) {
return self.peerManager.connected ? 1 : 0;
}
} else {
double progress = self.terminalHeaderSyncProgress * self.terminalHeaderSyncWeight + self.masternodeManager.masternodeListAndQuorumsSyncProgress * self.masternodeListSyncWeight + self.chainSyncProgress * self.chainSyncWeight;
Expand Down Expand Up @@ -471,11 +469,12 @@ - (void)startSync {
object:nil
userInfo:@{DSChainManagerNotificationChainKey: self.chain}];
});
DSLog(@"startSync -> peerManager::connect");
[self.peerManager connect];
}

- (void)stopSync {
[self.peerManager disconnect];
[self.peerManager disconnect:DSDisconnectReason_ChainSwitch];
self.syncPhase = DSChainSyncPhase_Offline;
}

Expand All @@ -497,6 +496,7 @@ - (void)disconnectedMasternodeListAndBlocksRescan {
object:nil
userInfo:@{DSChainManagerNotificationChainKey: self.chain}];
});
DSLog(@"disconnectedMasternodeListAndBlocksRescan -> peerManager::connect");
[self.peerManager connect];
}

Expand All @@ -510,6 +510,7 @@ - (void)disconnectedMasternodeListRescan {
object:nil
userInfo:@{DSChainManagerNotificationChainKey: self.chain}];
});
DSLog(@"disconnectedMasternodeListRescan -> peerManager::connect");
[self.peerManager connect];
}

Expand All @@ -523,6 +524,7 @@ - (void)disconnectedSyncBlocksRescan {
object:nil
userInfo:@{DSChainManagerNotificationChainKey: self.chain}];
});
DSLog(@"disconnectedSyncBlocksRescan -> peerManager::connect");
[self.peerManager connect];
}

Expand Down Expand Up @@ -650,7 +652,8 @@ - (void)chainShouldStartSyncingBlockchain:(DSChain *)chain onPeer:(DSPeer *)peer
}

- (void)chainFinishedSyncingInitialHeaders:(DSChain *)chain fromPeer:(DSPeer *)peer onMainChain:(BOOL)onMainChain {
if (onMainChain && peer && (peer == self.peerManager.downloadPeer)) self.lastChainRelayTime = [NSDate timeIntervalSince1970];
if (onMainChain && peer && (peer == self.peerManager.downloadPeer)) [self relayedNewItem];

[self.peerManager chainSyncStopped];
if (([[DSOptionsManager sharedInstance] syncType] & DSSyncType_MasternodeList)) {
// make sure we care about masternode lists
Expand All @@ -659,7 +662,7 @@ - (void)chainFinishedSyncingInitialHeaders:(DSChain *)chain fromPeer:(DSPeer *)p
}

- (void)chainFinishedSyncingTransactionsAndBlocks:(DSChain *)chain fromPeer:(DSPeer *)peer onMainChain:(BOOL)onMainChain {
if (onMainChain && peer && (peer == self.peerManager.downloadPeer)) self.lastChainRelayTime = [NSDate timeIntervalSince1970];
if (onMainChain && peer && (peer == self.peerManager.downloadPeer)) [self relayedNewItem];
DSLog(@"chain finished syncing");
self.chainSyncStartHeight = 0;
self.syncPhase = DSChainSyncPhase_Synced;
Expand All @@ -678,6 +681,7 @@ - (void)syncBlockchain {
if (self.syncPhase == DSChainSyncPhase_InitialTerminalBlocks) {
self.syncPhase = DSChainSyncPhase_ChainSync;
}
DSLog(@"syncBlockchain -> peerManager::connect");
[self.peerManager connect];
} else if (!self.peerManager.masternodeList && self.masternodeManager.currentMasternodeList) {
[self.peerManager useMasternodeList:self.masternodeManager.currentMasternodeList withConnectivityNonce:self.sessionConnectivityNonce];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ - (DSGovernanceVote *)peer:(DSPeer *_Nullable)peer requestedVote:(UInt256)voteHa

- (void)peer:(DSPeer *)peer ignoredGovernanceSync:(DSGovernanceRequestState)governanceRequestState {
[self.peerManager peerMisbehaving:peer errorMessage:@"Ignored Governance Sync"];
DSLog(@"ignoredGovernanceSync -> peerManager::connect");
[self.peerManager connect];
}

Expand Down
Loading