Commit Graph

13353 Commits

Author SHA1 Message Date
ghubstan
bb8d2ae7c4
Inject Config into CoreApi 2020-12-19 15:50:00 -03:00
ghubstan
9f679deb08
Add license note and toString method 2020-12-19 15:47:20 -03:00
ghubstan
830a5f009a
Add license note 2020-12-19 15:43:44 -03:00
ghubstan
455ed67f9b
Add GrpcServiceRateMeteringConfigTest 2020-12-19 15:41:55 -03:00
ghubstan
5de910a03d
Add unit test dependencies to daemon subproject 2020-12-19 15:40:27 -03:00
ghubstan
b307593c82
Make CallRateMeteringInterceptor configurable via json
This adds a GrpcServiceRateMeteringConfig class that can read and
write rate metering interceptor config files, and configure
a gRPC rate metering service interceptor at startup.

This seems excessive, but we need to be able to test and tune
method rate metering without having to change hard coded, default
interceptor rate meters.
2020-12-19 15:32:40 -03:00
ghubstan
a5ed17e43f
Add license comment, stop & toString methods, and make isRunning transient 2020-12-19 13:14:06 -03:00
ghubstan
89e2187878
Change long to int, tidy up error msg 2020-12-17 14:12:04 -03:00
ghubstan
2148a4d958
Prevent excessive api calls
This change provides a gRPC CallRateMeteringInterceptor to help protect
the server and network against being overloaded by CLI scripting mistakes.

An interceptor instance can be configured on a gRPC service to set
individual method call rate limits on one or more of the the service's
methods. For example, the GrpcOffersService could be configured with
this interceptor to set the createoffer rate limit to 5/hour, and
the takeoffer call rate limit could be set to 20/day.  Whenever a
call rate limit is exceeded, the gRPC call is aborted and the client
recieves a "rate limit exceeded" error.

Below is a simple example showing how to set rate limits for one method
in GrpcVersionService.

    final ServerInterceptor[] interceptors() {
        return new ServerInterceptor[]{
                new CallRateMeteringInterceptor(new HashMap<>() {{
                    put("getVersion", new GrpcCallRateMeter(2, SECONDS));
                }})
        };
    }

It specifies a CLI can execute getversion 2 times / second.

This is not a throttling mechansim, there is no blocking nor locking
to slow call rates.  When call rates are exceeded, calls are
simply aborted.
2020-12-17 12:33:45 -03:00
ghubstan
fa9ffa1fb2
Put arguments on separate lines 2020-12-16 15:35:12 -03:00
ghubstan
2572e8641d
Create grpc interceptor pkg, move auth interceptor into it 2020-12-16 15:30:40 -03:00
ghubstan
f7c1103848
Rename gRPC exception handler class 2020-12-16 14:42:23 -03:00
ghubstan
c60605f75c
Fix class level comment 2020-12-16 14:26:12 -03:00
ghubstan
1cd47fd0aa
Merge branch 'master' into 09-refactor-grpc-error-handling 2020-12-16 13:45:29 -03:00
ghubstan
e6c6d3b8d3
Add new CoreApiExceptionHandler to gRPC services
This change reduces gRPC service error handling duplication by moving
it into a @Singleton encapsulating everything needed to wrap
an expected or unexpected core api exception into a gRPC
StatusRuntimeException before sending it to the client.  It also
fixes some boilerpate classes were gRPC error handling was missing.
2020-12-16 13:34:21 -03:00
sqrrm
86d81762f6
Merge pull request #4949 from chimp1984/show-pricedeviation-for-fixed-price-offers
Show price deviation in % for fixed price offers and BSQ
2020-12-16 15:30:14 +01:00
Christoph Atteneder
0789180bb0
Merge pull request #4957 from sqrrm/sign-single-account
Sign single account
2020-12-16 14:07:34 +01:00
sqrrm
4cdd94ac28
Merge pull request #4955 from chimp1984/cache-frequent-method-calls
Cache results of isFiatCurrency and isCryptoCurrency
2020-12-16 12:11:58 +01:00
sqrrm
25328167de
Merge pull request #4958 from chimp1984/disable-tx-broadcast-if-connected-to-local-node
Do not use tx broadcast to mempool nodes if a local btc nodes is used
2020-12-16 12:10:19 +01:00
chimp1984
bb3dbf3d78
Add null check (for tests) and fix missing param for test class.
Fix test with price display.
2020-12-15 23:29:53 -05:00
chimp1984
1106d01ff7
Set bsq30DayAveragePrice only at activate as its expensive
call and does not change frequently and is only used for
informational purpose as % display.
2020-12-15 23:29:52 -05:00
chimp1984
c858ac7b7d
Add check to not devide by 0
Cleanups
2020-12-15 23:29:52 -05:00
chimp1984
34f10d37ef
Add price deviation in % to BSQ using 30 day average 2020-12-15 23:29:52 -05:00
chimp1984
f97bb6228b
Show also % price deviation for fixed price and
sort according to it
Allow sorting at show all. This helps to spot
good offers with negative % over the whole market.
2020-12-15 23:29:52 -05:00
chimp1984
59cfb2d3a9
Do not use tx broadcast to mempool nodes if a local btc nodes is used
See discussion at: https://github.com/bisq-network/bisq/pull/4943#issuecomment-745615764
2020-12-15 20:04:38 -05:00
chimp1984
ecad724046
Add null checks, improve comment 2020-12-15 19:08:37 -05:00
sqrrm
f61e62c7c0
Merge pull request #4956 from chimp1984/sort-paymentmethods-by-name
Sort payment methods by display string not by id.
2020-12-16 00:17:26 +01:00
sqrrm
fa01192661
Merge pull request #4952 from chimp1984/fix-priv-message-from-peer-icon
Allow sending private notifications from avatar icon at trade
2020-12-16 00:15:46 +01:00
sqrrm
9b8073b94a
Merge pull request #4954 from chimp1984/various-small-improvements
Various small improvements
2020-12-15 23:04:15 +01:00
sqrrm
bc60db39ae
Merge pull request #4943 from chimp1984/add-tx-broadcast-to-mempool-explorer-api
Add tx broadcast to mempool explorer api
2020-12-15 22:57:37 +01:00
sqrrm
26024bd6ec
Refactor: rename methods, move return statement 2020-12-15 19:35:49 +01:00
sqrrm
e0f4dc22e7
Fix formatting 2020-12-15 19:27:13 +01:00
sqrrm
4c33f9c999
Sign imported AccountAgeWitness,PubKey
Change the specific sign window to sign an imported account in the form
of accountAgeWitnessString,pubKeyString. The SignSpecificWitness never
worked due to missing pubKey data and this is a way to import the missing data.
2020-12-15 16:08:06 +01:00
ghubstan
a341173412
Merge branch 'master' into 09-scratch 2020-12-15 11:13:37 -03:00
chimp1984
0f084d3aec
Use ConcurrentHashMap
Add comment
2020-12-15 09:05:33 -05:00
sqrrm
de25105fa8
Copy account data to clipboard
Use ctrl+c to copy accountagewitness and pubkey to clipboard in a format to
be used by arbitrator to sign the account
2020-12-15 14:53:34 +01:00
chimp1984
7e145739c3
Cache hash to avoid expensive hash operation. 2020-12-15 01:05:16 -05:00
chimp1984
f7a706518c
Use PRIVATE_LOW_PRIO instead of PRIVATE for sequenceNumberMap
to reduce cpu load for persistence.
2020-12-15 01:03:52 -05:00
chimp1984
1ddde42e17
Keep Date as transient field to avoid recreating a
Data object at each getDate call.

Add JsonExclude to Offer.currencyCode

getDate get called very often and we have > 80k objects.
2020-12-15 01:02:49 -05:00
chimp1984
9fc4f61bf6
Cache currencyCode
Extract variable

getCurrencyCode get called very often (Comparatos) so we cache result.
2020-12-15 00:59:05 -05:00
chimp1984
02d163f5dc
Only log in case the operation took longer than 100 ms 2020-12-15 00:56:06 -05:00
chimp1984
5112b1a54b
Cache results of isFiatCurrency and isCryptoCurrency
They are called very often and accumulate cpu time as
shown in profilers.
2020-12-15 00:54:26 -05:00
chimp1984
d7a95fed03
Pass trade if available and use peers keyring 2020-12-15 00:40:45 -05:00
sqrrm
0e7dd21745
Merge pull request #4916 from chimp1984/fix-access-from-wrong-thread-at-wallet-restore
Property fields must not be set from non JavaFX threads.
2020-12-14 23:56:14 +01:00
chimp1984
5c68ad0b47
Sort payment methods by display string not by id.
Apply sorting in drop down boxes.
2020-12-14 14:42:15 -05:00
Christoph Atteneder
7d12b94c6a
Merge pull request #4933 from chimp1984/add-num-items-to-tables
Improve funds and portfolio screens
2020-12-14 19:48:55 +01:00
Christoph Atteneder
6ae33fe5f2
Merge pull request #4935 from chimp1984/add-wallet-info-view
Add wallet info view
2020-12-14 19:48:23 +01:00
Christoph Atteneder
092ae3da33
Merge pull request #4947 from chimp1984/fix-bug-with-maker-fee-tx-at-create-offer
Fix bug with maker fee tx at create offer
2020-12-14 19:47:06 +01:00
ghubstan
4be87a6281
Disable method test to avoid repetition 2020-12-14 15:12:39 -03:00
chimp1984
cb289845b6
Add reference to bitcoin RPC error codes 2020-12-14 13:08:12 -05:00