Commit Graph

65 Commits

Author SHA1 Message Date
Jim McDonald d7efbd856b
Sync committee slot offset.
Ensure that sync committee messages are created for the slots of the
sync period, rather than in the slots of the sync period.
2021-08-02 19:53:57 +01:00
Jim McDonald 2a17229b39
Tidy ups for sync committee scheduling. 2021-08-02 19:53:56 +01:00
Jim McDonald 7bdcb4be2b
Update tests. 2021-08-02 19:53:56 +01:00
Jim McDonald 34d6df9312
Work for Altair. 2021-08-02 19:53:47 +01:00
Jim McDonald 01fb65a1ed
Decrypt local accounts in parallel.
This changes the wallet account manager to decrypt accounts in parallel,
to reduce the time taken to update accounts on startup and refresh.
2021-08-02 19:25:38 +01:00
Jim McDonald 3e1b529ec5
Add advanced scheduler.
The basic scheduler has shown weakness when handling high load, which
manifests with the occasional deadlock situation.  This introduces an
advanced scheduler, which contains additional features in an attempt to
ensure that regardless of the concurrent load no job is ever left in an
inconsistent state, explicitly with outstanding items to read on its
channels.
2021-07-27 16:28:50 +01:00
Jim McDonald fa7e37fee7
Wait for waitgroup to complete. 2021-07-23 23:18:25 +01:00
Jim McDonald c10f060848
Use process-concurrency for Dirk accountmanager.
The Dirk accountmanager was using a local scatter/gather concurrency
method to obtain wallets, however this uses the parallelism of the Vouch
server rather than the Dirk server.  This chnages the Dirk
accountmanager to use a configuration value to select the concurrency
level.

This also standardizes the use of process concurency to allow for
hierarchical definition of the value.
2021-07-22 22:35:09 +01:00
Jim McDonald 700d1a19d9
Merge pull request #21 from attestantio/linting
Linting.
2021-07-19 12:22:18 +01:00
Jim McDonald 919a519b32
Linting.
Fix lint warnings given by revive (successor to golint).
2021-07-18 07:46:01 +01:00
Jim McDonald 41afb240c2
Remove spec import alias.
Specification imports for phase0 were aliased as 'spec'.  Due to the
mechanism decided upon to manage structs that vary beteween hard forks
this is no longer useful, so this removes the alias in preparation for
the Altair hard fork.
2021-07-18 07:34:43 +01:00
Jim McDonald 4598f9f639
Merge pull request #19 from attestantio/mixed-accounts
Separate accounts before batch signing.
2021-06-27 12:36:29 +01:00
Jim McDonald b1f9b940f7
Separate accounts before batch signing.
Accounts and distributed accounts were bundled up together for signing.
This was non-optimal, as they have different requirements (single shot
Vs. distributed threshold).  This separates them in to two groups, and
signs them as separate sets of requests.
2021-06-26 14:40:10 +01:00
Jim McDonald d175f068ff
Fetch remote wallet information in parallel
If a Vouch instance has many wallets it can be slow to start up, as
wallet information is fetched in sequence.  This changes the methodology
to fetch wallets to be parallel, allowing for faster startup times even
when there are many wallets in use.
2021-06-26 14:33:18 +01:00
Jim McDonald b825ba40b7
Add metrics to track strategy operations. 2021-05-19 15:29:23 +01:00
Jim McDonald dc0847acfd
Rework conditions for reorgs.
Avoid refetching attestation and proposal duties when not necessary in
the situation where a block for slot 0 of the epoch is not presented.
2021-05-04 10:51:25 +01:00
Jim McDonald c377442e24
Do not overwrite validator list with null.
If Vouch contains a list of validators, and on refresh obtains an empty
list, assume the empty response is a result of an error and do not
remove the existing list in favor of it.

It is possible for network issues to result in an empty response when
requesting an update on the list of validators for which Vouch should
operate.  In this situation, where Vouch already has a list of
validators, it retains that list rather than replace it with the empty
results of the request.

(cherry picked from commit 52c58216cb)
2021-03-06 00:27:50 +00:00
Jim McDonald 88a8c2978b
Tidy-ups. 2021-03-06 00:23:34 +00:00
Jim McDonald 5950f8f562
Address crash when proposing block.
If a validator is due to propose a block but cannot obtain the RANDO
reveal it causes Vouch to crash.  This change checks for an empty RANDAO
reveal and exits early from the block proposal process on such a
condition.

Fixes #15.

(cherry picked from commit fb2d95e97b)
2021-03-06 00:17:31 +00:00
Jim McDonald 3b6e160fb8
Provide flag to enable chain reorganisations. 2021-02-24 22:05:11 +00:00
Jim McDonald f56fa48655
Add `vouch_ready` and `vouch_release` metrics.
`vouch_ready` is a prometheus metric that is `0` if Vouch is not yet
ready to validate, and `1` if it is.

`vouch_release` has a labeled value `version` that contains the release
version of Vouch.
2021-02-01 19:27:06 +00:00
Jim McDonald 05e5464948
Reduce log message 2021-02-01 16:11:13 +00:00
Jim McDonald 443ca18d4e
Handle chain reorganisations.
When a chain reorganisation occurs it is possible that this impacts
Vouch's attestations and proposals for the current and next epoch.  This
patch listens to the Ethereum 2 events stream for reorganisation
notifications.  If it finds one it cancels existing and creates new
duties, as required.
2021-01-31 13:49:15 +00:00
Gary Rowe 648e506413
Merge pull request #11 from attestantio/remove-lock
Remove unused lock.
2020-12-31 10:09:14 +00:00
Jim McDonald 4e2aaf6c5c
Add `controller.max-attestation-delay`
This option allows users to control the maximum amount of time that
Vouch will wait for a block to arrive before starting its attestation
process.  Note that this is a spec value, so changes can have a highly
detrimental impact on Vouch's behaviour.
2020-12-30 23:12:05 +00:00
Jim McDonald a17f71a90d
Update mocks.
Create mocks for services that do not have them.
Update eth2client mock with more mocks.
2020-12-30 22:07:47 +00:00
Jim McDonald 67f7078828
Remove unused lock.
This removes a mutex lock followed by an unlock that has no code
inbetween.  This was a remnant from when job management was handled
within the control function, and is no longer required.
2020-12-30 16:56:06 +00:00
Jim McDonald 052bc332d4
Add `epoch_slot` to block receipt delay.
This adds a label `epoch_slot` to the prometheus metric
`vouch_block_receipt_delay_seconds`.  It has been noted that the receipt
delay is often significantly higher for the first (and, to a lesser
extent, second) slot in a given epoch.  This allows the receipt delay to
be examined for specific slots in a given epoch.
2020-12-26 17:28:01 +00:00
Jim McDonald fcab5aa757
Add aggregate attestation strategy.
The "best" aggregate attestation strategy obtains aggregate attestations
from all listed nodes, scores them according to their attestation
coverage, and signs and broadcasts the one with the highest coverage.

The "first" aggregate attestation strategy signs and broadcasts the
first aggregate attestation returned from all listed nodes.
2020-12-24 08:53:54 +00:00
Jim McDonald ad1495bae6
Fix 'vouch_attestation_process_duration_seconds'.
This metric used to count the number of internal attestation processes
carried out, however a single attestation process can involve multiple
validators if they are attesting in the same slot and committee.  This
fix ensures that the metrics reflect the number of attestations, not the
number of processes.
2020-12-16 14:05:11 +00:00
Jim McDonald 4071dabf9e
Re-implement accountmanager metrics.
This reintroduces prometheus metrics for the account manager module.
The metrics track the validating state of each account, and are found
under the `vouch_accountmanager_accounts_total` metric.  The metrics are
differentiated using the `state` label.
2020-12-16 13:46:00 +00:00
Jim McDonald aed5402fbb
Tidy ups 2020-11-27 15:26:22 +00:00
Jim McDonald 925e69fb9a
Update dependencies 2020-11-26 20:32:04 +00:00
Jim McDonald 5b9f103612
Tweak timings 2020-11-26 02:37:22 +00:00
Jim McDonald fd48090007
Separate accountmanager. 2020-11-25 00:02:13 +00:00
Jim McDonald b53a039da9
Clean up submitter messages. 2020-11-24 22:58:32 +00:00
Jim McDonald 08ea6e8f2c
Implement multisigner for wallet 2020-11-18 10:01:57 +00:00
Jim McDonald faa23bfaa8
Tidy-ups 2020-11-17 12:07:24 +00:00
Jim McDonald 4cb1527b87
Merge branch 'multisign' 2020-11-15 07:29:19 +00:00
Jim McDonald 981bdcbfa5
Re-enable prysm aggregation 2020-11-14 23:44:22 +00:00
Jim McDonald 9087add881
Merge branch 'proposal-slot-scaling' 2020-11-14 12:26:53 +00:00
Jim McDonald 4e5fbf18ba
Initial work on support of standard API 2020-11-14 08:36:49 +00:00
Jim McDonald 796cb6348f
Initial move to go-eth2-client 2020-10-28 15:09:51 +00:00
Jim McDonald 27d079f584
Use multisign for attestations 2020-10-26 14:31:24 +00:00
Jim McDonald c21866491a
Tidy up trace logging for scheduler. 2020-10-21 19:16:11 +01:00
Jim McDonald c6adf2c7e5
Exit attest/aggregate routine on attestation failure. 2020-10-20 07:22:41 +01:00
Jim McDonald fd5540086f
Error appropriately when misconfigured. 2020-10-17 21:50:50 +01:00
Jim McDonald 6845a0ac08
Avoid crash if beacon committee subscription information is not present.
Fixes #1
2020-10-13 12:40:18 +01:00
Jim McDonald 469e6a02a3
Add measurement of validator status fetching operations 2020-10-09 16:07:42 +01:00
Jim McDonald 7196a90d29
Increase block receipt delay metric to record up to 12s 2020-10-06 09:14:44 +01:00