Merge pull request #3028 from bisq-network/hotfix-for-v1.1.3

v1.1.4
This commit is contained in:
Christoph Atteneder 2019-07-29 19:32:04 +02:00 committed by GitHub
commit 3f089134df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 12746 additions and 2026 deletions

View file

@ -276,7 +276,7 @@ configure(project(':desktop')) {
apply plugin: 'witness'
apply from: '../gradle/witness/gradle-witness.gradle'
version = '1.1.3-SNAPSHOT'
version = '1.1.4-SNAPSHOT'
mainClassName = 'bisq.desktop.app.BisqAppMain'

View file

@ -27,7 +27,7 @@ public class Version {
// VERSION = 0.5.0 introduces proto buffer for the P2P network and local DB and is a not backward compatible update
// Therefore all sub versions start again with 1
// We use semantic versioning with major, minor and patch
public static final String VERSION = "1.1.3";
public static final String VERSION = "1.1.4";
public static int getMajorVersion(String version) {
return getSubVersion(version, 0);

View file

@ -17,10 +17,12 @@
package bisq.core.dao.monitoring;
import bisq.core.app.AppOptionKeys;
import bisq.core.dao.DaoSetupService;
import bisq.core.dao.monitoring.model.DaoStateBlock;
import bisq.core.dao.monitoring.model.DaoStateHash;
import bisq.core.dao.monitoring.model.UtxoMismatch;
import bisq.core.dao.monitoring.network.Checkpoint;
import bisq.core.dao.monitoring.network.DaoStateNetworkService;
import bisq.core.dao.monitoring.network.messages.GetDaoStateHashesRequest;
import bisq.core.dao.monitoring.network.messages.NewDaoStateHashMessage;
@ -37,14 +39,21 @@ import bisq.network.p2p.seed.SeedNodeRepository;
import bisq.common.UserThread;
import bisq.common.crypto.Hash;
import bisq.common.storage.FileManager;
import bisq.common.storage.Storage;
import bisq.common.util.Utilities;
import javax.inject.Inject;
import javax.inject.Named;
import org.apache.commons.lang3.ArrayUtils;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import java.io.File;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
@ -80,6 +89,8 @@ public class DaoStateMonitoringService implements DaoSetupService, DaoStateListe
public interface Listener {
void onChangeAfterBatchProcessing();
void onCheckpointFail();
}
private final DaoStateService daoStateService;
@ -101,6 +112,13 @@ public class DaoStateMonitoringService implements DaoSetupService, DaoStateListe
@Getter
private ObservableList<UtxoMismatch> utxoMismatches = FXCollections.observableArrayList();
private List<Checkpoint> checkpoints = Arrays.asList(
new Checkpoint(586920, Utilities.decodeFromHex("523aaad4e760f6ac6196fec1b3ec9a2f42e5b272"))
);
private boolean checkpointFailed;
private boolean ignoreDevMsg;
private final File storageDir;
///////////////////////////////////////////////////////////////////////////////////////////
// Constructor
@ -110,10 +128,14 @@ public class DaoStateMonitoringService implements DaoSetupService, DaoStateListe
public DaoStateMonitoringService(DaoStateService daoStateService,
DaoStateNetworkService daoStateNetworkService,
GenesisTxInfo genesisTxInfo,
SeedNodeRepository seedNodeRepository) {
SeedNodeRepository seedNodeRepository,
@Named(Storage.STORAGE_DIR) File storageDir,
@Named(AppOptionKeys.IGNORE_DEV_MSG_KEY) boolean ignoreDevMsg) {
this.daoStateService = daoStateService;
this.daoStateNetworkService = daoStateNetworkService;
this.genesisTxInfo = genesisTxInfo;
this.storageDir = storageDir;
this.ignoreDevMsg = ignoreDevMsg;
seedNodeAddresses = seedNodeRepository.getSeedNodeAddresses().stream()
.map(NodeAddress::getFullAddress)
.collect(Collectors.toSet());
@ -150,6 +172,10 @@ public class DaoStateMonitoringService implements DaoSetupService, DaoStateListe
// We wait for processing messages until we have completed batch processing
int fromHeight = daoStateService.getChainHeight() - 10;
daoStateNetworkService.requestHashesFromAllConnectedSeedNodes(fromHeight);
if (!ignoreDevMsg) {
verifyCheckpoints();
}
}
@Override
@ -167,6 +193,7 @@ public class DaoStateMonitoringService implements DaoSetupService, DaoStateListe
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// StateNetworkService.Listener
///////////////////////////////////////////////////////////////////////////////////////////
@ -291,7 +318,8 @@ public class DaoStateMonitoringService implements DaoSetupService, DaoStateListe
}
}
private boolean processPeersDaoStateHash(DaoStateHash daoStateHash, Optional<NodeAddress> peersNodeAddress, boolean notifyListeners) {
private boolean processPeersDaoStateHash(DaoStateHash daoStateHash, Optional<NodeAddress> peersNodeAddress,
boolean notifyListeners) {
AtomicBoolean changed = new AtomicBoolean(false);
AtomicBoolean inConflictWithNonSeedNode = new AtomicBoolean(this.isInConflictWithNonSeedNode);
AtomicBoolean inConflictWithSeedNode = new AtomicBoolean(this.isInConflictWithSeedNode);
@ -338,4 +366,49 @@ public class DaoStateMonitoringService implements DaoSetupService, DaoStateListe
return changed.get();
}
private void verifyCheckpoints() {
// Checkpoint
checkpoints.forEach(checkpoint -> daoStateHashChain.stream()
.filter(daoStateHash -> daoStateHash.getHeight() == checkpoint.getHeight())
.findAny()
.ifPresent(daoStateHash -> {
if (Arrays.equals(daoStateHash.getHash(), checkpoint.getHash())) {
log.info("Passed checkpoint {}", checkpoint.toString());
} else {
if (checkpointFailed) {
return;
}
checkpointFailed = true;
try {
// Delete state and stop
removeFile("DaoStateStore");
removeFile("BlindVoteStore");
removeFile("ProposalStore");
removeFile("TempProposalStore");
listeners.forEach(Listener::onCheckpointFail);
log.error("Failed checkpoint {}", checkpoint.toString());
} catch (Throwable t) {
t.printStackTrace();
log.error(t.toString());
}
}
}));
}
private void removeFile(String storeName) {
long currentTime = System.currentTimeMillis();
String newFileName = storeName + "_" + currentTime;
String backupDirName = "out_of_sync_dao_data";
File corrupted = new File(storageDir, storeName);
try {
if (corrupted.exists()) {
FileManager.removeAndBackupFile(storageDir, corrupted, newFileName, backupDirName);
}
} catch (Throwable t) {
t.printStackTrace();
log.error(t.toString());
}
}
}

View file

@ -0,0 +1,45 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.core.dao.monitoring.network;
import bisq.common.util.Utilities;
import lombok.Getter;
import lombok.Setter;
@Getter
public class Checkpoint {
final int height;
final byte[] hash;
@Setter
boolean passed;
public Checkpoint(int height, byte[] hash) {
this.height = height;
this.hash = hash;
}
@Override
public String toString() {
return "Checkpoint {" +
"\n height=" + height +
",\n hash=" + Utilities.bytesAsHexString(hash) +
"\n}";
}
}

View file

@ -39,6 +39,7 @@ public class LanguageUtil {
"fr", // French
"vi", // Vietnamese
"th", // Thai
"ja", // Japanese
"fa" // Persian
/*
// not translated yet
@ -47,7 +48,6 @@ public class LanguageUtil {
"ro", // Romanian
"tr" // Turkish
"it", // Italian
"ja", // Japanese
"iw", // Hebrew
"hi", // Hindi
"ko", // Korean

View file

@ -1971,6 +1971,8 @@ dao.monitor.daoState.utxoConflicts=UTXO conflicts
dao.monitor.daoState.utxoConflicts.blockHeight=Block height: {0}
dao.monitor.daoState.utxoConflicts.sumUtxo=Sum of all UTXO: {0} BSQ
dao.monitor.daoState.utxoConflicts.sumBsq=Sum of all BSQ: {0} BSQ
dao.monitor.daoState.checkpoint.popup=DAO state is not in sync with the network. \
After restart the DAO state will resync.
dao.monitor.proposal.headline=Proposals state
dao.monitor.proposal.table.headline=Chain of proposal state hashes

File diff suppressed because it is too large Load diff

View file

@ -2301,7 +2301,7 @@ payment.f2f.extra=Informations complémentaires
payment.f2f.extra.prompt=Le maker peut définir des " conditions générales " ou ajouter des informations publiques de contact. Cela apparaîtra avec l'offre.
payment.f2f.info=Les transactions en face à face comportent des règles différentes et des risques différents par rapport aux transactions en ligne.\n\nLes principales différences sont :\n● Les pairs de trading doivent échanger des informations sur le lieu et l'heure de la réunion en utilisant les coordonnées communiquées.\n● Les pairs de trading doivent apporter leur ordinateur portable et faire la confirmation du 'payment sent' et du 'payment received' sur le lieu de la rencontre.\n● Si un maker a des 'terms and conditions', il doit les indiquer dans le champ de texte 'Informations supplémentaires' du compte.\n● En acceptant une offre, le taker accepte les 'terms and conditions' énoncées par le maker.\n● En cas de litige, l'arbitre ne peut pas beaucoup aider car il est généralement difficile d'obtenir une preuve inviolable de ce qui s'est passé lors de la rencontre. Dans de tels cas, les fonds en BTC peuvent être bloqués indéfiniment ou jusqu'à ce que les pairs de trading parviennent à un accord.\n\nPour être sûr que vous comprenez bien les différences induites par les transactions en face à face, veuillez lire les instructions et les recommandations à l'adresse : https://docs.bisq.network/trading-rules.html#f2f-trading
payment.f2f.info.openURL=Ouvrir la page web
payment.f2f.offerbook.tooltip.countryAndCity=Département et ville: {0} / {1}
payment.f2f.offerbook.tooltip.countryAndCity=Pays et ville: {0} / {1}
payment.f2f.offerbook.tooltip.extra=Informations complémentaires: {0}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
cd $(dirname $0)
tx pull -l de,el_GR,es,pt,ru,zh_CN,vi,th_TH,fa,fr
tx pull -l de,el_GR,es,ja,pt,ru,zh_CN,vi,th_TH,fa,fr
translations="translations/bisq-desktop.displaystringsproperties"
i18n="src/main/resources/i18n"
@ -9,6 +9,7 @@ i18n="src/main/resources/i18n"
mv "$translations/de.properties" "$i18n/displayStrings_de.properties"
mv "$translations/el_GR.properties" "$i18n/displayStrings_el.properties"
mv "$translations/es.properties" "$i18n/displayStrings_es.properties"
mv "$translations/ja.properties" "$i18n/displayStrings_ja.properties"
mv "$translations/pt.properties" "$i18n/displayStrings_pt.properties"
mv "$translations/ru.properties" "$i18n/displayStrings_ru.properties"
mv "$translations/zh_CN.properties" "$i18n/displayStrings_zh.properties"

View file

@ -8,7 +8,7 @@
# pull base image
FROM openjdk:8-jdk
ENV version 1.1.3-SNAPSHOT
ENV version 1.1.4-SNAPSHOT
RUN apt-get update && apt-get install -y --no-install-recommends openjfx && rm -rf /var/lib/apt/lists/* &&
apt-get install -y vim fakeroot

View file

@ -6,7 +6,7 @@
# - Update version below
# - Ensure JAVA_HOME below is pointing to OracleJDK 10 directory
version=1.1.3-SNAPSHOT
version=1.1.4-SNAPSHOT
if [ ! -f "$JAVA_HOME/bin/javapackager" ]; then
if [ -d "/usr/lib/jvm/jdk-10.0.2" ]; then
JAVA_HOME=/usr/lib/jvm/jdk-10.0.2

View file

@ -4,7 +4,7 @@
# Prior to running this script:
# - Update version below
version=1.1.3-SNAPSHOT
version=1.1.4-SNAPSHOT
base_dir=$( cd "$(dirname "$0")" ; pwd -P )/../../..
package_dir=$base_dir/desktop/package
release_dir=$base_dir/desktop/release/$version

View file

@ -5,10 +5,10 @@
<!-- See: https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -->
<key>CFBundleVersion</key>
<string>1.1.3</string>
<string>1.1.4</string>
<key>CFBundleShortVersionString</key>
<string>1.1.3</string>
<string>1.1.4</string>
<key>CFBundleExecutable</key>
<string>Bisq</string>

View file

@ -6,7 +6,7 @@ mkdir -p deploy
set -e
version="1.1.3-SNAPSHOT"
version="1.1.4-SNAPSHOT"
cd ..
./gradlew :desktop:build -x test shadowJar

View file

@ -2,7 +2,7 @@
cd ../../
version="1.1.3-SNAPSHOT"
version="1.1.4-SNAPSHOT"
target_dir="releases/$version"

View file

@ -2,7 +2,7 @@
cd $(dirname $0)/../../../
version=1.1.3
version=1.1.4
find . -type f \( -name "finalize.sh" \
-o -name "create_app.sh" \

View file

@ -2,8 +2,8 @@
cd $(dirname $0)/../../../
oldVersion=1.1.2
newVersion=1.1.3
oldVersion=1.1.3
newVersion=1.1.4
find . -type f \( -name "finalize.sh" \
-o -name "create_app.sh" \

View file

@ -8,7 +8,7 @@
@echo off
set version=1.1.3-SNAPSHOT
set version=1.1.4-SNAPSHOT
if not exist "%JAVA_HOME%\bin\javapackager.exe" (
if not exist "%ProgramFiles%\Java\jdk-10.0.2" (
echo Javapackager not found. Update JAVA_HOME variable to point to OracleJDK.

View file

@ -6,7 +6,7 @@
@echo off
set version=1.1.3-SNAPSHOT
set version=1.1.4-SNAPSHOT
set release_dir=%~dp0..\..\..\releases\%version%
set package_dir=%~dp0..

View file

@ -39,6 +39,7 @@ import bisq.desktop.main.portfolio.PortfolioView;
import bisq.desktop.main.settings.SettingsView;
import bisq.desktop.util.Transitions;
import bisq.core.dao.monitoring.DaoStateMonitoringService;
import bisq.core.exceptions.BisqException;
import bisq.core.locale.GlobalSettings;
import bisq.core.locale.Res;
@ -104,7 +105,8 @@ import static javafx.scene.layout.AnchorPane.setTopAnchor;
@FxmlView
@Slf4j
public class MainView extends InitializableView<StackPane, MainViewModel> {
public class MainView extends InitializableView<StackPane, MainViewModel>
implements DaoStateMonitoringService.Listener {
// If after 30 sec we have not got connected we show "open network settings" button
private final static int SHOW_TOR_SETTINGS_DELAY_SEC = 90;
private Label versionLabel;
@ -150,18 +152,21 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
private ProgressBar btcSyncIndicator, p2pNetworkProgressBar;
private Label btcSplashInfo;
private Popup<?> p2PNetworkWarnMsgPopup, btcNetworkWarnMsgPopup;
private final DaoStateMonitoringService daoStateMonitoringService;
@Inject
public MainView(MainViewModel model,
CachingViewLoader viewLoader,
Navigation navigation,
Transitions transitions,
BSFormatter formatter) {
BSFormatter formatter,
DaoStateMonitoringService daoStateMonitoringService) {
super(model);
this.viewLoader = viewLoader;
this.navigation = navigation;
this.formatter = formatter;
MainView.transitions = transitions;
this.daoStateMonitoringService = daoStateMonitoringService;
}
@Override
@ -387,10 +392,33 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
}
});
daoStateMonitoringService.addListener(this);
// Delay a bit to give time for rendering the splash screen
UserThread.execute(() -> onUiReadyHandler.run());
}
///////////////////////////////////////////////////////////////////////////////////////////
// DaoStateMonitoringService.Listener
///////////////////////////////////////////////////////////////////////////////////////////
@Override
public void onChangeAfterBatchProcessing() {
}
@Override
public void onCheckpointFail() {
new Popup<>().attention(Res.get("dao.monitor.daoState.checkpoint.popup"))
.useShutDownButton()
.hideCloseButton()
.show();
}
///////////////////////////////////////////////////////////////////////////////////////////
// Helpers
///////////////////////////////////////////////////////////////////////////////////////////
@NotNull
private Separator getNavigationSeparator() {
final Separator separator = new Separator(Orientation.VERTICAL);

View file

@ -117,6 +117,9 @@ public class DaoStateMonitorView extends StateMonitorView<DaoStateHash, DaoState
}
}
@Override
public void onCheckpointFail() {
}
///////////////////////////////////////////////////////////////////////////////////////////
// Implementation abstract methods

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -1 +1 @@
1.1.3-SNAPSHOT
1.1.4-SNAPSHOT

View file

@ -34,7 +34,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class SeedNodeMain extends ExecutableForAppWithP2p {
private static final String VERSION = "1.1.3";
private static final String VERSION = "1.1.4";
private SeedNode seedNode;
public SeedNodeMain() {