68 Commits

Author SHA1 Message Date
jholdstock
c9e5155512 [release-v1.3] Release version 1.3.2 2025-11-30 22:16:01 -08:00
jholdstock
abeb1da0ce [release-v1.3] Release version 1.3.1 2025-11-30 22:15:56 -08:00
jholdstock
d190a83b6f Release version 1.4.0 2025-11-27 09:35:27 +00:00
jholdstock
1d2340d61c Update Decred dependencies for 2.1.0 2025-11-26 11:39:57 +00:00
jholdstock
2edf4eb200 config: Use any instead of interface{} 2025-11-26 11:39:57 +00:00
jholdstock
0d7b33d9bd multi: Use go 1.22 language features. 2025-02-28 09:04:56 +00:00
jholdstock
cba9b0368b Bump minimum go version 1.22 2025-02-28 09:04:56 +00:00
jholdstock
ca8d67e34a webapi: Distinguish between current/old xpub
Showing current and old pubkeys under separate headers makes the
information easier to parse, and also fixes a bug where the current
pubkey was showing a retired timestamp of unix epoch.
2024-11-02 08:26:04 +00:00
jholdstock
b6ffde116a webapi: Remove duplicate code to render admin.html 2024-11-02 08:26:04 +00:00
Jamie Holdstock
363fdcb224
Minor GUI improvements and bugfixes.
Also included is an upgrade from bootstrap 4.5 to 4.6.2. Nothing major changes
in the new version, just some improved compatibility/consistency between
browsers.

- Fixed an issue where long pages (such as ticket search result) would allow the
viewer to scroll beyond the footer.
- Fixed footer stretching to full widescreen size rather than staying inside
  bounds of bootstrap container
- More consistent style for inputs (password prompt, ticket search input)
2024-11-02 08:19:01 +00:00
jholdstock
b0fb5469c0 webapi: Footer update time relative not absolute.
Using a relative time rather than absolute requires far less effort for
a reader to understand, e.g. compare "25 Oct 2024 11:12:49 UTC" to "3
minutes ago".

As a nice side-effect this also fixes a minor privacy issue where using
the full absolute timestamp would expose the server timezone to the
public.
2024-10-26 09:26:44 +01:00
jholdstock
906ffc9e88 multi: Consider DCP0012 in VSP fee calculations.
Upgrade the dcrwallet dependency to pick up the new version of
txrules.StakePoolTicketFee which considers the status of DCP0012 in its
fee calculation.
2024-06-30 09:22:21 +01:00
jholdstock
c23095444f webapi: Add xpub ID to ticket details page. 2024-06-27 09:20:32 +01:00
jholdstock
844d2ce1ba webapi: List xpubs on admin page.
A new tab is added to the admin page to display current and historic
xpub keys used by vspd.
2024-06-27 09:20:32 +01:00
jholdstock
4e4121335a database: Store xpub keys in a bucket.
**Warning: This commit contains a database upgrade.**

In order to add future support for retiring xpub keys, the database is
upgraded such that the keys are now stored in a dedicated bucket which
can hold multiple values rather than storing a single key as individual
values in the root bucket.

A new ID field is added to distinguish between keys. This ID is added to
every ticket record in the database in order to track which pubkey was
used for each ticket.

A new field named "Retired" has also been added to pubkeys. It is a unix
timestamp representing the moment the key was retired, or zero for the
currently active key.
2024-06-27 09:20:32 +01:00
jholdstock
4e5fec8f3b vspadmin: Write default config file.
A new command in vspadmin writes the default config file for a new vspd
deployment. The behaviour is removed from vspd and documentation has
been updated to reflect the change.
2024-06-19 09:35:41 +01:00
jholdstock
997205ed95 vspadmin: New binary to create empty databases.
vspadmin is a new binary which implements one-off admin tasks which are
necessarily interactive and thus do not fit neatly into the long-lived
vspd binary.

The first behaviour added to vspadmin is the ability to create a new
vspd database. This behaviour is removed from vspd with the associated
config option deprecated. Documentation and scripts updated to reflect
the change.
2024-06-19 09:35:41 +01:00
Jamie Holdstock
0633260a3c
database: Combine xpub and index concepts.
Fee xpub key and last used address index are now wrapped into a struct,
with both fields being set and retrieved together rather than
individually.

The underlying format for storing these values in the database does not
change. The only change is the interface between the database code and
the caller.
2024-06-11 11:26:12 +01:00
jholdstock
1a2b02466c vspd: Wrap RPC connection details in a struct.
Returning a single struct which contains multiple named fields reduces
the chance of a mistake in the calling code, as compared to returning
multiple unnamed values which are all of the same type.
2024-05-30 08:41:10 +01:00
jholdstock
086143fed2 vspd: Move config to internal package.
This enables the config to be reused in multiple binaries - eg. the
upcoming vsp admin binary which will be responsible for writing a
default config file for new vspd deployments.
2024-05-30 08:41:10 +01:00
jholdstock
ba5b1b2990 types: Remove Revoked from VSP info response.
This was marked as deprecated in the previous release and is now being
removed.
2024-05-29 11:02:50 +01:00
jholdstock
ecf2baa193 Begin module dev cycles.
Upcoming changes constitute breaking public API changes to both the
client and types modules, therefore this bumps the version numbers of
both modules and adds local replacements to go.mod files such that the
new versions can be used before they are publicly tagged.
2024-05-29 11:02:50 +01:00
jholdstock
64ad28e19b database: Remove log param from CreateNew.
This logger did not write any useful information and all errors
generated by the func are already returned to the caller for logging.
2024-05-23 08:39:24 +01:00
jholdstock
2bd340ba08 multi: Explicitly handle help requests.
Checking for --help as an explicit step before parsing any other configs
makes the code more intuitive by removing a convoluted bit of error
handling, which happened to be unnecessarily duplicated in three places.

Moving it to a function in the internal package makes it reusable by
multiple binaries.

This also enables the IgnoreUnknown option to be used whilst parsing for
help, which ensures the presence of --help will always result in the
help message being printed. This fixes a minor inconsistency where the
help message would be printed if the flag was placed before an invalid
config, but placing it after would cause an invalid config error to be
written instead. For example, `vspd --help --fakeflag` vs `vspd
--fakeflag --help`.
2024-05-18 08:42:06 +01:00
jholdstock
ea6f5e8d7e config: Introduce NetworkFromName.
This moves the mapping logic to a more obvious home and enables it to be
reused later.
2024-05-16 08:23:24 +01:00
jholdstock
92a0eb7d4a webapi: Remove unnecessary err check.
err has already been checked and is known to be nil at this point.
2024-05-16 08:22:36 +01:00
jholdstock
0245d0f7c8 webapi: Update year to 2024 2024-01-12 08:51:54 +00:00
jholdstock
1e66b6ff59 Downgrade dcrwallet dep to v3.
This downgrade changes StakePoolTicketFee back to the version which does
not consider DCP-0012 activation.

This resolves an issue where Decrediton sometimes fails to pay VSP fees,
caused by Decrediton and vspd independently calculating the fee amount
using different versions of the algorithm.

Releasing the new algorithm will need to be more carefully coordinated,
potentially requiring both client and server sides to be updated in
sync.
2023-11-08 09:01:36 +00:00
jholdstock
34cd9d2892 webapi: Wait for unknown outputs to propagate.
If broadcasting parent transaction of a ticket fails because it
references unknown outputs, there is a good chance that waiting a few
seconds will resolve the issue because the ancestor transactions will
propagate through the network and reach the mempool of the local dcrd
instance.
2023-11-08 08:52:52 +00:00
jholdstock
9ee95f98ab version: Bump to 1.4.0-pre 2023-09-29 09:20:53 +01:00
Jamie Holdstock
a254e943f7
webapi: Add missed tickets to admin page.
A new tab on the admin page displays a list of all tickets which were
registered with the VSP but missed their votes. Clicking on the ticket
hash redirects to the Ticket Search tab with the details of the missed
ticket displayed.
2023-09-26 17:18:32 +01:00
jholdstock
4012b098fe vspd: Improve comment for update func.
A good comment explains what a function does, not when it is called.
2023-09-26 10:21:38 +01:00
jholdstock
f8bd606468 multi: Use const where possible. 2023-09-26 10:21:38 +01:00
jholdstock
e9cd529de5 webapi: Don't add extra context to dcrd errors.
The error returned by dcrd.Client() is already very descriptive and does
not need extra context.
2023-09-26 10:21:38 +01:00
jholdstock
a0d9cbf6b3 webapi: Remove deprecated css.
The overlay setting for overflow has been deprecated for quite some
time, and these days doesn't work on most browsers.
2023-09-26 10:21:38 +01:00
jholdstock
ed82998fe2 webapi: Only log "ticket added to wallet" once. 2023-09-20 09:21:33 +01:00
jholdstock
fde844e2e1 vspd: Make log format consistent.
Every log line which includes a ticket hash includes it in the end at in
brackets, not inline with the message.
2023-09-20 09:21:33 +01:00
jholdstock
f5b57f4169 vspd: Increase some logs to info level. 2023-09-20 09:21:33 +01:00
jholdstock
1f62d46bdd vspd: Reduce some logs to debug level. 2023-09-20 09:21:33 +01:00
jholdstock
2994d128fe vspd: Remove funcName from info/debug logs.
Including the funcName in informational log messages is not useful for
devs or admins, its just spam which bloats the log file.
2023-09-20 09:21:33 +01:00
jholdstock
12e61bab65 vspd: Remove unnecessary dcrd error logging.
The error returned by dcrd.Client() is already very descriptive and does
not need extra context.
2023-09-20 09:21:33 +01:00
jholdstock
c4de3d5d95 vspd: Pass dcrd RPC to findSpentTickets as a param
This allows RPC clients to be reused more easily in the case that the
caller of findSpentTickets already has a connected dcrd RPC client.
2023-09-19 18:01:43 +01:00
jholdstock
61c9c7087f vspd: Split update function.
The update function performs four distinct steps which can readily be
broken down into four separate functions.
2023-09-19 18:01:43 +01:00
jholdstock
01e88f39c6 vspd: Split vspd.go into smaller files.
This splits the code from vspd.go into various other files which broadly
represent the functional areas of vspd - the main update function,
database intgrity checks and voting wallet consistency checks.

Code is just moved without any modifications.
2023-09-19 18:01:43 +01:00
jholdstock
69b27ff1e6 vspd: Rename blockConnected to update.
The name blockConnected is not very accurate as this function is also
called when vspd is initializing. It doesnt depend on a block having
been connected at all, it can be called at any time.
2023-09-19 18:01:43 +01:00
jholdstock
841ac77890 webapi: Make debug warning banner more distinct.
Give the debug banner a unique look by changing its class to "danger",
and centering and bolding the text. This helps it to be more noticable
when displayed near other banners.
2023-09-19 18:00:05 +01:00
jholdstock
c7ebe28501 webapi: Try cache update before returning error.
Rather than immediately returning an error if the cache is not
initialized, attempt to initialize it first. Without this change there
is only an attempt to initialize the cache once per minute.
2023-09-19 17:58:59 +01:00
jholdstock
99dc97d6a3 webapi: Abort requests if web cache not ready.
A new middleware aborts any requests which require the data cache if the
cache is not yet initialized. An explicit error is returned so the admin
will be immediately aware what has gone wrong.

Previously, webpages were rendered and JSON responses were sent with
zero values, and with no indication of anything being wrong. This was
sometimes difficult to notice, and even when noticed the cause was not
immediately apparent.
2023-09-19 17:58:59 +01:00
jholdstock
935dcaece2 multi: Move signal to internal package. 2023-09-19 08:33:42 +01:00
jholdstock
b8cc99e4b6 webapi: Update netParams name in template.
netParams was renamed to Network in a prior commit, but this instance
was not updated.
2023-09-18 09:10:45 +01:00