mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
Merge pull request #3222 from chimp1984/remove-old-dao-required-capabilites
Remove old dao required capabilites
This commit is contained in:
commit
622cf8b782
6 changed files with 32 additions and 59 deletions
|
@ -26,13 +26,16 @@ public enum Capability {
|
|||
@Deprecated TRADE_STATISTICS, // Not required anymore as no old clients out there not having that support
|
||||
@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,
|
||||
DAO_FULL_NODE,
|
||||
PROPOSAL,
|
||||
BLIND_VOTE,
|
||||
SEED_NODE, // Node is a seed node
|
||||
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,
|
||||
DAO_STATE,
|
||||
BUNDLE_OF_ENVELOPES,
|
||||
SIGNED_ACCOUNT_AGE_WITNESS
|
||||
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
|
||||
|
||||
//TODO can be set deprecated after v1.1.6 as we enforce update there
|
||||
BUNDLE_OF_ENVELOPES, // Supports bundling of messages if many messages are sent in short interval
|
||||
|
||||
SIGNED_ACCOUNT_AGE_WITNESS // Supports the signed account age witness feature
|
||||
}
|
||||
|
|
|
@ -20,11 +20,8 @@ package bisq.core.dao.governance.blindvote.storage;
|
|||
import bisq.core.dao.governance.ConsensusCritical;
|
||||
import bisq.core.dao.governance.blindvote.BlindVote;
|
||||
|
||||
import bisq.network.p2p.storage.payload.CapabilityRequiringPayload;
|
||||
import bisq.network.p2p.storage.payload.PersistableNetworkPayload;
|
||||
|
||||
import bisq.common.app.Capabilities;
|
||||
import bisq.common.app.Capability;
|
||||
import bisq.common.crypto.Hash;
|
||||
import bisq.common.proto.persistable.PersistableEnvelope;
|
||||
import bisq.common.util.Utilities;
|
||||
|
@ -46,8 +43,7 @@ import javax.annotation.concurrent.Immutable;
|
|||
@Slf4j
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
public final class BlindVotePayload implements PersistableNetworkPayload, PersistableEnvelope,
|
||||
CapabilityRequiringPayload, ConsensusCritical {
|
||||
public final class BlindVotePayload implements PersistableNetworkPayload, PersistableEnvelope, ConsensusCritical {
|
||||
|
||||
private final BlindVote blindVote;
|
||||
protected final byte[] hash; // 20 byte
|
||||
|
@ -101,16 +97,6 @@ public final class BlindVotePayload implements PersistableNetworkPayload, Persis
|
|||
return hash;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// CapabilityRequiringPayload
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public Capabilities getRequiredCapabilities() {
|
||||
return new Capabilities(Capability.BLIND_VOTE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BlindVotePayload{" +
|
||||
|
|
|
@ -20,11 +20,8 @@ package bisq.core.dao.governance.proposal.storage.appendonly;
|
|||
import bisq.core.dao.governance.ConsensusCritical;
|
||||
import bisq.core.dao.state.model.governance.Proposal;
|
||||
|
||||
import bisq.network.p2p.storage.payload.CapabilityRequiringPayload;
|
||||
import bisq.network.p2p.storage.payload.PersistableNetworkPayload;
|
||||
|
||||
import bisq.common.app.Capabilities;
|
||||
import bisq.common.app.Capability;
|
||||
import bisq.common.crypto.Hash;
|
||||
import bisq.common.proto.persistable.PersistableEnvelope;
|
||||
import bisq.common.util.Utilities;
|
||||
|
@ -43,8 +40,7 @@ import javax.annotation.concurrent.Immutable;
|
|||
@Immutable
|
||||
@Slf4j
|
||||
@Value
|
||||
public class ProposalPayload implements PersistableNetworkPayload, PersistableEnvelope,
|
||||
CapabilityRequiringPayload, ConsensusCritical {
|
||||
public class ProposalPayload implements PersistableNetworkPayload, PersistableEnvelope, ConsensusCritical {
|
||||
private final Proposal proposal;
|
||||
protected final byte[] hash; // 20 byte
|
||||
|
||||
|
@ -100,16 +96,6 @@ public class ProposalPayload implements PersistableNetworkPayload, PersistableEn
|
|||
return hash;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// CapabilityRequiringPayload
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public Capabilities getRequiredCapabilities() {
|
||||
return new Capabilities(Capability.PROPOSAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ProposalPayload{" +
|
||||
|
|
|
@ -19,13 +19,10 @@ package bisq.core.dao.governance.proposal.storage.temp;
|
|||
|
||||
import bisq.core.dao.state.model.governance.Proposal;
|
||||
|
||||
import bisq.network.p2p.storage.payload.CapabilityRequiringPayload;
|
||||
import bisq.network.p2p.storage.payload.ExpirablePayload;
|
||||
import bisq.network.p2p.storage.payload.LazyProcessedPayload;
|
||||
import bisq.network.p2p.storage.payload.ProtectedStoragePayload;
|
||||
|
||||
import bisq.common.app.Capabilities;
|
||||
import bisq.common.app.Capability;
|
||||
import bisq.common.crypto.Sig;
|
||||
import bisq.common.proto.persistable.PersistablePayload;
|
||||
import bisq.common.util.ExtraDataMapValidator;
|
||||
|
@ -59,7 +56,7 @@ import javax.annotation.concurrent.Immutable;
|
|||
@EqualsAndHashCode
|
||||
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
|
||||
public class TempProposalPayload implements LazyProcessedPayload, ProtectedStoragePayload,
|
||||
ExpirablePayload, CapabilityRequiringPayload, PersistablePayload {
|
||||
ExpirablePayload, PersistablePayload {
|
||||
|
||||
protected final Proposal proposal;
|
||||
protected final byte[] ownerPubKeyEncoded;
|
||||
|
@ -122,16 +119,6 @@ public class TempProposalPayload implements LazyProcessedPayload, ProtectedStora
|
|||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// CapabilityRequiringPayload
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public Capabilities getRequiredCapabilities() {
|
||||
return new Capabilities(Capability.PROPOSAL);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// ExpirablePayload
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -33,16 +33,13 @@ public class CoreNetworkCapabilities {
|
|||
Capability.TRADE_STATISTICS_2,
|
||||
Capability.ACCOUNT_AGE_WITNESS,
|
||||
Capability.ACK_MSG,
|
||||
Capability.PROPOSAL,
|
||||
Capability.BLIND_VOTE,
|
||||
Capability.DAO_STATE,
|
||||
Capability.BUNDLE_OF_ENVELOPES
|
||||
);
|
||||
|
||||
if (BisqEnvironment.isDaoActivated(bisqEnvironment)) {
|
||||
Capabilities.app.addAll(
|
||||
Capability.PROPOSAL,
|
||||
Capability.BLIND_VOTE,
|
||||
Capability.DAO_STATE
|
||||
);
|
||||
|
||||
maybeApplyDaoFullMode(bisqEnvironment);
|
||||
}
|
||||
}
|
||||
|
@ -58,6 +55,7 @@ public class CoreNetworkCapabilities {
|
|||
} else {
|
||||
// A lite node has the capability to receive bsq blocks. We do not want to send BSQ blocks to full nodes
|
||||
// as they ignore them anyway.
|
||||
log.info("Set Capability.RECEIVE_BSQ_BLOCK");
|
||||
Capabilities.app.addAll(Capability.RECEIVE_BSQ_BLOCK);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,10 @@
|
|||
|
||||
package bisq.network.p2p;
|
||||
|
||||
import bisq.network.p2p.storage.payload.CapabilityRequiringPayload;
|
||||
|
||||
import bisq.common.app.Capabilities;
|
||||
import bisq.common.app.Capability;
|
||||
import bisq.common.app.Version;
|
||||
import bisq.common.proto.ProtobufferException;
|
||||
import bisq.common.proto.network.NetworkEnvelope;
|
||||
|
@ -32,7 +36,7 @@ import lombok.Value;
|
|||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Value
|
||||
public final class BundleOfEnvelopes extends NetworkEnvelope implements ExtendedDataSizePermission {
|
||||
public final class BundleOfEnvelopes extends NetworkEnvelope implements ExtendedDataSizePermission, CapabilityRequiringPayload {
|
||||
|
||||
private final List<NetworkEnvelope> envelopes;
|
||||
|
||||
|
@ -78,4 +82,13 @@ public final class BundleOfEnvelopes extends NetworkEnvelope implements Extended
|
|||
|
||||
return new BundleOfEnvelopes(envelopes, messageVersion);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// CapabilityRequiringPayload
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public Capabilities getRequiredCapabilities() {
|
||||
return new Capabilities(Capability.BUNDLE_OF_ENVELOPES);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue