2920 Commits

Author SHA1 Message Date
CalDescent
6fee2c3e9e Bump version to 3.6.1 2022-10-12 20:25:34 -05:00
CalDescent
d7d0848e90 Return empty levels in GET /addresses/online/levels 2022-10-12 20:25:34 -05:00
CalDescent
27104a6b76 Reintroduced initial sleep period in block archiver. 2022-10-12 20:25:34 -05:00
CalDescent
25886d1438 Renamed constant for consistency 2022-10-12 20:25:34 -05:00
CalDescent
5fed38bb65 Fixed issue causing startup of various components to be delayed by 30 seconds. 2022-10-12 20:25:34 -05:00
CalDescent
b52cea03a2 Fixed bug in last commit.
We need to track items to remove separately from items to add, otherwise invalid accounts remain in the queue.
2022-10-12 20:25:34 -05:00
CalDescent
238c88ca5b Yet another attempt to optimize the online accounts import queue processing.
The main difference here is that we now remove items from the onlineAccountsImportQueue in a batch, _after_ they have been imported. This prevents duplicates from being added to the queue in the previous time gap between them being removed and imported.
2022-10-12 20:25:34 -05:00
CalDescent
2b3f627de5 Revert "Allow duplicate variations of each OnlineAccountData in the import queue, but don't allow two entries that match exactly."
This reverts commit 6d9e6e8d4c89582ffad23c1094b6a8e3aee91116.
2022-10-12 20:25:34 -05:00
CalDescent
2f1dc18910 Added optional filtering by reference in GET /chat/messages 2022-10-12 20:25:34 -05:00
CalDescent
eac2407238 Include total count in debug trade presence logging 2022-10-12 20:25:34 -05:00
CalDescent
e2342e2327 Fixed bug which required a node to hold local trade presences before it would request any.
This caused large gaps with no presence data. They are removed when they expire, causing the local count to drop to zero, and the node would only start requesting them again once a peer had pushed one or more entries proactively.
2022-10-12 20:25:34 -05:00
CalDescent
41438e1b48 Moved error to debug, as we now get a burst of these soon after startup, due to commit 99858f3.
This also shows that commit 99858f3 now prevents a block candidate with a very small number of online accounts being built immediately after startup.
2022-10-12 20:25:34 -05:00
CalDescent
6d91cbfe58 Fixed Synchronizer.getBlockSummaries() which was expecting BLOCK_SUMMARIES, but updated peers send BLOCK_SUMMARIES_V2 2022-10-12 20:25:34 -05:00
CalDescent
77a4a87541 Fixed error in rebase. 2022-10-12 20:25:34 -05:00
CalDescent
5510418138 BlockSummariesV2Message.MINIMUM_PEER_VERSION set to 3.6.1 2022-10-12 20:25:34 -05:00
catbref
a690789888 Initial work on BLOCK_SUMMARIES_V2, part of a bigger arc to improve synchronization.
Touches quite a few files because:

* Deprecate HEIGHT_V2 because it doesn't contain enough info to be fully useful during sync.
Newer peers will re-use BLOCK_SUMMARIES_V2.

* For newer peers, instead of sending / broadcasting HEIGHT_V2,
send top N block summaries instead, to avoid requests for minor reorgs.

* When responding to GET_BLOCK, and we don't actually have the requested block,
we currently send an empty BLOCK_SUMMARIES message instead of not responding,
which would cause a slow timeout in Synchronizer.

This pattern has spread to other network message response code,
so now we introduce a generic 'unknown' message type for all these cases.

* Remove PeerChainTipData class entirely and re-use BlockSummaryData instead.

* Each Peer instance used to hold PeerChainTipData - essentially single latest block summary - but now holds a List of latest block summaries.

* PeerChainTipData getter/setter methods modified for compatibility at this point in time.

* Repository methods that return BlockSummaryData (or lists of) now try to fully populate them,
including newly added block reference field.

* Re-worked Peer.canUseCommonBlockData() to be more readable

* Cherry-picked patch to Message.fromByteBuffer() to pass an empty, read-only ByteBuffer to subclass fromByteBuffer() methods, instead of null.
This allows natural use of BufferUnderflowException if a subclass tries to use read(), or hasRemaining(), etc. from an empty data-payload message.
Previously this could have caused an NPE.
2022-10-12 20:25:34 -05:00
CalDescent
58bdddd3d6 Moved various online accounts logs to TRACE level, to make it easier to monitor the queue processing when in DEBUG. 2022-10-12 20:25:34 -05:00
CalDescent
24def5abdc Modified online accounts request interval, and introduced bursting.
It will now request online accounts every 1 minute instead of every 5 seconds, except for the first 5 minutes following a new online accounts timestamp, in which it will request every 5 seconds (referred to as the "burst" interval). It will also use the burst interval for the first 5 minutes after the node starts.

This is based on the idea that most online accounts arrive soon after a new timestamp begins, and so there is no need to request accounts so frequently after that. This should reduce data usage by a significant amount.

Once mempow is fully rolled out, the "burst" feature can be reduced or removed, since online accounts will be sent ahead of time, generally 15-30 mins prior to the new online accounts timestamp becoming active.
2022-10-12 20:25:34 -05:00
CalDescent
09a577d7e1 Add accounts from the import queue individually, and then skip future duplicates before unnecessarily validating them again.
This closes a gap where accounts would be moved from onlineAccountsImportQueue to onlineAccountsToAdd, but not yet imported. During this time, there was nothing to stop them from being added to the import queue again, causing duplicate validations.
2022-10-12 20:25:34 -05:00
CalDescent
8099a5776d Set hasOurOnlineAccounts to true if one of our accounts is found before signing. 2022-10-12 20:25:34 -05:00
CalDescent
741c5c4ae4 When validating online accounts, enforce mempow if the online account's timestamp is after the feature trigger. 2022-10-12 20:25:34 -05:00
CalDescent
74f4457f2b Allow duplicate variations of each OnlineAccountData in the import queue, but don't allow two entries that match exactly. 2022-10-12 20:25:34 -05:00
CalDescent
f1314779ed Wait 30 seconds after the node starts before computing our online accounts.
This allows some time for initial online account lists to be retrieved, and reduces the chances of the same nonce being computed twice.
2022-10-12 20:25:34 -05:00
CalDescent
1eea3e97fd Don't add online accounts to the import queue if they are already validated 2022-10-12 20:25:34 -05:00
CalDescent
bc4fa0010f Removed online accounts V2 and V1 messaging, as the V3 format will soon be required due to the nonce values. 2022-10-12 20:25:34 -05:00
CalDescent
2ee1829fad Fixed bug causing error 500 in some cases. 2022-10-12 20:25:34 -05:00
CalDescent
9722177194 Reordered code in Block.mint() to fix potential issue after mempow activates. 2022-10-12 20:25:34 -05:00
CalDescent
216a21bc49 Bump version to 3.6.0 2022-10-12 20:25:34 -05:00
CalDescent
04e4767682 QORA / block reward adjustments set to activate at height 1010000 2022-10-12 20:25:34 -05:00
CalDescent
b8895c4323 OnlineAccountsV3Message.MIN_PEER_VERSION set to 3.6.0 2022-10-12 20:25:34 -05:00
CalDescent
5e61fe3bff Use path parameter instead of query string. 2022-10-12 20:25:34 -05:00
CalDescent
63160c1aa5 Added GET /chat/message/{signature} endpoint.
This will ease the transition to a Q-Chat protocol, where chat messages will no longer be regular transactions.
2022-10-12 20:25:34 -05:00
CalDescent
dc23195eba ChatTransaction MAX_DATA_SIZE increased from 256 to 1024 bytes, to allow for new UI features. 2022-10-12 20:25:34 -05:00
CalDescent
2b3b38b79f Added support for Pirate Chain wallets on FreeBSD. 2022-10-12 20:25:34 -05:00
CalDescent
23a4e5e7e4 Added support for ARRR refunds via /crosschain/htlc/refund/{ataddress} and /crosschain/htlc/refundAll
This could probably be refactored into multiple classes to make the code cleaner, but it is functional for now.
2022-10-12 20:25:34 -05:00
CalDescent
afef11125c Allow BTC trades in redeemAll / refundAll, since most will now be using ACCTv3. 2022-10-12 20:25:34 -05:00
Matthew DeGarmo
f6d5f1becd adding settings 2022-10-12 20:25:34 -05:00
Matthew DeGarmo
423514b749 fixing line continuation. 2022-10-12 20:25:34 -05:00
Matthew DeGarmo
24adc71bd4 Trying to run in container, can't background process.
Adding docker arg to unsuppress logs.

Fixing entry point.

fixing paths

fixing paths
2022-10-12 20:25:29 -05:00
CalDescent
063ef8507b Fix for NPE in last commit 2022-09-11 20:04:51 +01:00
CalDescent
f042b5ca5f If mempow is active, remove any legacy accounts from a to-be-minted block that are missing a nonce. 2022-09-11 11:41:11 +01:00
CalDescent
a10e669554 Allow nonce to be computed for "next" timestamp if mempow is enabled in settings. 2022-09-11 11:36:19 +01:00
CalDescent
501f66ab00 BlockTransformer updates necessary for mempow online accounts.
Using the feature trigger timestamp here should be much less error prone than a whole new block message version. Once mempow has been live for at least 24 hours, the feature trigger can be removed and the code cleaned up, as all online accounts signatures will use the new format from that time onwards (legacy signatures are trimmed after 24 hours).
2022-09-10 18:31:01 +01:00
CalDescent
6003ed3ff7 Revert "Use block's online accounts timestamp (instead of main timestamp) for the mempow hard fork."
This reverts commit 8cca6db31637dcf43cbcf524949f629c3b35b6a6.
2022-09-10 17:23:39 +01:00
CalDescent
03e3619817 Revert "Use onlineAccountTimestamp for all mempow hard fork related code in OnlineAccountsManager too."
This reverts commit 23423102e70561471cd42db4ac035624d33f0bd0.
2022-09-10 17:23:34 +01:00
CalDescent
0e42e7b05a Merge branch 'master' into online-accounts-mempow-v2-block-updates
# Conflicts:
#	src/test/resources/test-chain-v2-no-sig-agg.json
2022-09-10 13:50:26 +01:00
CalDescent
d4fbc1687b Optionally exclude initial data from all trade websockets, using query string parameter excludeInitialData=true
Due to the large amount of data, it can take some time for the request to be processed and data to be transferred. It may make more sense to load the initial state from the standard API, and just use the websockets for updates.
2022-09-09 18:45:51 +01:00
CalDescent
8ffdc9b369 POST /crosschain/htlc/importarchivedtrades moved to POST /admin/repository/importarchivedtrades, as this is a repository operation not an HTLC one. 2022-09-09 18:01:20 +01:00
CalDescent
c883dd44c8 Remove LitecoinACCTv2 as it is no longer being used, and is unsafe. 2022-09-09 17:40:10 +01:00
CalDescent
667530e202 Remove DogecoinACCTv2 as it is no longer being used, and is unsafe. 2022-09-09 17:12:44 +01:00