mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-29 09:48:46 -04:00
remove DAO
Co-authored-by: premek <1145361+premek@users.noreply.github.com>
This commit is contained in:
parent
f9f2cd07c3
commit
cefba8e4b5
621 changed files with 583 additions and 68805 deletions
|
@ -47,8 +47,7 @@ public class Capabilities {
|
|||
|
||||
// Defines which most recent capability any node need to support.
|
||||
// This helps to clean network from very old inactive but still running nodes.
|
||||
@SuppressWarnings("deprecation")
|
||||
private static final Capability MANDATORY_CAPABILITY = Capability.DAO_STATE;
|
||||
private static final Capability MANDATORY_CAPABILITY = Capability.TRADE_STATISTICS_3;
|
||||
|
||||
protected final Set<Capability> capabilities = new HashSet<>();
|
||||
|
||||
|
|
|
@ -28,11 +28,11 @@ public enum Capability {
|
|||
@Deprecated TRADE_STATISTICS_2, // Not required anymore as no old clients out there not having that support
|
||||
@Deprecated ACCOUNT_AGE_WITNESS, // Not required anymore as no old clients out there not having that support
|
||||
SEED_NODE, // Node is a seed node
|
||||
DAO_FULL_NODE, // DAO full node can deliver BSQ blocks
|
||||
@Deprecated DAO_FULL_NODE, // DAO full node can deliver BSQ blocks
|
||||
@Deprecated PROPOSAL, // Not required anymore as no old clients out there not having that support
|
||||
@Deprecated BLIND_VOTE, // Not required anymore as no old clients out there not having that support
|
||||
@Deprecated ACK_MSG, // Not required anymore as no old clients out there not having that support
|
||||
RECEIVE_BSQ_BLOCK, // Signaling that node which wants to receive BSQ blocks (DAO lite node)
|
||||
@Deprecated RECEIVE_BSQ_BLOCK, // Signaling that node which wants to receive BSQ blocks (DAO lite node)
|
||||
@Deprecated DAO_STATE, // Not required anymore as no old clients out there not having that support
|
||||
|
||||
@Deprecated BUNDLE_OF_ENVELOPES, // Supports bundling of messages if many messages are sent in short interval
|
||||
|
|
|
@ -34,7 +34,6 @@ public class DevEnv {
|
|||
|
||||
public static void setup(Config config) {
|
||||
DevEnv.setDevMode(config.useDevMode);
|
||||
DevEnv.setDaoActivated(config.daoActivated);
|
||||
}
|
||||
|
||||
// If set to true we ignore several UI behavior like confirmation popups as well dummy accounts are created and
|
||||
|
@ -49,23 +48,10 @@ public class DevEnv {
|
|||
DevEnv.devMode = devMode;
|
||||
}
|
||||
|
||||
private static boolean daoActivated = true;
|
||||
|
||||
public static boolean isDaoActivated() {
|
||||
return daoActivated;
|
||||
}
|
||||
|
||||
public static void setDaoActivated(boolean daoActivated) {
|
||||
DevEnv.daoActivated = daoActivated;
|
||||
}
|
||||
|
||||
public static void logErrorAndThrowIfDevMode(String msg) {
|
||||
log.error(msg);
|
||||
if (devMode)
|
||||
throw new RuntimeException(msg);
|
||||
}
|
||||
|
||||
public static boolean isDaoTradingActivated() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,8 +102,6 @@ public class Version {
|
|||
public static final int TRADE_PROTOCOL_VERSION = 3;
|
||||
private static int p2pMessageVersion;
|
||||
|
||||
public static final String BSQ_TX_VERSION = "1";
|
||||
|
||||
public static int getP2PMessageVersion() {
|
||||
return p2pMessageVersion;
|
||||
}
|
||||
|
|
|
@ -28,10 +28,7 @@ import lombok.Getter;
|
|||
public enum BaseCurrencyNetwork {
|
||||
XMR_MAINNET(new XmrMainNetParams(), "XMR", "MAINNET", "Monero"), // TODO (woodser): network params are part of bitcoinj and shouldn't be needed. only used to get MonetaryFormat? replace with MonetaryFormat if so
|
||||
XMR_TESTNET(new XmrTestNet3Params(), "XMR", "TESTNET", "Monero"),
|
||||
XMR_STAGENET(new XmrRegTestParams(), "XMR", "STAGENET", "Monero"),
|
||||
BTC_DAO_TESTNET(RegTestParams.get(), "XMR", "STAGENET", "Monero"),
|
||||
BTC_DAO_BETANET(MainNetParams.get(), "XMR", "MAINNET", "Monero"), // mainnet test genesis
|
||||
BTC_DAO_REGTEST(RegTestParams.get(), "XMR", "STAGENET", "Monero");
|
||||
XMR_STAGENET(new XmrRegTestParams(), "XMR", "STAGENET", "Monero");
|
||||
|
||||
@Getter
|
||||
private final NetworkParameters parameters;
|
||||
|
@ -57,18 +54,6 @@ public enum BaseCurrencyNetwork {
|
|||
return "XMR_TESTNET".equals(name());
|
||||
}
|
||||
|
||||
public boolean isDaoTestNet() {
|
||||
return "BTC_DAO_TESTNET".equals(name());
|
||||
}
|
||||
|
||||
public boolean isDaoRegTest() {
|
||||
return "BTC_DAO_REGTEST".equals(name());
|
||||
}
|
||||
|
||||
public boolean isDaoBetaNet() {
|
||||
return "BTC_DAO_BETANET".equals(name());
|
||||
}
|
||||
|
||||
public boolean isStagenet() {
|
||||
return "XMR_STAGENET".equals(name());
|
||||
}
|
||||
|
|
|
@ -103,18 +103,6 @@ public class Config {
|
|||
public static final String USE_ALL_PROVIDED_NODES = "useAllProvidedNodes";
|
||||
public static final String USER_AGENT = "userAgent";
|
||||
public static final String NUM_CONNECTIONS_FOR_BTC = "numConnectionsForBtc";
|
||||
public static final String RPC_USER = "rpcUser";
|
||||
public static final String RPC_PASSWORD = "rpcPassword";
|
||||
public static final String RPC_HOST = "rpcHost";
|
||||
public static final String RPC_PORT = "rpcPort";
|
||||
public static final String RPC_BLOCK_NOTIFICATION_PORT = "rpcBlockNotificationPort";
|
||||
public static final String RPC_BLOCK_NOTIFICATION_HOST = "rpcBlockNotificationHost";
|
||||
public static final String DUMP_BLOCKCHAIN_DATA = "dumpBlockchainData";
|
||||
public static final String FULL_DAO_NODE = "fullDaoNode";
|
||||
public static final String GENESIS_TX_ID = "genesisTxId";
|
||||
public static final String GENESIS_BLOCK_HEIGHT = "genesisBlockHeight";
|
||||
public static final String GENESIS_TOTAL_SUPPLY = "genesisTotalSupply";
|
||||
public static final String DAO_ACTIVATED = "daoActivated";
|
||||
public static final String DUMP_DELAYED_PAYOUT_TXS = "dumpDelayedPayoutTxs";
|
||||
public static final String ALLOW_FAULTY_DELAYED_TXS = "allowFaultyDelayedTxs";
|
||||
public static final String API_PASSWORD = "apiPassword";
|
||||
|
@ -130,7 +118,6 @@ public class Config {
|
|||
public static final int UNSPECIFIED_PORT = -1;
|
||||
public static final String DEFAULT_REGTEST_HOST = "localhost";
|
||||
public static final int DEFAULT_NUM_CONNECTIONS_FOR_BTC = 9; // down from BitcoinJ default of 12
|
||||
public static final boolean DEFAULT_FULL_DAO_NODE = false;
|
||||
static final String DEFAULT_CONFIG_FILE_NAME = "bisq.properties";
|
||||
|
||||
// Static fields that provide access to Config properties in locations where injecting
|
||||
|
@ -163,7 +150,6 @@ public class Config {
|
|||
public final NetworkParameters networkParameters;
|
||||
public final boolean ignoreLocalBtcNode;
|
||||
public final String bitcoinRegtestHost;
|
||||
public final boolean daoActivated;
|
||||
public final String referralId;
|
||||
public final boolean useDevMode;
|
||||
public final boolean useDevModeHeader;
|
||||
|
@ -195,18 +181,6 @@ public class Config {
|
|||
public final boolean useAllProvidedNodes;
|
||||
public final String userAgent;
|
||||
public final int numConnectionsForBtc;
|
||||
public final String rpcUser;
|
||||
public final String rpcPassword;
|
||||
public final String rpcHost;
|
||||
public final int rpcPort;
|
||||
public final int rpcBlockNotificationPort;
|
||||
public final String rpcBlockNotificationHost;
|
||||
public final boolean dumpBlockchainData;
|
||||
public final boolean fullDaoNode;
|
||||
public final boolean fullDaoNodeOptionSetExplicitly;
|
||||
public final String genesisTxId;
|
||||
public final int genesisBlockHeight;
|
||||
public final long genesisTotalSupply;
|
||||
public final boolean dumpDelayedPayoutTxs;
|
||||
public final boolean allowFaultyDelayedTxs;
|
||||
public final String apiPassword;
|
||||
|
@ -552,78 +526,6 @@ public class Config {
|
|||
.ofType(int.class)
|
||||
.defaultsTo(DEFAULT_NUM_CONNECTIONS_FOR_BTC);
|
||||
|
||||
ArgumentAcceptingOptionSpec<String> rpcUserOpt =
|
||||
parser.accepts(RPC_USER, "Bitcoind rpc username")
|
||||
.withRequiredArg()
|
||||
.defaultsTo("");
|
||||
|
||||
ArgumentAcceptingOptionSpec<String> rpcPasswordOpt =
|
||||
parser.accepts(RPC_PASSWORD, "Bitcoind rpc password")
|
||||
.withRequiredArg()
|
||||
.defaultsTo("");
|
||||
|
||||
ArgumentAcceptingOptionSpec<String> rpcHostOpt =
|
||||
parser.accepts(RPC_HOST, "Bitcoind rpc host")
|
||||
.withRequiredArg()
|
||||
.defaultsTo("");
|
||||
|
||||
ArgumentAcceptingOptionSpec<Integer> rpcPortOpt =
|
||||
parser.accepts(RPC_PORT, "Bitcoind rpc port")
|
||||
.withRequiredArg()
|
||||
.ofType(int.class)
|
||||
.defaultsTo(UNSPECIFIED_PORT);
|
||||
|
||||
ArgumentAcceptingOptionSpec<Integer> rpcBlockNotificationPortOpt =
|
||||
parser.accepts(RPC_BLOCK_NOTIFICATION_PORT, "Bitcoind rpc port for block notifications")
|
||||
.withRequiredArg()
|
||||
.ofType(int.class)
|
||||
.defaultsTo(UNSPECIFIED_PORT);
|
||||
|
||||
ArgumentAcceptingOptionSpec<String> rpcBlockNotificationHostOpt =
|
||||
parser.accepts(RPC_BLOCK_NOTIFICATION_HOST,
|
||||
"Bitcoind rpc accepted incoming host for block notifications")
|
||||
.withRequiredArg()
|
||||
.defaultsTo("");
|
||||
|
||||
ArgumentAcceptingOptionSpec<Boolean> dumpBlockchainDataOpt =
|
||||
parser.accepts(DUMP_BLOCKCHAIN_DATA, "If set to true the blockchain data " +
|
||||
"from RPC requests to Bitcoin Core are stored as json file in the data dir.")
|
||||
.withRequiredArg()
|
||||
.ofType(boolean.class)
|
||||
.defaultsTo(false);
|
||||
|
||||
ArgumentAcceptingOptionSpec<Boolean> fullDaoNodeOpt =
|
||||
parser.accepts(FULL_DAO_NODE, "If set to true the node requests the blockchain data via RPC requests " +
|
||||
"from Bitcoin Core and provide the validated BSQ txs to the network. It requires that the " +
|
||||
"other RPC properties are set as well.")
|
||||
.withRequiredArg()
|
||||
.ofType(Boolean.class)
|
||||
.defaultsTo(DEFAULT_FULL_DAO_NODE);
|
||||
|
||||
ArgumentAcceptingOptionSpec<String> genesisTxIdOpt =
|
||||
parser.accepts(GENESIS_TX_ID, "Genesis transaction ID when not using the hard coded one")
|
||||
.withRequiredArg()
|
||||
.defaultsTo("");
|
||||
|
||||
ArgumentAcceptingOptionSpec<Integer> genesisBlockHeightOpt =
|
||||
parser.accepts(GENESIS_BLOCK_HEIGHT,
|
||||
"Genesis transaction block height when not using the hard coded one")
|
||||
.withRequiredArg()
|
||||
.ofType(int.class)
|
||||
.defaultsTo(-1);
|
||||
|
||||
ArgumentAcceptingOptionSpec<Long> genesisTotalSupplyOpt =
|
||||
parser.accepts(GENESIS_TOTAL_SUPPLY, "Genesis total supply when not using the hard coded one")
|
||||
.withRequiredArg()
|
||||
.ofType(long.class)
|
||||
.defaultsTo(-1L);
|
||||
|
||||
ArgumentAcceptingOptionSpec<Boolean> daoActivatedOpt =
|
||||
parser.accepts(DAO_ACTIVATED, "Developer flag. If true it enables dao phase 2 features.")
|
||||
.withRequiredArg()
|
||||
.ofType(boolean.class)
|
||||
.defaultsTo(true);
|
||||
|
||||
ArgumentAcceptingOptionSpec<Boolean> dumpDelayedPayoutTxsOpt =
|
||||
parser.accepts(DUMP_DELAYED_PAYOUT_TXS, "Dump delayed payout transactions to file")
|
||||
.withRequiredArg()
|
||||
|
@ -767,19 +669,7 @@ public class Config {
|
|||
this.useAllProvidedNodes = options.valueOf(useAllProvidedNodesOpt);
|
||||
this.userAgent = options.valueOf(userAgentOpt);
|
||||
this.numConnectionsForBtc = options.valueOf(numConnectionsForBtcOpt);
|
||||
this.rpcUser = options.valueOf(rpcUserOpt);
|
||||
this.rpcPassword = options.valueOf(rpcPasswordOpt);
|
||||
this.rpcHost = options.valueOf(rpcHostOpt);
|
||||
this.rpcPort = options.valueOf(rpcPortOpt);
|
||||
this.rpcBlockNotificationPort = options.valueOf(rpcBlockNotificationPortOpt);
|
||||
this.rpcBlockNotificationHost = options.valueOf(rpcBlockNotificationHostOpt);
|
||||
this.dumpBlockchainData = options.valueOf(dumpBlockchainDataOpt);
|
||||
this.fullDaoNode = options.valueOf(fullDaoNodeOpt);
|
||||
this.fullDaoNodeOptionSetExplicitly = options.has(fullDaoNodeOpt);
|
||||
this.genesisTxId = options.valueOf(genesisTxIdOpt);
|
||||
this.genesisBlockHeight = options.valueOf(genesisBlockHeightOpt);
|
||||
this.genesisTotalSupply = options.valueOf(genesisTotalSupplyOpt);
|
||||
this.daoActivated = options.valueOf(daoActivatedOpt);
|
||||
|
||||
this.dumpDelayedPayoutTxs = options.valueOf(dumpDelayedPayoutTxsOpt);
|
||||
this.allowFaultyDelayedTxs = options.valueOf(allowFaultyDelayedTxsOpt);
|
||||
this.apiPassword = options.valueOf(apiPasswordOpt);
|
||||
|
|
|
@ -67,8 +67,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||
* with the modified model that data is written at shut down we eliminate frequent and expensive disk I/O. Risks of
|
||||
* deadlock or data inconsistency and a more complex model have been a further argument for that model. In fact
|
||||
* previously we wasted a lot of resources as way too many threads have been created without doing actual work as well
|
||||
* the write operations got triggered way too often specially for the very frequent changes at SequenceNumberMap and
|
||||
* the very large DaoState (at dao blockchain sync that slowed down sync).
|
||||
* the write operations got triggered way too often specially for the very frequent changes at SequenceNumberMap
|
||||
*
|
||||
*
|
||||
* @param <T> The type of the {@link PersistableEnvelope} to be written or read from disk
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue