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

Release/v1.9.8 #6482

Merged
merged 37 commits into from
Dec 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
68ea90a
Bump version number for v1.9.7
ripcurlx Dec 14, 2022
72dea08
Update translations for v1.9.7
ripcurlx Dec 14, 2022
afba2f2
Update bitcoinj checkpoints for v1.9.7
ripcurlx Dec 14, 2022
2b77f77
Update data stores for v1.9.7
ripcurlx Dec 14, 2022
98349a2
Merge pull request #6461 from ripcurlx/update-data-stores-for-v1.9.7
ripcurlx Dec 15, 2022
6aad3a8
Reduce getDataResponse size from 9 MB to 6 MB
HenrikJannsen Dec 16, 2022
ddf5239
Increase timeouts from 3 to 4 min.
HenrikJannsen Dec 16, 2022
1cf51be
Update sqrrm provided btc onion addresses
sqrrm Dec 16, 2022
9ce2964
Fix divide by zero errors in Trade history summary.
Dec 17, 2022
1dd83e5
Add check for price==0
HenrikJannsen Dec 14, 2022
2f9f662
Remove try catch. Will be handled in Future fault handler
HenrikJannsen Dec 14, 2022
709f0e1
Change burn target calculation.
HenrikJannsen Dec 15, 2022
7eed7a4
In case we have capped burn shares we redistribute the share from the…
HenrikJannsen Dec 15, 2022
1aa5a9b
Don't allow the myBurnAmount to be larger than the upperBaseTarget
HenrikJannsen Dec 15, 2022
3e362c3
Refactor: move out fields used the same way in both if/else branches.
HenrikJannsen Dec 15, 2022
80063d7
Add custom handling of legacy BM.
HenrikJannsen Dec 15, 2022
16bfdd6
Remove regtest value for DEFAULT_ESTIMATED_BTC_TRADE_FEE_REVENUE_PER_…
HenrikJannsen Dec 15, 2022
a263ca5
Remove numIssuance and numBurnOutputs columns to save space
HenrikJannsen Dec 15, 2022
a76267b
Use static fields for opReturnData instead of hardcoded mainnet hashes
HenrikJannsen Dec 15, 2022
1b18274
Update BurningManAccountingStore_BTC_MAINNET
HenrikJannsen Dec 15, 2022
c268cc4
Add new average bsq price after historical data
HenrikJannsen Dec 15, 2022
2be5d2f
Increase GENESIS_OUTPUT_AMOUNT_FACTOR and ISSUANCE_BOOST_FACTOR
HenrikJannsen Dec 15, 2022
109c200
Add balance fields for DAO revenue with total burned BSQ and total di…
HenrikJannsen Dec 16, 2022
618e610
Exclude legacy BM from DAO balance
HenrikJannsen Dec 18, 2022
f834fbd
Add sanity check that max share of a non-legacy BM is 20% over MAX_BU…
HenrikJannsen Dec 18, 2022
bd85958
Add sanity check for a min. block height for the snapshot height
HenrikJannsen Dec 18, 2022
0b84980
Fix test
HenrikJannsen Dec 18, 2022
8eb555d
Add INVALID_SNAPSHOT_HEIGHT to AvailabilityResult.
HenrikJannsen Dec 18, 2022
9f8b3df
Base initial limit from users max past trade size if applicable.
Dec 19, 2022
30afccb
Use ThreadPoolExecutor with custom set queueCapacity instead of Cache…
HenrikJannsen Dec 16, 2022
d99452c
Not use additional `-%d` in name format because of refactoring
ripcurlx Dec 20, 2022
4fb0420
Remove price node and seed nodes of @miker and @mrosseel
HenrikJannsen Dec 20, 2022
d1a2811
Add back distribution tar generation for daemon and cli
ripcurlx Dec 20, 2022
cdb9fe4
Bump version number for v1.9.8
ripcurlx Dec 22, 2022
4a72c27
Increase queue capacity from 10 to 30.
HenrikJannsen Dec 22, 2022
fae711e
Revert to SNAPSHOT version
ripcurlx Dec 23, 2022
2e244c8
Remove unused signing key
ripcurlx Dec 23, 2022
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
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ configure(project(':core')) {
}

configure(project(':cli')) {
distTar.enabled = true

mainClassName = 'bisq.cli.CliMain'

dependencies {
Expand Down Expand Up @@ -527,6 +529,8 @@ configure(project(':statsnode')) {
}

configure(project(':daemon')) {
distTar.enabled = true

mainClassName = 'bisq.daemon.app.BisqDaemonMain'

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/java/bisq/common/app/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,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.9.6";
public static final String VERSION = "1.9.8";

/**
* Holds a list of the tagged resource files for optimizing the getData requests.
Expand All @@ -45,7 +45,7 @@ public class Version {
*/
public static final List<String> HISTORICAL_RESOURCE_FILE_VERSION_TAGS = Arrays.asList("1.4.0", "1.5.0", "1.5.2",
"1.5.5", "1.5.7", "1.6.0", "1.6.3", "1.6.5", "1.7.2", "1.7.4", "1.8.0", "1.8.1", "1.8.3", "1.9.0", "1.9.3",
"1.9.5", "1.9.6");
"1.9.5", "1.9.6", "1.9.7");

public static int getMajorVersion(String version) {
return getSubVersion(version, 0);
Expand Down
38 changes: 19 additions & 19 deletions common/src/main/java/bisq/common/util/Utilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -101,7 +100,15 @@ public static ListeningExecutorService getListeningExecutorService(String name,
int corePoolSize,
int maximumPoolSize,
long keepAliveTimeInSec) {
return MoreExecutors.listeningDecorator(getThreadPoolExecutor(name, corePoolSize, maximumPoolSize, keepAliveTimeInSec));
return getListeningExecutorService(name, corePoolSize, maximumPoolSize, maximumPoolSize, keepAliveTimeInSec);
}

public static ListeningExecutorService getListeningExecutorService(String name,
int corePoolSize,
int maximumPoolSize,
int queueCapacity,
long keepAliveTimeInSec) {
return MoreExecutors.listeningDecorator(getThreadPoolExecutor(name, corePoolSize, maximumPoolSize, queueCapacity, keepAliveTimeInSec));
}

public static ListeningExecutorService getListeningExecutorService(String name,
Expand All @@ -116,8 +123,17 @@ public static ThreadPoolExecutor getThreadPoolExecutor(String name,
int corePoolSize,
int maximumPoolSize,
long keepAliveTimeInSec) {
return getThreadPoolExecutor(name, corePoolSize, maximumPoolSize, maximumPoolSize, keepAliveTimeInSec);
}


public static ThreadPoolExecutor getThreadPoolExecutor(String name,
int corePoolSize,
int maximumPoolSize,
int queueCapacity,
long keepAliveTimeInSec) {
return getThreadPoolExecutor(name, corePoolSize, maximumPoolSize, keepAliveTimeInSec,
new ArrayBlockingQueue<>(maximumPoolSize));
new ArrayBlockingQueue<>(queueCapacity));
}

private static ThreadPoolExecutor getThreadPoolExecutor(String name,
Expand All @@ -135,22 +151,6 @@ private static ThreadPoolExecutor getThreadPoolExecutor(String name,
return executor;
}

public static ExecutorService newCachedThreadPool(String name,
int maximumPoolSize,
long keepAliveTime,
TimeUnit timeUnit) {
ThreadFactory threadFactory = new ThreadFactoryBuilder()
.setNameFormat(name + "-%d")
.setDaemon(true)
.build();
return new ThreadPoolExecutor(0,
maximumPoolSize,
keepAliveTime,
timeUnit,
new SynchronousQueue<>(),
threadFactory);
}

@SuppressWarnings("SameParameterValue")
public static ScheduledThreadPoolExecutor getScheduledThreadPoolExecutor(String name,
int corePoolSize,
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/bisq/core/btc/nodes/BtcNodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public List<BtcNode> getProvidedBtcNodes() {
new BtcNode("btc2.vante.me", "bsqbtcparrfihlwolt4xgjbf4cgqckvrvsfyvy6vhiqrnh4w6ghixoid.onion", "94.23.205.110", BtcNode.DEFAULT_PORT, "@miker"),

// sqrrm
new BtcNode("btc1.sqrrm.net", "jygcc54etaubgdpcvzgbihjaqbc37cstpvum5sjzvka4bibkp4wrgnqd.onion", "185.25.48.184", BtcNode.DEFAULT_PORT, "@sqrrm"),
new BtcNode("btc2.sqrrm.net", "h32haomoe52ljz6qopedsocvotvoj5lm2zmecfhdhawb3flbsf64l2qd.onion", "81.171.22.143", BtcNode.DEFAULT_PORT, "@sqrrm"),
new BtcNode("btc1.sqrrm.net", "cwi3ekrwhig47dhhzfenr5hbvckj7fzaojygvazi2lucsenwbzwoyiqd.onion", "185.25.48.184", BtcNode.DEFAULT_PORT, "@sqrrm"),
new BtcNode("btc2.sqrrm.net", "upvthy74hgvgbqi6w3zd2mlchoi5tvvw7b5hpmmhcddd5fnnwrixneid.onion", "81.171.22.143", BtcNode.DEFAULT_PORT, "@sqrrm"),

// Devin Bileck
new BtcNode("btc1.bisq.services", "devinbtctu7uctl7hly2juu3thbgeivfnvw3ckj3phy6nyvpnx66yeyd.onion", "172.105.21.216", BtcNode.DEFAULT_PORT, "@devinbileck"),
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/bisq/core/crypto/ScryptUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static KeyCrypterScrypt getKeyCrypterScrypt() {
}

public static void deriveKeyWithScrypt(KeyCrypterScrypt keyCrypterScrypt, String password, DeriveKeyResultHandler resultHandler) {
Utilities.getThreadPoolExecutor("ScryptUtil:deriveKeyWithScrypt-%d", 1, 2, 5L).submit(() -> {
Utilities.getThreadPoolExecutor("ScryptUtil:deriveKeyWithScrypt", 1, 2, 5L).submit(() -> {
try {
log.debug("Doing key derivation");
long start = System.currentTimeMillis();
Expand Down
41 changes: 33 additions & 8 deletions core/src/main/java/bisq/core/dao/burningman/BurnTargetService.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@

import lombok.extern.slf4j.Slf4j;

import static bisq.core.dao.burningman.BurningManPresentationService.OP_RETURN_DATA_LEGACY_BM_DPT;
import static bisq.core.dao.burningman.BurningManPresentationService.OP_RETURN_DATA_LEGACY_BM_FEES;

/**
* Burn target related API. Not touching trade protocol aspects and parameters can be changed here without risking to
* break trade protocol validations.
Expand All @@ -56,10 +59,13 @@ class BurnTargetService {
private static final int NUM_CYCLES_BURN_TARGET = 12;
private static final int NUM_CYCLES_AVERAGE_DISTRIBUTION = 3;

// Estimated block at activation date
private static final int ACTIVATION_BLOCK = Config.baseCurrencyNetwork().isRegtest() ? 111 : 769845;

// Default value for the estimated BTC trade fees per month as BSQ sat value (100 sat = 1 BSQ).
// Default is roughly average of last 12 months at Nov 2022.
// Can be changed with DAO parameter voting.
private static final long DEFAULT_ESTIMATED_BTC_TRADE_FEE_REVENUE_PER_CYCLE = Config.baseCurrencyNetwork().isRegtest() ? 1000000 : 6200000;
private static final long DEFAULT_ESTIMATED_BTC_TRADE_FEE_REVENUE_PER_CYCLE = 6200000;

private final DaoStateService daoStateService;
private final CyclesInDaoStateService cyclesInDaoStateService;
Expand Down Expand Up @@ -102,7 +108,7 @@ Set<ReimbursementModel> getReimbursements(int chainHeight) {
long getBurnTarget(int chainHeight, Collection<BurningManCandidate> burningManCandidates) {
// Reimbursements are taken into account at result vote block
int chainHeightOfPastCycle = cyclesInDaoStateService.getChainHeightOfPastCycle(chainHeight, NUM_CYCLES_BURN_TARGET);
long accumulatedReimbursements = getAccumulatedReimbursements(chainHeight, chainHeightOfPastCycle);
long accumulatedReimbursements = getAdjustedAccumulatedReimbursements(chainHeight, chainHeightOfPastCycle);

// Param changes are taken into account at first block at next cycle after voting
int heightOfFirstBlockOfPastCycle = cyclesInDaoStateService.getHeightOfFirstBlockOfPastCycle(chainHeight, NUM_CYCLES_BURN_TARGET - 1);
Expand Down Expand Up @@ -140,7 +146,7 @@ long getBurnTarget(int chainHeight, Collection<BurningManCandidate> burningManCa
long getAverageDistributionPerCycle(int chainHeight) {
// Reimbursements are taken into account at result vote block
int chainHeightOfPastCycle = cyclesInDaoStateService.getChainHeightOfPastCycle(chainHeight, NUM_CYCLES_AVERAGE_DISTRIBUTION);
long reimbursements = getAccumulatedReimbursements(chainHeight, chainHeightOfPastCycle);
long reimbursements = getAdjustedAccumulatedReimbursements(chainHeight, chainHeightOfPastCycle);

// Param changes are taken into account at first block at next cycle after voting
int firstBlockOfPastCycle = cyclesInDaoStateService.getHeightOfFirstBlockOfPastCycle(chainHeight, NUM_CYCLES_AVERAGE_DISTRIBUTION - 1);
Expand All @@ -162,11 +168,31 @@ private Stream<ReimbursementProposal> getReimbursementProposalsForIssuance(Issua
.map(proposal -> (ReimbursementProposal) proposal);
}

private long getAccumulatedReimbursements(int chainHeight, int fromBlock) {
private long getAdjustedAccumulatedReimbursements(int chainHeight, int fromBlock) {
return getReimbursements(chainHeight).stream()
.filter(reimbursementModel -> reimbursementModel.getHeight() > fromBlock)
.filter(reimbursementModel -> reimbursementModel.getHeight() <= chainHeight)
.mapToLong(ReimbursementModel::getAmount)
.mapToLong(reimbursementModel -> {
long amount = reimbursementModel.getAmount();
if (reimbursementModel.getHeight() > ACTIVATION_BLOCK) {
// As we do not pay out the losing party's security deposit we adjust this here.
// We use 15% as the min. security deposit as we do not have the detail data.
// A trade with 1 BTC has 1.3 BTC in the DPT which goes to BM. The reimbursement is
// only BSQ equivalent to 1.15 BTC. So we map back the 1.15 BTC to 1.3 BTC to account for
// that what the BM received.
// There are multiple unknowns included:
// - Real security deposit can be higher
// - Refund agent can make a custom payout, paying out more or less than expected
// - BSQ/BTC volatility
// - Delay between DPT and reimbursement
long adjusted = Math.round(amount * 1.3 / 1.15);
return adjusted;
} else {
// For old reimbursements we do not apply the adjustment as we had a different policy for
// reimbursing out 100% of the DPT.
return amount;
}
})
.sum();
}

Expand Down Expand Up @@ -202,8 +228,7 @@ private long getBurnedAmountFromLegacyBurningManDPT(Set<Tx> proofOfBurnTxs, int
.filter(tx -> tx.getBlockHeight() <= chainHeight)
.filter(tx -> {
String hash = Hex.encode(tx.getLastTxOutput().getOpReturnData());
return "1701e47e5d8030f444c182b5e243871ebbaeadb5e82f".equals(hash) ||
"1701293c488822f98e70e047012f46f5f1647f37deb7".equals(hash);
return OP_RETURN_DATA_LEGACY_BM_DPT.contains(hash);
})
.mapToLong(Tx::getBurntBsq)
.sum();
Expand All @@ -214,7 +239,7 @@ private long getBurnedAmountFromLegacyBurningMansBtcFees(Set<Tx> proofOfBurnTxs,
return proofOfBurnTxs.stream()
.filter(tx -> tx.getBlockHeight() > fromBlock)
.filter(tx -> tx.getBlockHeight() <= chainHeight)
.filter(tx -> "1701721206fe6b40777763de1c741f4fd2706d94775d".equals(Hex.encode(tx.getLastTxOutput().getOpReturnData())))
.filter(tx -> OP_RETURN_DATA_LEGACY_BM_FEES.contains(Hex.encode(tx.getLastTxOutput().getOpReturnData())))
.mapToLong(Tx::getBurntBsq)
.sum();
}
Expand Down
Loading