| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | |
| | |
| | |
| | | |
Nothing uses this yet.
|
| | | |
| | |
| | |
| | |
| | | |
We'll use Qty for printing amounts of memory, and .take() for
convenience in a lot of places.
|
| | | |
| | |
| | |
| | | |
Establish the principal in-crate namespace.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
While writing the actual code, the distinction between Participation
and `dyn Participant` and Participant (the abstract concept) was a bit
confusing. Rename the trait, and clarify things a little.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Use semantic newlines, not hugely long one-line paragraphs.
(I think this file must originally have been a pad or a gitlab comment.)
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Put it just above tor-rpcbase, which maybe it would want to use for
metrics export via RPC?
For now we have some dead code `#[allow]`s.
|
| |/ / |
|
| |\ \
| |/
|/|
| |
| |
| |
| | |
Port from config-rs to figment (v2)
Closes #1267 and #1268
See merge request tpo/core/arti!2041
|
| | |
| |
| |
| |
| |
| |
| | |
The new (dubiously named) `Figment::extract_lossy` method
can treat decode numbers from strings, and booleans from numbers or
strings. This makes the behavior compatible with config-rs, and
should (I hope) finally allow us to migrate.
|
| | |
| |
| |
| |
| | |
Figment can give an error under more conditions than just a parsing
failure, so we should report it a bit more vaguely.
|
| | | |
|
| |/
|
|
|
| |
There are probably ways to make this a bit more elegant, but at
least the tests still pass.
|
| |\
| |
| |
| |
| |
| |
| | |
RPC: Even more cleanup on invocable functions.
Closes #838
See merge request tpo/core/arti!2084
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now that we've done more refactoring, it's no longer necessary to
have this machinery, since:
* We can support statically registering instantiated methods, if we
know them ahead of time.
* Writing an installer function is pretty simple, and the syntax
is much nicer than the special-purpose junk we had before.
I've added examples of both approaches.
While we're at it, I've simplified the syntax for `invoker_ent!` a
little, since the parentheses I had before aren't necessary.
|
| | |
| |
| |
| |
| | |
These are no longer needed, since they are inferred from the types
of the functions.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
The trick here is to provide an `Invoker` trait,
with blanket implementations for appropriate `fn(_,_,_,_?) -> _`.
With this trick, we no longer need to have a `decl_rpc_invoke_fn`.
This lets us discard HasConstTypeId entirely,
and will let us simplify some other syntax moving forward.
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | | |
tor-guardmgr: Persist the vanguard sets if running in full vanguard mode
Closes #1273
See merge request tpo/core/arti!2090
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The VanguardMgr now unconditionally flushes the vanguard sets to disk
each time there's a consensus change, and every time a vanguard
expires.
Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2090#note_3021013
|
| | | | |
|
| | | |
| | |
| | |
| | | |
Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2090#note_3021016
|
| | | |
| | |
| | |
| | |
| | | |
Our log messages begin with an uppercase letter in the rest of the code
base.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | | |
This will be useful for testing.
|
| | | |
| | |
| | |
| | | |
The referenced types are no longer available in `vanguards.rs`.
|
| | | | |
|
| | | |
| | |
| | |
| | | |
We will soon use this to test full vanguards.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
This doesn't need to be `pub(super)` anymore, `VanguardMgr` now
manipulates the `VanguardSets` exclusively through
`VanguardSetsTrackedMut`.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
The `VanguardMgr` reads the vanguards from the vanguards state file,
whether full vanguards are enabled or not. It only persists the vanguard
sets to storage if full vanguards are in use.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Since `rotate_expired()` (previously `remove_expired()`) now also
replenishes the vanguard sets, we can't use `advance_until_stalled()`
anymore, because `run_once()` is never be stalled in the tests
(`next_to_expire` is never `None`, so `sleep_fut` is never
`future::pending()`:
```
warning: MockRuntime advance_* looped >1000 (next sleep: 877560507ms)
```
Previously, `next_to_expire` was computed *before* replenishing the
vanguard sets, which is why the tests could use
`advance_until_stalled()`.
|
| | | |
| | |
| | |
| | |
| | | |
This addresses a TODO about not calling `handle_netdir_update`
unconditionally each time `VanguardMgr::run_once()` runs.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
A lot of this is code motion: the code added to `VanguardSetsTrackedMut`
was copied from the `VanguardMgr` impl, so I recommend reviewing this
with `git diff --color-moved=zebra`.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This enables us to track when `VanguardMgr`'s `VanguardSets` is
*actually* mutated.
This will soon be useful because we only want to flush the
`VanguardSets` to storage if we actually added or removed some relays
from the set.
|
| | | |
| | |
| | |
| | |
| | | |
These will be useful later, when we place the `l2_vanguards` and
`l3_vanguards` from `VanguardMgr` with a `VanguardSets`.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
changed.
The two removal functions now return whether any values were removed
from the `VanguardSet`. Their return values are currently ignored, but
will soon be used for deciding whether to flush the `VanguardSet`s to
disk (if full vanguards are enabled).
|
| | | | |
|