Commit graph

15933 commits

Author SHA1 Message Date
ghubstan
a1db0d10b0
Update API docs for Bitcoin Core version v22.0
Plus some outdated JDK version compat comments.
2021-11-29 12:43:58 -03:00
ghubstan
b1dd20572c
Allow unrecognized options in OfferIdOptionParser where appropriate
The OfferIdOptionParser superclass reduces duplication for parsing
offer-id parameters, but it needs to let subclass parsers' other
options pass validation.
2021-11-29 12:30:13 -03:00
jmacxx
0025609375
Bugfix: dispute ticket reopened by mailbox message 2021-11-29 09:18:55 -06:00
ghubstan
6b89254588
Adjust core api method help docs for bsq swaps 2021-11-29 11:29:42 -03:00
ghubstan
8b2dec7a55
Remove unused function outputs 2021-11-28 16:37:41 -03:00
ghubstan
1b7e43a874
Add apitest/scripts/bsqswap-simulation.sh script
Some refactoring and typo corrections in existing scripts too.
2021-11-28 16:12:02 -03:00
ghubstan
66115f3d81
Revert "There is no --swap opt in editoffer command"
This reverts commit b5981b5b71.

This was a mistake.  There is a swap opt in the createoffer command.
2021-11-28 14:56:57 -03:00
ghubstan
0d8559d0d2
Force rebuild after github action ECONNRESET 2021-11-27 20:58:05 -03:00
chimp1984
bfd45d359a
Fix incorrect start height for block request
We added 1 as with the lite monitor mode we persist the most recent block,
thus we request with the start height for the next block.
But that cause a problem at a DAO full mode which has lite monitor mode set
as then the block parsing would not be triggered.

We refactor it so that we take the chainHeight from the dao state
directly and add 1 at the requests.
We add a check if we are at chain tip, and if so we skip requests
and call the onParseBlockChainComplete directly.
2021-11-28 00:27:04 +01:00
ghubstan
b5981b5b71
There is no --swap opt in editoffer command
BSQ swap offers cannot be edited
2021-11-27 14:17:52 -03:00
ghubstan
000fe9b991
Test blocking attempts to edit BsqSwap offers on server 2021-11-27 14:02:11 -03:00
ghubstan
b95e4b37b6
Block attempts to edit BsqSwap offers from CLI 2021-11-27 14:01:38 -03:00
ghubstan
64f228d872
Make rpc GetOfferCategory service work for my+avail offers
There are some use cases where the CLI needs to know what kind of offer
is being acted on before the request is made, For example:

There are differences between a BsqSwap 'takeoffer'request, and a v1
'takeoffer' request.

A BsqSwap offer cannot be edited by an 'editoffer' request, and an
attempt should be blocked by the CLI.

- Append isMyOffer GetOfferCategoryRequest rpc msg def.

- Adjust daemon.grpc services for new boolean GetOfferCategoryRequest param.

- Adjust core.api for new boolean GetOfferCategoryRequest param.

- Add validation check in core.api EditOfferValidator to block attempt to
  edit a BsqSwap offer.

- Refactor CoreOffersService get*offer(id) methods to optionally throw
  excpetions.
2021-11-27 14:01:14 -03:00
Steven Barclay
e383edc38a
Inline predicates to simplify HashCashService & FilterManager
Remove all the 'challengeValidation', 'difficultyValidation' and
'testDifficulty' BiPredicate method params from 'HashCashService' &
'ProofOfWorkService', to simplify the API. These were originally
included to aid testing, but turned out to be unnecessary.

Patches committed on behalf of @chimp1984.
2021-11-27 05:59:41 +00:00
jmacxx
670c5418ee
Improve user experience once mediation has been accepted by both parties
Transitions to Trade Step 4 (previously it would close/remove the trade).
2021-11-26 20:55:46 -06:00
ghubstan
05d1916ae9
Fix help text typo 2021-11-26 10:54:28 -03:00
Steven Barclay
e0595aa284
Store difficulty as floating point in Filter & PoW
Change the type of the 'difficulty' field in the Filter & ProofOfWork
proto objects from int32/bytes to double and make it use a linear scale,
in place of the original logarithmic scale which counts the (effective)
number of required zeros.

This allows fine-grained difficulty control for Equihash, though for
Hashcash it simply rounds up to the nearest power of 2 internally.

NOTE: This is a breaking change to PoW & filter serialisation (unlike
the earlier PR commits), as the proto field version nums aren't updated.
2021-11-26 04:08:15 +00:00
ghubstan
0aa0852407
Add CLI createoffer smoketest (for bsq swaps)
NEVER RUN ON MAINNET!
2021-11-25 18:21:06 -03:00
ghubstan
132ecc9ac3
Adjust CliMain's createoffer for BSQ swaps 2021-11-25 18:20:04 -03:00
ghubstan
15621d42a9
Re-@Disable method tests (don't run 2x from gradle) 2021-11-25 18:19:12 -03:00
ghubstan
eff10842b9
Tighten createoffer param validation (only bsq swaps supported) 2021-11-25 17:31:54 -03:00
ghubstan
35aeb61338
Adjust createoffer opt parser for bsq swaps 2021-11-25 17:10:19 -03:00
ghubstan
b1c872c515
Adjust createoffer opt parser/test for bsq swaps 2021-11-25 17:08:07 -03:00
ghubstan
3077be54f0
Remove API createoffer's paymentAcctId request param (BSQ swap) 2021-11-25 16:12:05 -03:00
ghubstan
00a5e2b650
Merge branch 'master' into 2-refactor-api-bsqswap-support 2021-11-25 14:33:48 -03:00
Steven Barclay
0c94e232f8
Add+enable service to mint/verify Equihash proofs of work
Add an abstract base class, 'ProofOfWorkService', for the existing PoW
implementation 'HashCashService' and a new 'EquihashProofOfWorkService'
PoW implementation based on Equihash-90-5 (which has 72 byte solutions &
5-10 MB peak memory usage). Since the current 'ProofOfWork' protobuf
object only provides a 64-bit counter field to hold the puzzle solution
(as that is all Hashcash requires), repurpose the 'payload' field to
hold the Equihash puzzle solution bytes, with the 'challenge' field
equal to the puzzle seed: the SHA256 hash of the offerId & makerAddress.

Use a difficulty scale factor of 3e-5 (derived from benchmarking) to try
to make the average Hashcash & Equihash puzzle solution times roughly
equal for any given log-difficulty/numLeadingZeros integer chosen in the
filter.

NOTE: An empty enabled-version-list in the filter defaults to Hashcash
(= version 0) only. The new Equihash-90-5 PoW scheme is version 1.
2021-11-25 17:17:45 +00:00
Steven Barclay
647fc862d4
Fix method name typo: redoProofOfWorkAndRepublish 2021-11-25 11:45:23 +00:00
Steven Barclay
cb7481d21f
Add difficulty adjustment & benchmarking to Equihash(Test)
Provide a utility method, 'Equihash::adjustDifficulty', to linearise and
normalise the expected time taken to solve a puzzle, as a function of
the provided difficulty, by taking into account the fact that there
could be 0, 1, 2 or more puzzle solutions for any given nonce. (Wagner's
algorithm is supposed to give 2 solutions on average, but the observed
number is fewer, possibly due to duplicate removal.) For tractability,
assume that the solution count has a Poisson distribution, which seems
to have good agreement with the tests.

Also add some (disabled) benchmarks to EquihashTest. These reveal an
Equihash-90-5 solution time of ~146ms per puzzle per unit difficulty on
a Core i3 laptop, with a verification time of ~50 microseconds.
2021-11-25 11:10:02 +00:00
Christoph Atteneder
4893be23cd
Improve release build documentation 2021-11-25 11:06:29 +01:00
cd2357
1261f84885
Update package.gradle: rely on local JDK 15
Enforce the use of JDK 15 when packaging. This removes the need to download and unpack JDK 15 just for the use of jpackager.
2021-11-25 11:06:28 +01:00
Christoph Atteneder
9617da39ab
Print dependency report if failure 2021-11-25 11:06:28 +01:00
Christoph Atteneder
57a88be559
Remove gradle cache 2021-11-25 11:06:28 +01:00
Christoph Atteneder
6165fb6042
Add official Java 15 support 2021-11-25 11:06:27 +01:00
Christoph Atteneder
8fb8374721
Merge pull request #5864 from cd2357/add-java-15-as-supported-jdk
Update package.gradle: rely on local JDK 15
2021-11-25 11:05:26 +01:00
Christoph Atteneder
04c88223ad
Improve release build documentation 2021-11-25 10:50:05 +01:00
cd2357
3723dd32ef
Update package.gradle: rely on local JDK 15
Enforce the use of JDK 15 when packaging. This removes the need to download and unpack JDK 15 just for the use of jpackager.
2021-11-25 10:50:05 +01:00
Christoph Atteneder
55fc413ee0
Print dependency report if failure 2021-11-25 10:50:04 +01:00
Christoph Atteneder
9836c0fac2
Remove gradle cache 2021-11-25 10:50:04 +01:00
Christoph Atteneder
7727776453
Add official Java 15 support 2021-11-25 10:50:03 +01:00
jmacxx
dfc7361b04
Add new block listener to update locked balance display 2021-11-25 09:55:04 +01:00
jmacxx
f0efe7175c
Fix exception in Portfolio History screen 2021-11-25 09:54:54 +01:00
Christoph Atteneder
ba6d5e2c73
Merge pull request #5842 from jmacxx/fix_exception_portfolio_history
Bug fixes: Locked Balance display; Portfolio History screen
2021-11-25 09:54:31 +01:00
ghubstan
c177b3b834
Merge branch 'master' into 2-api-bsq-swap-scratch 2021-11-24 13:14:13 -03:00
ghubstan
6403fc1f81
Adjust apitest cases to rpc BSQ wwap related changes 2021-11-24 13:12:48 -03:00
ghubstan
0c5c343fe0
Adjust CLI to support getting/taking BSQ swaps
Also refactored some of the opt parsers.
2021-11-24 13:10:34 -03:00
ghubstan
3aae052813
Refactor core.api trade service implemenentations for BSQ swaps
A minor refactoring to support serving TradeModel instances to CLI.
For example, the CLI 'gettrade' command must return a v1 Trade or
BSQ swap trade.
2021-11-24 13:05:09 -03:00
ghubstan
f88c1513ec
Refactor GrpcTradesService: use GetTrade & TakeOffer services for BSQ swaps
The rpc GetBsqSwapTrade and TakeBsqSwapOffer services were a quick hack
to help test BSQ swap feature development more quickly, using apitest
cases.  Their gRPC service method implementations are removed here and
the GetTrade & TakeOffer service methods are refactored to support BSQ
swaps.
2021-11-24 13:00:30 -03:00
ghubstan
17277c4c67
Remove Get/Take BSQSwap Offer/Trade rpc service defs
The old GetTrade and TakeOffer rpc service defs will be used
for getting BSQ swap trades, and taking BSQ swap offers.
2021-11-24 12:52:58 -03:00
Steven Barclay
d8d8ec3f97
Add PoW version(-list) fields to ProofOfWork & Filter
Add a numeric version field to the 'ProofOfWork' protobuf object, along
with a list of allowed version numbers, 'enabled_pow_versions', to the
filter. The versions are taken to be in order of preference from most to
least preferred when creating a PoW, with an empty list signifying use
of the default algorithm only (that is, version 0: Hashcash).

An explicit list is used instead of an upper & lower version bound, in
case a new PoW algorithm (or changed algorithm params) turns out to
provide worse resistance than an earlier version.

(The fields are unused for now, to be enabled in a later commit.)
2021-11-24 15:07:42 +00:00
Christoph Atteneder
19eb7eb50b
Merge pull request #5856 from ripcurlx/update-data-stores-for-v1.8.0
Update data stores for v1.8.0
2021-11-24 14:00:10 +01:00