Skip to content

Commit

Permalink
Merge pull request jl777#273 from VerusCoin/dev
Browse files Browse the repository at this point in the history
dev
  • Loading branch information
Asherda authored Jan 14, 2020
2 parents c117b68 + 3671df1 commit 68b2bea
Show file tree
Hide file tree
Showing 18 changed files with 1,064 additions and 84 deletions.
45 changes: 27 additions & 18 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ stages:
####START#### PROJECT LEVEL VARIABLES ####START####
########################################################################################################################
variables:
VERSION: 0.6.1
VERSION: 0.6.2
VERUS_CLI_ARM64_LINUX: Verus-CLI-Linux-v${VERSION}-arm64.tar.gz
VERUS_CLI_LINUX: Verus-CLI-Linux-v${VERSION}-amd64.tar.gz
VERUS_CLI_LINUX_AMD64: Verus-CLI-Linux-v${VERSION}-amd64.tar.gz
VERUS_CLI_WINDOWS: Verus-CLI-Windows-v${VERSION}.zip
VERUS_CLI_MACOS: Verus-CLI-MacOS-v${VERSION}.tar.gz
DOWNSTREAM_AGAMA_BRANCH: ${CI_COMMIT_REF_NAME}
Expand Down Expand Up @@ -53,19 +53,19 @@ build:linux:
- chmod +x verus-cli/verus
- chmod +x verus-cli/verusd
- chmod +x verus-cli/fetch-params
- tar -czvf ${VERUS_CLI_LINUX} verus-cli
- sha256sum ${VERUS_CLI_LINUX} > ${VERUS_CLI_LINUX}.sha256
- tar -czvf ${VERUS_CLI_LINUX_AMD64} verus-cli
- sha256sum ${VERUS_CLI_LINUX_AMD64} > ${VERUS_CLI_LINUX_AMD64}.sha256
- git status
after_script:
- curl -F file=@"${VERUS_CLI_LINUX}"
- curl -F file=@"${VERUS_CLI_LINUX_AMD64}"
-F channels="${CLI_POST_CHANNEL}"
-F initial_comment="${POST_MESSAGE}"
-H "${SLACK_BOT_AUTH}"
"https://slack.com/api/files.upload"
artifacts:
paths:
- ${VERUS_CLI_LINUX}
- ${VERUS_CLI_LINUX}.sha256
- ${VERUS_CLI_LINUX_AMD64}
- ${VERUS_CLI_LINUX_AMD64}.sha256
expire_in: 1 week

.build:linux:arm64:
Expand All @@ -75,8 +75,6 @@ build:linux:
HOST: aarch64-linux-gnu
STRIP: /usr/aarch64-linux-gnu/bin/strip
STATIC_LIBCURL: 1
CXX: g++-8-aarch64-linux-gnu
CC: gcc-8-aarch64-linux-gnu
stage: build
cache:
key: "${CI_JOB_NAME}${CI_COMMIT_REF_NAME}"
Expand Down Expand Up @@ -244,7 +242,7 @@ build:mac:
- rm -rf /root/.komodo || true
- mv .komodo /root/ || true
script:
- tar -xzvf ${VERUS_CLI_LINUX}
- tar -xzvf ${VERUS_CLI_LINUX_AMD64}
- export PATH=$PATH:$CI_PROJECT_DIR/verus-cli
- python qa/verus-cli-tests/verus-cli-tester.py
after_script:
Expand Down Expand Up @@ -273,7 +271,7 @@ build:mac:
- rm -rf /root/.komodo || true
- mv .komodo /root/ || true
script:
- tar -xzvf ${VERUS_CLI_LINUX}
- tar -xzvf ${VERUS_CLI_LINUX_AMD64}
- export PATH=$PATH:$CI_PROJECT_DIR/verus-cli
- python qa/verus-cli-tests/verus-cli-tester.py
after_script:
Expand Down Expand Up @@ -358,11 +356,11 @@ deploy:
- build:linux
- build:windows
- build:mac
# - build:linux:arm64
# - build:linux:arm64
script:
- mkdir Windows && mkdir Linux && mkdir MacOS &&
cp ${VERUS_CLI_WINDOWS} Windows &&
cp ${VERUS_CLI_LINUX} Linux &&
cp ${VERUS_CLI_LINUX_AMD64} ${VERUS_CLI_ARM64_LINUX} Linux &&
cp ${VERUS_CLI_MACOS} MacOS
- echo "$AUTH_KEY" > AUTH_KEY.json &&
gcloud auth activate-service-account
Expand All @@ -372,21 +370,32 @@ deploy:
-F token="$CI_JOB_TOKEN"
-F ref="$DOWNSTREAM_AGAMA_BRANCH"
-F variables\[UPSTREAM_TRIGGER\]="${CI_PROJECT_NAME}"
-F variables\[VERUS_VERSION\]="${VERSION}"
-F variables\[UPSTREAM_CLI_BRANCH\]="${CI_COMMIT_REF_NAME}"
-F variables\[VERUS_CLI_LINUX\]="${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}/Linux/${VERUS_CLI_LINUX}"
-F variables\[VERUS_CLI_LINUX_AMD64\]="${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}/Linux/${VERUS_CLI_LINUX_AMD64}"
-F variables\[VERUS_CLI_WINDOWS\]="${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}/Windows/${VERUS_CLI_WINDOWS}"
-F variables\[VERUS_CLI_MACOS\]="${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}/MacOS/${VERUS_CLI_MACOS}"
"https://gitlab.com/api/v4/projects/12539166/trigger/pipeline"
- curl -X POST
-F token="$CI_JOB_TOKEN"
-F ref="${CI_COMMIT_REF_NAME}"
-F variables\[UPSTREAM_TRIGGER\]="${CI_PROJECT_NAME} ; ${CI_COMMIT_SHA}"
-F variables\[VERUS_VERSION\]="${VERSION}"
-F variables\[UPSTREAM_CLI_BRANCH\]="${CI_COMMIT_REF_NAME}"
-F variables\[VERUS_CLI_LINUX_AMD64\]="${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}/Linux/${VERUS_CLI_LINUX_AMD64}"
-F variables\[VERUS_CLI_WINDOWS\]="${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}/Windows/${VERUS_CLI_WINDOWS}"
-F variables\[VERUS_CLI_MACOS\]="${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}/MacOS/${VERUS_CLI_MACOS}"
"https://gitlab.com/api/v4/projects/16158513/trigger/pipeline"
artifacts:
paths:
- ${VERUS_CLI_LINUX}
- ${VERUS_CLI_LINUX}.sha256
- ${VERUS_CLI_LINUX_AMD64}
- ${VERUS_CLI_LINUX_AMD64}.sha256
- ${VERUS_CLI_WINDOWS}
- ${VERUS_CLI_WINDOWS}.sha256
- ${VERUS_CLI_MACOS}
- ${VERUS_CLI_MACOS}.sha256
# - ${VERUS_CLI_ARM64_LINUX}
# - ${VERUS_CLI_ARM64_LINUX}.sha256
# - ${VERUS_CLI_ARM64_LINUX}
# - ${VERUS_CLI_ARM64_LINUX}.sha256
expire_in: 1 week
########################################################################################################################
####END#### Deploy ####END####
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## VerusCoin version 0.6.1
## VerusCoin version 0.6.2

Arguably the world's most advanced technology, zero knowledge privacy-centric blockchain, Verus Coin brings Sapling performance and zero knowledge features to an intelligent system with interchain smart contracts and a completely original, combined proof of stake/proof of work consensus algorithm that solves the nothing at stake problem. With this and its approach towards CPU mining and ASICs, Verus Coin strives to be one of the most naturally decentralizing and attack resistant blockchains in existence.

Expand Down Expand Up @@ -75,7 +75,7 @@ sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoco
ARMv8 cross-compile
```shell
#The following packages are needed:
sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf g++-aarch64-linux-gnu binutils-aarch64-linux-gnu libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget bsdmainutils automake curl
sudo apt-get install build-essential pkg-config linux-libc-dev-arm64-cross m4 g++-multilib autoconf g++-aarch64-linux-gnu binutils-aarch64-linux-gnu libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget bsdmainutils automake curl
```
Windows cross-compile
```shell
Expand Down
2 changes: 1 addition & 1 deletion doc/man/verus-cli/linux/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VerusCoin Command Line Tools v0.6.1
VerusCoin Command Line Tools v0.6.2

Contents:
verusd - VerusCoin daemon
Expand Down
2 changes: 1 addition & 1 deletion doc/man/verus-cli/mac/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VerusCoin Command Line Tools v0.6.1
VerusCoin Command Line Tools v0.6.2
Contents:
verusd - VerusCoin daemon.
verus - VerusCoin command line utility.
Expand Down
2 changes: 1 addition & 1 deletion doc/man/verus-cli/windows/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VerusCoin Command Line Tools v0.6.1
VerusCoin Command Line Tools v0.6.2
Contents:
verusd.exe - VerusCoin daemon
verus.exe - VerusCoin command line utility
Expand Down
6 changes: 5 additions & 1 deletion src/cryptoconditions/src/include/ed25519/src/seed.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ int ed25519_create_seed(unsigned char *seed) {
return 1;
}

fread(seed, 1, 32, f);
size_t fread_size = fread(seed, 1, 32, f);

fclose(f);
if (fread_size == 0) {
return 1;
}
#endif

return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/deprecation.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Deprecation policy:
// * Shut down 20 weeks' worth of blocks after the estimated release block height.
// * A warning is shown during the 2 weeks' worth of blocks prior to shut down.
static const int APPROX_RELEASE_HEIGHT = 825800;
static const int APPROX_RELEASE_HEIGHT = 842200;
static const int WEEKS_UNTIL_DEPRECATION = 20;
static const int DEPRECATION_HEIGHT = APPROX_RELEASE_HEIGHT + (WEEKS_UNTIL_DEPRECATION * 7 * 60 * 24);

Expand Down
47 changes: 47 additions & 0 deletions src/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ class CHashWriter
return result;
}

CHashWriter &Reset()
{
ctx.Reset();
return *this;
}

template<typename T>
CHashWriter& operator<<(const T& obj) {
// Serialize to this stream
Expand All @@ -164,6 +170,47 @@ class CHashWriter
};


/** A writer stream (for serialization) that computes a 256-bit hash. */
class CHashWriterSHA256
{
private:
CSHA256 ctx;

const int nType;
const int nVersion;
public:

CHashWriterSHA256(int nTypeIn, int nVersionIn) : nType(nTypeIn), nVersion(nVersionIn) {}

int GetType() const { return nType; }
int GetVersion() const { return nVersion; }

void write(const char *pch, size_t size) {
ctx.Write((const unsigned char*)pch, size);
}

// invalidates the object
uint256 GetHash() {
uint256 result;
ctx.Finalize((unsigned char*)&result);
return result;
}

CHashWriterSHA256 &Reset()
{
ctx.Reset();
return *this;
}

template<typename T>
CHashWriterSHA256& operator<<(const T& obj) {
// Serialize to this stream
::Serialize(*this, obj);
return (*this);
}
};


/** A writer stream (for serialization) that computes a 256-bit BLAKE2b hash. */
class CBLAKE2bWriter
{
Expand Down
1 change: 0 additions & 1 deletion src/key_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,4 +772,3 @@ CScript CIdentity::IdentityUpdateOutputScript() const
return ret;
}


2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static void CheckBlockIndex(const Consensus::Params& consensusParams);
/** Constant stuff for coinbase transactions we create: */
CScript COINBASE_FLAGS;

const string strMessageMagic = "Komodo Signed Message:\n";
const string verusDataSignaturePrefix = "Verus signed data:\n";

// Internal stuff
namespace {
Expand Down
3 changes: 2 additions & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ typedef boost::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap;
extern BlockMap mapBlockIndex;
extern uint64_t nLastBlockTx;
extern uint64_t nLastBlockSize;
extern const std::string strMessageMagic;
extern const std::string verusDataSignaturePrefix;
extern const std::string verusDataSignaturePrefix;
extern CWaitableCriticalSection csBestBlock;
extern CConditionVariable cvBlockChange;
extern bool fExperimentalMode;
Expand Down
75 changes: 73 additions & 2 deletions src/pbaas/identity.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class CNameReservation

CNameReservation(const CTransaction &tx, int *pNumOut=nullptr);

CNameReservation(std::vector<unsigned char> asVector)
CNameReservation(std::vector<unsigned char> &asVector)
{
::FromVector(asVector, *this);
if (name.size() > MAX_NAME_SIZE)
Expand Down Expand Up @@ -160,7 +160,7 @@ class CPrincipal
{}

CPrincipal(const UniValue &uni);
CPrincipal(std::vector<unsigned char> asVector)
CPrincipal(std::vector<unsigned char> &asVector)
{
::FromVector(asVector, *this);
}
Expand Down Expand Up @@ -592,6 +592,77 @@ class CIdentityMapValue : public CIdentity
}
};

// an identity signature is a compound signature consisting of the block height of its creation, and one or more cryptographic
// signatures of the controlling addresses. validation can be performed based on the validity when signed, using the block height
// stored in the signature instance, or based on the continued signature validity of the current identity, which may automatically
// invalidate when the identity is updated.
class CIdentitySignature
{
public:
enum {
VERSION_INVALID = 0,
VERSION_CURRENT = 1,
VERSION_FIRST = 1,
VERSION_LAST = 1
};
uint8_t version;
uint32_t blockHeight;
std::set<std::vector<unsigned char>> signatures;

CIdentitySignature() : version(VERSION_CURRENT), blockHeight(0) {}
CIdentitySignature(uint32_t height, const std::vector<unsigned char> &oneSig) : version(VERSION_CURRENT), blockHeight(0), signatures({oneSig}) {}
CIdentitySignature(uint32_t height, const std::set<std::vector<unsigned char>> &sigs) : version(VERSION_CURRENT), blockHeight(0), signatures(sigs) {}
CIdentitySignature(const std::vector<unsigned char> &asVector)
{
::FromVector(asVector, *this);
}

template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action) {
READWRITE(version);
if (version <= VERSION_LAST && version >= VERSION_FIRST)
{
READWRITE(blockHeight);
std::vector<std::vector<unsigned char>> sigs;
if (ser_action.ForRead())
{
READWRITE(sigs);

for (auto &oneSig : sigs)
{
signatures.insert(oneSig);
}
}
else
{
for (auto &oneSig : signatures)
{
sigs.push_back(oneSig);
}

READWRITE(sigs);
}
}
}

ADD_SERIALIZE_METHODS;

void AddSignature(const std::vector<unsigned char> &signature)
{
signatures.insert(signature);
}

uint32_t Version()
{
return version;
}

uint32_t IsValid()
{
return version <= VERSION_LAST && version >= VERSION_FIRST;
}
};

struct CCcontract_info;
struct Eval;
class CValidationState;
Expand Down
Loading

0 comments on commit 68b2bea

Please sign in to comment.