clang needs this as well, and while it can do it with pragmas, it's more
complicated and easier to just change the compilation flags for the
source file.
Due to prior behaviour of immediately accepting blinks, they get
commited to the wallet's transfers container early. A second view wallet,
that restores the first wallet seed will _not_ see the blinks if it is
generated after the fact as this information is not stored in the
blockchain.
The second view wallet will restore transactions from the blockchain in
the order they were committed to the blockchain (oblivious to any blink
transactions as this is not stored by the blockchain, only those who
see it in the mempool at the time it is relayed would optimistically
save it to their transfers container).
This leads to importing key images breaking as the two wallets expect
_slightly_ different key images at different indexes in their respective
transfer container.
The fix here is to sort all transfers again once we confirm the blink,
placing the transfer into the correct slot in the container. This sort
only occurs within the latest block (as blinks are only relevant at
the tip of the chain) so resorting occurs typically with 1 blocks worth
of transactions for the wallet and so will always be quick and not
expensive.
You can reproduce this bug by checking out the tag v8.1.1
1. Wallet A sends to Wallet B transfer_1 without blink `transfer unimportant WalletB <amount>`
2. Wallet A sends to Wallet B transfer_2 _before_ transfer_1 gets mined into a block `transfer blink WalletB <amount>`
3. Wallet B must receive the Blink and be refreshed _before_ the next block gets mined to commit it to Wallet B's cache.
4. Wait for the next block to get mined and refresh to accept the block
- Wallet B now has instantly confirmed transfer_2 the Blink into the transfer
container at index 0.
- Wallet B confirms the slow transfer transfer_1 and saves it into transfer
container at index 1.
Since the network received transfer_1 first in the mempool, it will get
included in the block first with the Blink second. Now Wallet B's
transfers are out of sync with what is visible on the network.
5. export_key_images and import it into a view only wallet based on Wallet B.
6. import_key_images will fail due to the blockchain/wallet cache mismatch.
- 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.
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.
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.
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.
- 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).
- 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.
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.
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`.
- 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