Commit graph

12923 commits

Author SHA1 Message Date
Doyle
6f0077024f Merge commit '15decf4' into dev 2020-10-12 18:19:27 +11:00
Doyle
7d15de036e
Merge pull request #1315 from Doy-lee/PulseAssignSortKey
Assign the last height validating pre-hf16 to seed the Pulse sort keys
2020-10-12 18:10:12 +11:00
Doyle
ab0ca3e046 Merge branch 'PulseAssignSortKey' of github.com:doy-lee/loki into PulseAssignSortKey 2020-10-12 18:07:15 +11:00
Doyle
c3b7eedfd7 Pulse: Drop difficulty to 1,000,000 for PoW at the fork height 2020-10-12 18:06:36 +11:00
Jason Rhinelander
125662b74b trace message display fix 2020-10-12 03:53:30 -03:00
Doyle
2ad85c6766 Pulse: Grace period for mainnet SNs until 646151 to upgrade to hotfix 2020-10-12 16:04:15 +11:00
Doyle
1d8a997a23 Pulse: Remigrate the sort key to 0
- Currently nodes that have updated over time will have seeded their
sort key to a different value than everyone else, causing everone to
generate Pulse quorums that are inconsistent with each other.

Instead, set the sort key to 0. Ties in the sort list are currently
dealt with by sorting on the public key itself.
2020-10-12 15:42:33 +11:00
Jason Rhinelander
aab63d049e
Merge pull request #1313 from Doy-lee/UsePulseRoundWhenQueryingLatestQuorum
Pulse: Use the latest round when querying quorums via rpc
2020-10-11 22:21:35 -03:00
Doyle
f91f018b09 Pulse: Use the latest round when querying quorums via rpc 2020-10-12 11:42:54 +11:00
Jason Rhinelander
674fa682bb
Bump version (mainly wallet-related fixes) (#1312) 2020-10-12 10:43:29 +11:00
Doyle
2c48efe827
Merge pull request #1310 from jagerman/rpc-last-quorum-of-each
RPC: get latest quorum improvements/fixes
2020-10-12 10:43:12 +11:00
Jason Rhinelander
920966c15d Use constants for checkpoint/blink interval lengths 2020-10-11 00:38:21 -03:00
Jason Rhinelander
cecabb0128 Don't include current pulse quorum before HF16 2020-10-11 00:17:39 -03:00
Jason Rhinelander
26744cd73e RPC: get latest quorum improvements/fixes
This changes the `get_quorum_state` RPC endpoint in two ways:

- If requesting a pulse quorum for a height that includes the current
height (i.e. top block + 1), this returns the current height, round-0
pulse quorum.

- When requesting the latest quorum state (i.e. the no-argument request)
you now get back the latest available quorum of each requested type,
instead of the quorum for the latest available block.  Thus requesting
all types will now give you:
    - the current top-of-the-chain round-0 pulse quorum
    - the top block obligations quorum (no change)
    - the top divisible-by-4 block for checkpoint quorums
    - the top divisible-by-5 block for blink quorums
Previously you would just get whatever quorums existing for the top
height, which often meant just the one-old pulse quorum + top block
obligations quorum, only only checkpoint 25% of the time and blink 20%
of the time.

- Also updated the RPC comments for GET_QUORUM_STATE, both to reflect
the above and to update some parts which were a bit stale.
2020-10-10 22:58:08 -03:00
Doyle
3d063cd895
Merge pull request #1309 from jagerman/rpc-wallet-known-decryption
RPC wallet LNS decryption & fixes
2020-10-09 14:25:42 +11:00
Jason Rhinelander
7e270530d3 Don't cache decrypted LNS values
Our cached value could well be wrong, if another owner (or another copy
of the wallet) has updated it, and so the information we have in the
cache other than the name and type (which don't change) can be
unreliable.

Drop the cached value/owner fields and instead use queried values for
encrypted/owner/backup, and decrypt value on the fly when needed.
2020-10-08 23:18:05 -03:00
Jason Rhinelander
f76c75f28c LNS_OWNERS_TO_NAMES rpc fixes
- Add missing expiration_height serialization.
- Add "include_expired" field (to match LNS_NAMES_TO_OWNERS).
2020-10-08 23:18:05 -03:00
Jason Rhinelander
3715b60810 Fix precedence bug causing expired entries to be returned
We later (potentially) add a "AND expiration_height >= ?", but that was
breaking get_mappings_by_owners because we have an "OR" here.
2020-10-08 23:18:05 -03:00
Jason Rhinelander
cbcb530877 Fix unwired lns_renew_mapping endpoint 2020-10-08 23:18:05 -03:00
Jason Rhinelander
e6c2cdaefa wallet RPC: make lns_known_names return record with optional decryption
This saves the GUI wallet, in particular, a lot of work: previously it
had to get the values from loki-wallet-rpc, then make a request to lokid
to retrieve the records, then for each of those make another call to the
wallet-rpc to decrypt the value.

This lets lns_known_names do it all in one request.
2020-10-08 23:17:59 -03:00
Doyle
15decf44e1
get_block_template: Allow unaccounted dust in construct_miner_tx (#1306)
- On some of the SN's who are queued for payout, requesting a block
template with it fails because we end up paying less than the total
amount allocated.

This was previously solved by having a `service_node_paid` in
`reward_parts` that I removed to simplify `reward_parts`.

This is only a client side sanity check and does not affect consensus.
The rest of the codebase uses the original calculate_sums_of_portions on
the total allocated reward (which when it does the division out, the
remainder is not included in the payouts and the verifying code expects
that, so everything should continue to work fine).
2020-10-09 09:55:47 +11:00
Jason Rhinelander
d3a7a9cef7
Fix LNS cache storage via RPC wallet (#1307)
- Add a wallet function to convert the type string into a type value
- Remove the lns buy/update/renew overloads that take a string; callers
  should use the above instead to convert (and check) the type.
- Fix rpc wallet cache entries to set the proper type in the lns cache
  instead of always inserting session type.
2020-10-09 09:51:10 +11:00
Jason Rhinelander
d16899104e
Close established HTTP requests when trying to shut down (#1308)
Currently we only close the listening HTTP socket(s) but not established
connections, which means a client make repeated keep-alive requests will
keep the HTTP server alive for potentially a very long time when we're
trying to shut down or restart.

This commit changes the logic to more forcefully close request
connections with the next reply, so that we properly shut down within a
few seconds but give clients a chance to finish up their current
request.
2020-10-09 09:48:24 +11:00
Jason Rhinelander
e2068a5a33
Merge pull request #1301 from Doy-lee/LNSErrorMessageReturn
LNS: Don't overwrite err message on validation fail
2020-10-06 23:22:36 -03:00
Doyle
49aa6c9ab6
Merge pull request #1304 from jagerman/default-port
Properly append default port to --daemon-address
2020-10-07 13:19:48 +11:00
Jason Rhinelander
26a5d045ac Remove unused variable 2020-10-06 23:09:46 -03:00
Doyle
89cc4c42a3
args: Coerce rpc port to number instead of string (#1303) 2020-10-07 10:40:30 +11:00
Jason Rhinelander
bcec558edb Properly append default port to --daemon-address
Currently the wallet is trying to connect to http://HOSTNAME when you
give just --daemon-address=hostname rather than http://HOSTNAME:22023;
fix it by appending the default port when no port is present, and move
that port addition logic into `set_daemon`.
2020-10-05 22:49:31 -03:00
Doyle
c0c6522ccb LNS: Don't overwrite err message on validation fail
- String_view-ify mapping_type_str
- Use std::optional directly on type in wallet
2020-10-05 12:18:51 +11:00
Jason Rhinelander
27aa2fb9bc Merge remote-tracking branch 'origin/stable' into dev 2020-10-03 23:35:37 -03:00
Jason Rhinelander
bb4fe8a949
Merge pull request #1300 from jagerman/build-tweaks
Small tweaks to build system
2020-10-03 23:32:55 -03:00
Jason Rhinelander
f6c3adfb8e Small tweaks to build system
- make tagged and stable branch builds not add git tag to the tar.xz
  filename
- copy apt-get tweaks (to make it less noisy) from deb branches
- do a faster shallow submodule clone
- remove exclusion for removed is_hdd test
- remove deb_builder (deb building drone code is in its own branches)
- fix upload dir for a tagged build
2020-10-03 23:24:08 -03:00
Jason Rhinelander
35e49dab57
Merge pull request #1299 from jagerman/no-readline
Disable readline in static build
2020-10-02 18:07:57 -03:00
Jason Rhinelander
59104a7c8b Delay HF16 to 12 October 2020-10-02 12:44:45 -03:00
Jason Rhinelander
faa92db523 Delay HF16 to 12 October 2020-10-02 12:41:14 -03:00
Jason Rhinelander
4fd9a7dff5 Disable readline in static build 2020-10-02 01:02:48 -03:00
Jason Rhinelander
9ae405c06c Merge commit '61d6564bc' into dev 2020-10-01 21:27:38 -03:00
Jason Rhinelander
61d6564bc3 Remove -dev suffix for stable branch 2020-10-01 21:21:37 -03:00
Jason Rhinelander
b36a24bcd7 Merge branch 'master' into dev 2020-10-01 19:56:26 -03:00
Jason Rhinelander
fb3b5de0f2
Merge pull request #1151 from darcys22/cache-lns-records
Cache lns records
2020-10-01 15:37:27 -03:00
Jason Rhinelander
c3f56c317d
Merge pull request #1297 from Doy-lee/BlinkReturnStatus
Blink: Only request blinks to wallet when approved
2020-10-01 15:06:25 -03:00
Jason Rhinelander
f96eed604c Add RPC endpoint to access known names 2020-10-01 15:02:51 -03:00
Jason Rhinelander
b1f5de4bce Compilation fix + autoize 2020-10-01 14:22:53 -03:00
Ubuntu
e0df4ca4c9 adjust for 20.04 2020-10-01 14:19:36 -03:00
Sean Darcy
9571d41e0f cleaned up notes 2020-10-01 14:16:15 -03:00
Sean Darcy
302bcfc6ca unordered map, added to RPC commands 2020-10-01 14:16:14 -03:00
Sean Darcy
87ecffa61b Creates a Cache in the CLI Wallet for LNS Records
The lns records are stored on the blockchain in a hashed state so the
name and value are not immediately accessable. This creates a store in
the wallet so the unhashed details are saved and can be viewed at a
later date.
2020-10-01 14:11:30 -03:00
Sean Darcy
12fc6a2592 print_owners_to_names now shows cached names and values 2020-10-01 14:06:04 -03:00
Sean Darcy
b734843d77 Saves to LNS cache and retrieves 2020-10-01 13:59:33 -03:00
Sean Darcy
f77fca124d functions to save to cache 2020-10-01 13:58:16 -03:00