Commit Graph

682 Commits

Author SHA1 Message Date
catbref
50b912e229 Improved tools/publish-auto-update.pl 2020-06-03 11:49:49 +01:00
catbref
bef1828404 Add support for multiple P2SH funding transactions rather than requiring only one 2020-05-29 19:10:20 +01:00
catbref
0ae232b8ba Fix return result from ElectrumX.broadcastTransaction 2020-05-29 19:09:45 +01:00
catbref
cdf0795881 Add extra test case to MemoryPoW 2020-05-28 14:15:42 +01:00
catbref
31e85226f4 WASM version of MemoryPoW! 2020-05-28 14:09:53 +01:00
catbref
8df3c68df9 Update auto-update tools to work with testnet and on non-master branch (e.g. a testnet branch) 2020-05-27 11:49:59 +01:00
catbref
ca0deb2bf6 Allow tools/build-auto-update.sh to work on non-master branch (with warning) 2020-05-27 11:08:56 +01:00
catbref
6eea7c2aa1 Disallow registering/updating to a name that looks like an address 2020-05-27 10:56:03 +01:00
catbref
9aabf93523 Merge branch 'PUBLICIZE-txn' into launch 2020-05-27 10:46:27 +01:00
catbref
322e2cdc41 API call /crosschain/p2sh/redeem returns BTC_BALANCE_ISSUE in preference to INVALID_ADDRESS when P2SH balance is too low/zero 2020-05-27 10:44:37 +01:00
catbref
df395c77db Fix up BTCACCT.findP2shSecret given reduced data available since switch to ElectrumX 2020-05-27 10:43:14 +01:00
catbref
274002c473 Fix BTC.getMedianBlockTime() and update tests 2020-05-27 09:29:11 +01:00
catbref
3d4fc38fcb Replaced bitcoinj networking with ElectrumX.
No more bitcoinj peer-group stalls, or slow startups,
or downloading tons of block headers, or checkpoint files.

Now we use ElectrumX protocol to query info from random servers.

Also:
BTC.hash160 callers now use Crypto.hash160 instead.
Added BitTwiddling.fromLEBytes() returns int.

Unit tests seem OK, but needs complete testnet ACCT walkthrough.
2020-05-26 17:47:37 +01:00
catbref
d50f16b8a9 PUBLICIZE transaction for on-chain record of public key 2020-05-25 15:20:21 +01:00
catbref
59de22883b Use CHAT, not MESSAGE, MAX_DATA_SIZE in ChatTransactionTransformer 2020-05-25 08:30:06 +01:00
catbref
db73afaf88 Remove Block.orphan() forced repository debugging 2020-05-25 07:27:42 +01:00
catbref
3afbd7aa51 Recheck for duplicate connection after handshaking to cover race condition with simultaneous bi-directional connections 2020-05-25 07:24:19 +01:00
catbref
0c32afa07f New network handshaking. NOT backwards compatible!
Old Qora v1 message types removed.
Message type values changed.

Network handshaking reworked to fix multiple-connections issue.
Instead of using some random peerID, we now use proper keypairs and a challenge-response handshake to prevent doppelgangers/ID-theft.
This results in simpler handshaking code as we don't have to perform some arcane doppelganger resolution.

Handshaking still uses proof-of-work for challenge-response, but switched to newer MemoryPoW.

API call GET /peers no longer has 'buildTimestamp' field, but does now have 'nodeId' field.

Network no longer has a whole raft of getXXXpeers() due to simplified handshaking.
Quite a few method calls changed to simply Network.getHandshakedPeers(), which is also faster.
2020-05-22 17:16:45 +01:00
catbref
bd543a526b Update uses of old Public/PrivateKeyAccount static methods to Crypto 2020-05-22 17:13:55 +01:00
catbref
b262044a52 Move some crypto methods from Public/PrivateKeyAccount to Crypto for reuse by new network handshaking 2020-05-22 17:06:48 +01:00
catbref
200a97184c Include transaction reference in chat messages returned by API call GET /chat/messages 2020-05-22 08:00:43 +01:00
catbref
0164bca2d7 Exclude io.druid.java-util from build, removing tons of libsigar 2020-05-21 17:05:17 +01:00
catbref
5f4b66e5b0 Save public keys from CHAT transactions so they can be fetched via API. 2020-05-20 15:53:43 +01:00
catbref
9c48343581 Potential fix for rare HSQLDB "serialization failure" in Transaction.importAsUnconfirmed() 2020-05-20 07:33:21 +01:00
catbref
219f82f562 Modify API call GET /chats/active/{address} to return info on all joined groups.
Previously GET /chats/active/{address} would only return an active group chat
entry where 'address' was a member AND there was an existing CHAT
transaction with the same tx_group_id (and no recipient).

Now the response contains entries for ALL groups where 'address' is a member,
regardless of an existing CHAT transactions, omitting the 'timestamp' entry
if there are none.
2020-05-19 17:12:41 +01:00
catbref
51bfd49e25 Re-add missing senderName & recipientName to output of API call GET /chat/messages 2020-05-19 15:29:12 +01:00
catbref
7102f4a727 Fix for incorrect amounts reported by API 2020-05-19 15:20:20 +01:00
catbref
28991a926f Fix incorrect getDataLength() in RegisterNameTransactionTransformer 2020-05-19 14:55:26 +01:00
catbref
74f89af841 Enforce version 2+ for DEPLOY_AT 2020-05-19 08:35:25 +01:00
catbref
b4284515e7 Unify transaction NAME_NOT_LOWER_CASE checks to Unicode NAME_NOT_NORMALIZED version 2020-05-19 08:31:36 +01:00
catbref
032c5d0d07 Add missing fee check to TRANSFER_PRIVS 2020-05-19 08:25:53 +01:00
catbref
72100fe1d8 Refactor Unicode 'reduced' name code from side-effects into 'data' objects.
CREATE_GROUP, ISSUE_ASSET, REGISTER_NAME and UPDATE_NAME transactions affected.

The code to actually generate 'reduced' name was called inside isValid() and
relied on setting the corresponding transaction data object field so that it would
be saved by isValid()'s caller. Although this worked, it wasn't a very clean
solution.

Now the 'reduced' name is generated by transaction data object's constructors so
it is always present.

Also removed name/group/asset reduceName(String) methods as they were all the
same single-line call to Unicode.sanitize().
2020-05-19 08:08:21 +01:00
catbref
ed178e744d Merge branch 'asset-unicode' into launch 2020-05-19 07:57:06 +01:00
catbref
94f7079c2e Unicode homoglyph support to Assets 2020-05-19 07:56:17 +01:00
catbref
f1638aa9d9 Removed "owner" from CREATE_GROUP and added Unicode homoglyph support.
Group owner now derived from CREATE_GROUP transaction creator's public key.

Added 'reduced' group name to GroupData, with corresponding change to DB.
Renamed GroupData.getIsOpen() to simply isOpen().

Tidied up CreateGroupTransactionData, adding 'reduced' group name.
Renamed getIsOpen() to simply isOpen().
Added code to generated reduced group name when building genesis block.

Added Group.MIN_NAME_SIZE of 3.

DB tables changed to add reduced_group_name where appropriate,
removing owner where necessary.

Added GroupRepository.reducedGroupNameExists(String).

Fixed up test blockchain configs in src/test/resources/test-chain-v2*.json.
2020-05-18 17:27:32 +01:00
catbref
a7b9215ace Merge branch 'message-wo-recipient' into launch 2020-05-18 10:12:54 +01:00
catbref
956ad7bfa8 Merge branch 'asset-fixes' into launch 2020-05-18 10:12:42 +01:00
catbref
4baf442cb8 Merge branch 'name-fixes' into launch 2020-05-18 10:12:31 +01:00
catbref
24eb7c6933 Allow MESSAGE transactions to have no recipient.
This allows on-chain messages to a group, including NO_GROUP / groupID zero.

No-recipient messages cannot have an amount - where would it go?

Changed MESSAGE serialization layout to add boolean indicating
whether recipient is present.

Changed MESSAGE serialization layout so assetID is after amount,
and only present if amount is non-zero.

Changed DB table structures to cover above.

Added unit tests to cover above.
2020-05-18 09:09:35 +01:00
catbref
38a2af8cd5 Tidy up Assets by removing 'owner' from ISSUE_ASSET.
Owner now derived from issuer's public key.
Maximum asset name length reduced to 40 characters.

Repository table changes.

"owner" removed from test blockchain configs and "issuerPublicKey" used instead
where applicable.

Some getters in the form of "getIs___()" renamed to simply "is____()".
2020-05-15 16:22:13 +01:00
catbref
7447ab20a9 Add index for finding Registered Names using 'reduced' form 2020-05-15 14:18:51 +01:00
catbref
197c742ce7 Major work on Registered Names
Changes include:

* Allowing renaming
* Tracking last-updated timestamps
* More stringent Unicode processing
* Way more unit tests
* Max name length reduction to 40 chars

Note: HSQLDB repository table changes
2020-05-15 14:08:46 +01:00
catbref
f6ed3388a4 BTC tidy-up 2020-05-15 07:45:24 +01:00
catbref
c61690f3e6 BTC class does not need to extend Thread! 2020-05-14 13:18:44 +01:00
catbref
9a94873d0e Fix broken Long vs Long comparison in Block.areAtsValid() 2020-05-14 13:18:17 +01:00
catbref
5c8bda37d1 Rework BTC class for better startup & shutdown.
Controller no longer starts up BTC support during main startup.
This does mean that BTC startup is deferred until first BTC-related
action, and that the first BTC-related action will take much longer
to complete.

Added tests to cover startup/shutdown.

This also fixes splash logo stuck on-screen and broken Controller
shutdown when using REGTEST bitcoin network AND there is no
local regtest bitcoin server running.
2020-05-14 12:52:26 +01:00
catbref
fbb73ee88e Suppress extraneous bitcoinj logging output 2020-05-14 12:52:08 +01:00
catbref
fa08041696 BlockTransformer should skip AT transactions when calculating block length 2020-05-14 12:51:44 +01:00
catbref
f01a34a461 Throw an API error for inappropriate calls on OFFER-state cross-chain ATs.
P2SH-related API calls under /crosschain/ aren't applicable for
cross-chain ATs that are still in OFFER state, only TRADE state.
2020-05-14 12:48:41 +01:00
catbref
c0242fe78b Correct comment and example Windows dirname entry in log4j2.properties 2020-05-14 11:42:22 +01:00