Governance reward calculations were hard-coded for == HF17 rather than
>= 17, so for HF18 it was falling back to the old "add up all the
values" method that we used to use. Updated it to support HF18, and add
a static_assert that will fail to compile (without a fix) when we add
HF19.
Also some minor cleanups (mostly indent changes for unnecessary blocks
-- ignore whitespace when looking at the diff).
m_nettype won't be set properly during construction so we can't call
get_net_config() in the constructor arguments here; set a reasonable
value and then update during actual initialization instead.
This makes uptime proof times network-dependent, and tweaks them a bit.
Also converts the times to type-safe std::chrono types rather than
macros.
Mainnet/testnet/devnet:
- Send the first proof 30s after startup rather than waiting 2 minutes.
- Check for whether we need to send a proof every 30s rather than every
5mins.
Mainnet:
Other times unchanged.
Testnet/devnet:
- Send proofs every 10min instead of 1h, and consider nodes to be down
after 21m instead of 2h5m.
Fakechain:
- Send 5s after startup, check every 5s, and send every 1min.
- Expiry after 2min5s
Also remove the cmake debug option for short proofs since the fakechain
changes above basically incorporate what it did.
The coinbase tx sum rpc call had an off-by-one error that made it
double-count a block the first time it was reloaded at any height. This
caused the deviation of oxen.observer and lokiblocks.com emissions
counts (because one is being called more frequently than the other), and
caused *both* to grow too quickly over time.
Network validation expects N outputs when there are N contributors, but
if any of the received contribution amounts was 0 we were skipping it,
leading to a block that failed validation.
This happened at blocks 739994 and 740010 when recently registered SNs
*with* a contributor reached the top of the reward list with a 100% fee;
this caused the second SN reward recipient amount to be 0, which then
got left off the block and then failed block validation.
This doesn't require a hard fork to fix -- it just requires block
producers to update to start including the 0 payout in such cases which
makes the network happy with the block.
(This may result in some stalls when we hit those SNs again, but as long
as enough of the network has upgraded we should unstall when an upgraded
node gets randomly selected to produce a backup block).
If `main` throws an exception before the log system is initialized then
the error message just got lost; this fixes it to print to stderr if
that happens.
Trezor support currently doesn't work (Trezor's hardware wallet is
hard-coded for a Monero net-id), and this saves needing to muck around
with protobuf.