Commit Graph

477 Commits

Author SHA1 Message Date
catbref
774a8f20ee Fixed API call GET /blocks/minter/{address}. Now returns block summaries instead of full block data. 2020-02-06 14:28:02 +00:00
catbref
1cb2935cad Improved run.sh, additional stop.sh and bumped genesis block timestamp in blockchain.json 2020-02-04 12:56:07 +00:00
catbref
07d4d6f11d Fix genesis block change detection 2020-02-04 12:55:35 +00:00
catbref
e55e811fcc Added example shell script to run Qortal and updated README.md 2020-02-04 12:27:08 +00:00
catbref
3ef4711c27 Log noise: don't log zero NTP offsets or unimplemented transaction types 2020-02-04 12:16:34 +00:00
catbref
e0e9673837 Massive refactor to change 'qora' references to 'qortal'.
Blockchain configs will need "v2Timestamp" feature trigger renaming to "qortalTimestamp"!

Due to Controller.VERSION_PREFIX changing, peer-to-peer protocol version detection has
been changed. Was previous a substring match, now we test peers's buildTimestamp is at
least Peer.V2_PROTOCOL_TIMESTAMP_THRESHOLD. Changes in Peer.java.

Also added comment and throw() to QortalATAPI.getNextTransactionTimestamp()
as this needs given the change to Qortal's block timestamps from legacy Qora.

Changes to HSQLDB data types, e.g. QoraAddress to QortalAddress, means existing
database will need to be thrown away after this commit!
2020-02-04 12:11:37 +00:00
catbref
87dffb183e Changes needed to build Windows installer 2020-02-03 10:19:41 +00:00
catbref
dce919f58c Updated pre-launch blockchain config + fixes
Fixed build timestamp parsing in Controller post reproducible build.
Fixed REGISTER_NAME support in genesis block.
2020-01-24 11:35:30 +00:00
catbref
996e1c3a20 Fix node-management-ui placeholder wrt. reproducible builds 2020-01-23 12:40:20 +00:00
catbref
2af370d55d pom.xml modifications for reproducible builds
Seems to produce fat JARs with the same MD5 after repeated runs of:
mvn clean package

Needs testing on other platforms, hence this commit.

Also trimmed some unneeded included JAR libraries from pom.xml,
e.g. netty, async-http-client,
and the *.js.map files from Swagger-UI, which seems to reduce
output JAR size from about 51MB to about 44MB.
2020-01-23 11:59:34 +00:00
catbref
d2d2956c8a Updated build instructions in README.md and moved database info to DATABASE.md 2020-01-22 10:54:21 +00:00
catbref
5dec4fd8a1 Improve TRANSFER_PRIVS tests to cover more aspects 2020-01-21 13:37:22 +00:00
catbref
1f7827b51f Interim work on TRANSFER_PRIVS transaction
Converted AccountData's initialLevel to blocksMintedAdjustment.

Corresponding changes to AccountLevelTransaction so that level
set in genesis block is converted to blocksMintedAdjustment,
via cumulativeBlocksByLevel.

Ditto changes to HSQLDBAccountRepository, HSQLDBDatabaseUpdates,
[HSQLDB]TransactionRepository, etc.

Changes to API call POST /admin/mintingaccounts to check passed
reward-share private key maps to a reward-share with minting
account that still has privilege to mint. It's possible for
a TRANSFER_PRIVS transaction to transfer away minting privileges
from a minting account referenced by in a reward-share.

Change to RewardShareTransaction to allow users to cancel a
reward-share even if minting-account component no longer has
minting privs. This should allow users to clean up more after
a privs transfer.

Re-order processing/orphaning in Block.process()/Block.orphan()
to be more consistent and also to take in account changes that
might have been caused by TRANSFER_PRIVS transactions which affect
who might actually receive block rewards/tx fees.

Founders now gain blocksMinted & levels as part of minting blocks.
(Needed to make TRANSFER_PRIVS from a founder account to work).

BlockMinter now has added checks to make sure that the reward-shares
it might use to mint blocks still have valid minting-accounts.
i.e. that the minting-account component of reward-share hasn't had
minting privs transferred away by TRANSFER_PRIVS tx.

Controller now rejects online-accounts from peers that no longer
have minting privs (e.g. transferred away by TRANSFER_PRIVS)
Corresponding, Controller no longer SENDS online-accounts that no
longer have minting privs to other peers.

Added some tests - more tests needed, e.g. for multiple transfers
into the same account, or a test for minting post transfer for both
sender & recipient.
2020-01-21 13:37:22 +00:00
catbref
5cd35e07d0 Fix off-by-one error when reducing account level during block orphaning.
Added test to cover above.

Modified test-chain-v2.json so Dilbert starts with level 5, not 8,
to reduce number of blocks minted during tests.
2020-01-21 13:34:46 +00:00
catbref
c3a6e0d9fd Some transaction "layout" documentation only changes, including missing entry for "recipient" in TRANSFER_ASSET transactions 2020-01-13 15:47:11 +00:00
catbref
3e3c0affb0 Change auto-update to required approved tx created by non-admin.
Previously it was possible broadcast an auto-update tx that was
created by a 'dev' group admin.

Now the auto-update tx must be created by a 'dev' group non-admin/owner
and hence require group approval before it takes effect.

To this end, a new TransactionRepository.getLatestAutoUpdateTransaction()
method has been added to simplify finding the latest matching, approved
auto-update transaction.

Corresponding changes also made to AutoUpdate.run()
2020-01-07 14:26:54 +00:00
catbref
a5c889c312 Alter repository so GroupInvites.expiry can be NULL 2020-01-07 14:23:45 +00:00
catbref
7a7ca4b684 Fix rounding issue when checking whether tx meets approval threshold 2020-01-07 14:23:09 +00:00
catbref
8ba11efbd4 Fix GenesisBlock.isGenesisBlock() to prevent chain rebuild on restart 2020-01-07 14:22:07 +00:00
catbref
6c7318678c Bumped pre-launch genesis timestamp 2019-12-23 15:48:32 +00:00
catbref
8aa084a0d8 Updated pre-launch blockchain config. Smaller splash graphic. 2019-12-23 15:09:45 +00:00
catbref
09ffd6fe6b Blockchain replacement for launch.
These changes are for allowing devices to be shipped with an interim blockchain config & genesis block, running with "main-net" settings, prior to launch.
At launch, an "auto-update" will be broadcast to replace blockchain config & genesis block with the final, launch version.
When updated nodes restart (immediately after auto-update) they should notice their existing genesis blocks are invalid and hence wipe their blockchains,
effectively starting the final, launch blockchain.

To this end, genesis block signatures have been changed to better incorporate values that are likely to change at launch, e.g. block timestamp and transaction data.

Added Crypto.dupDigest(), which is effectively Bytes.concat(digest(msg), digest(msg)).

No need for HSQLDB repository to backup, or wipe, non-existent files for "in-memory" databases!

New interim blockchain config/genesis block.

**NOTE** These changes are being committed but require testing. However the auto-update suite requires a pushed commit in order to build an update file!
2019-12-17 16:19:35 +00:00
catbref
42bd68230b Cancel reward-shares with NEGATIVE share instead of ZERO. Also: bug-fixes!
Now reward-shares with zero percent are valid, to allow the 'recipient' party to gain
"number of minted blocks" but no actual block reward.

Correspondly, the special zero share used to cancel reward-shares has been changed to
be any negative value.

Block rewards, founder 'leftovers': if founder is minter account in any online
reward shares, then the per-founder-share is spread across their online reward-shares,
otherwise it's simply/wholy given to that founder.

Created a new DB table to hold "next block height", updated via triggers on Blocks.
This is so various sub-queries can simply read the next-block-height value instead
of complex IFNULL(MAX(height),0)+1 or SELECT height FROM Blocks ORDER BY height DESC.
Prior code was also broken in edge cases, e.g. no genesis block, or ran slow.

Added tests to cover above.

Deleted BTC tests as they're obsolete.

Added/improved other tests.
2019-12-11 13:40:42 +00:00
catbref
d01504a541 More reliable start-up by removing some race conditions in Controller and Network 2019-11-28 15:28:32 +00:00
catbref
e9c94eb83b Fix args not being propagated by AutoUpdate to ApplyUpdate. Also propagate ALL command-line args, not just args[0] 2019-11-28 14:30:42 +00:00
catbref
62ed4e322b Propagate JVM arguments through auto-update. Improve start-up error messages shown by GUI 2019-11-28 11:57:26 +00:00
catbref
339e757d34 Add callstack when logging slow repository queries. Blockchain.validate() improvement 2019-11-26 11:31:44 +00:00
catbref
939ce0d652 Correct auto-update URLs to use "qortal.update" not "qortal.jar" 2019-11-26 10:26:16 +00:00
catbref
20813863bc Updated .gitignore 2019-11-26 10:20:06 +00:00
catbref
04839d1fba Move XorUpdate back to org.qora package for mainstream use 2019-11-26 09:02:35 +00:00
catbref
d9bafaa42c Improve speed of HistoricAccountBalances triggers 2019-11-26 08:58:52 +00:00
catbref
9b894616ee Try for blockchain lock before tying up repository in BlockChain.trimOldOnlineAccountsSignatures 2019-11-26 08:58:19 +00:00
catbref
790f569dbd Fix case-typo in log4j2.properties 2019-11-26 08:57:04 +00:00
catbref
3990ded802 Add blockchain lock around trimming old online account signatures to prevent deadlocks. 2019-11-25 10:06:21 +00:00
catbref
69bb152163 Suppress Jersey EOF exception errors - actually remote peers disconnecting early 2019-11-25 09:58:55 +00:00
catbref
2e47019021 Rename some "qora" references to "qortal"
Examples:
qora.org to qortal.org
qora-core.jar to qortal.jar
qora-core.exe to qortal.exe
etc.
2019-11-21 09:38:41 +00:00
catbref
238487ea98 Add settings toggle "apiDocumentationEnabled" which is false by default.
API documentation support seems to take a lot of extra memory,
so this is disabled by default for router-based nodes.
2019-11-14 11:33:08 +00:00
catbref
06794ab36c Relax minimum peer conditions for synchronization 2019-11-12 16:25:55 +00:00
catbref
cb7df0c5c1 Fix noisy Block logging entry 2019-11-12 16:04:40 +00:00
catbref
e1fbd3178a Add JAXB annotation to PeerAddress so API GET /peers/self works 2019-11-12 15:26:12 +00:00
catbref
7b24ac6e00 Bump version to 1.0. Bump BC to 1.64, Jetty to 9.4.22 2019-11-12 15:05:39 +00:00
catbref
ab8e05cb0f Update blockchain.json to nearer launch version 2019-11-12 15:04:41 +00:00
catbref
47d0274a5e Move non-production apps from main to test
+ Move test apps from org.qora.test to org.qora.test.apps

("app" being a class with a main() method)
2019-11-12 15:03:20 +00:00
catbref
47dcff0beb Include error message if Network can't create listen socket 2019-11-12 14:58:09 +00:00
catbref
8906ce9b26 Change BlockMinter to pick BEST block if minting with several accounts
+ Removed obsolete BlockMinter.deleteInvalidTransactions()
2019-11-12 14:56:45 +00:00
catbref
482947dbf4 Share leftover block reward to founders, regardless whether online
Added support in AccountRepository to fetch account using flags.

+ renamed some local variables in some Block methods to avoid clashes
2019-11-12 14:55:46 +00:00
catbref
49ac7921a1 Fix new account level not taking effect in block rewards
Added encoded online accounts list decoder.
2019-11-11 17:55:58 +00:00
catbref
30df320e7f Redoing account balances with block height.
*** WARNING ***
Possible block reward bug in this commit. Further investigation needed.

Reverted AccountBalances back to height-less form.
Added HistoricAccountBalances table that is populated via trigger on AccountBalances.
This saves work when performing common requests for latest/confirmed balances,
shunting the extra work to when requesting height-related account balances.

Unified API call GET /addresses/balance/{address} by having address/assetId/height as
query params.

Simpler call for fetching legacy QORA holders during block rewarding.

Improved SQL for fetching asset balances, in all conditions,
e.g. with/without filtering addresses, with/without filtering assetIds,
etc.

Unit test for above to make sure query execution is fast enough.
(At one point, some SQL query was taking 6 seconds!)

Added optional 'height' Integer to AccountBalanceData, but this
is not populated/used very often.

HSQLDBAccountRepository.save(AccountBalanceData) now checks zero balance saves
to see if the row can be deleted instead. This fixes a lot of unhappy tests
that complain that there are residual account balance rows left after
post-test orphaning back to genesis block.

Yet more tests.
Removed very old 'TransactionTests' which are mostly covered in more specific tests elsewhere.
Added cancel-sell-name test from above.

Fixed AssetsApiTests to check for QORT not QORA!

Changed hard-coded assetIDs in test.common.AssetUtils in light of new LEGACY_QORA & QORT_FROM_QORA genesis assets.

Some test blockchain config changes.
2019-11-08 17:30:09 +00:00
catbref
31cbc1f15b Account assets balances now height-dependant. QORT-from-QORA block reward fixes. 2019-11-07 15:53:37 +00:00
catbref
f5918bd9bf Added range-check on online account timestamps 2019-11-06 10:11:10 +00:00