| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
This commit executes maint/add_warning with the just added change to
deny string slices except in tests.
I recommend auditing this by checking out the previous commit followed
by running the script yourself and then verifying that the diff is
identical to this commit.
This commit makes cargo clippy fail. We will add exceptions in the next
commit.
|
| |
|
|
| |
Run maint/add_warning
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, run
```
git grep -l "^edition =" |
xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;'
```
Second, manually verify that all Cargo.toml files have changed,
and nothing else has changed.
Third, run cargo fmt again.
|
| |
|
|
|
|
|
|
|
|
| |
We're going to distinguish top-level runtime entry, from *re*-entry to
an existing executor. It is most convenient to rename this trait
first. Documentation of the distinction will come later.
(We're going to retain the function name `block_on`, but we want the trait
to be more obviously a top-level only thing, though, so we give it a
name that will hopefully avoid it peroulating throughout the codebase..)
|
| |
|
|
|
| |
This took a little refactoring, since derive_more::Foo
no longer re-exports std::ops::Foo.
|
| |
|
|
|
| |
These are the call sites where using this fucntion is correct.
(Outside tor-rtmock, which we'll do separately.)
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We no longer do replay log locking in IptManager::new. Instead, we
rely on the acquire_instance call in OnionService::launch, which ends
up with ipt_mgr getting an InstanceHandle (which contains a lock
guard).
OnionServiceStateMgr is abolished; it existed to deal with the
generics in the tor_persist::StateMgr API. state_dir has no
generics (other than the T being loaded/stored).
Many places (structs and argument lists) now have state_dir types
which embody a path (or a CheckeDir) along with a lock, rather than
separate path+lock+mistrust.
The creation/startup code uses the new calls from state_dir.
Other more minor changes:
- StartupError::StateDirectoryInaccessible contains tor_persist::Error
- test::create_storage_handles_from_state_dir changed and renamed,
from _from_state_mgr.
- replay::PersistFile's (separate) file lock is now fslock_guard's
|
| |
|
|
|
|
|
| |
state_dir doesn't have the in-memory dummy implementation,
so there will have to be a real directory here.
Do that now, as prep.
|
| |
|
|
|
|
|
| |
These are here because that's what you get from the tor_persist
singleton StageMgr API (for type erasure reasons). We're going to
change these to tor_persist::state_dir types and those don't involve
Arcs.
|
| |
|
|
|
| |
Only people who can mutate the state ought to be saving it. Otherwise
there might be concurrent overwrites.
|
| |
|
|
| |
See discussion at #1210, "question 5".
|
| |\
| |
| |
| |
| | |
tor-hsservice: todos: Use log_ratelim at one call site
See merge request tpo/core/arti!1871
|
| | | |
|
| | |
| |
| |
| | |
The call to `load` is right there!
|
| |/
|
|
| |
This is a MUST ticket.
|
| | |
|
| |
|
|
| |
clippy correctly identifies that this is nicer than matches!.
|
| | |
|
| |
|
|
| |
This function became non-dead in some earlier commit.
|
| | |
|
| |
|
|
|
|
|
|
| |
Actually, a SleepProvider.
We will need this for timestamp conversion during loading and saving.
channel() needs it to load. note_publication_attempt needs it for
saving, as does borrow_for_update.
|
| |
|
|
| |
Whitespace changes that make the next commit less noisy.
|
| |
|
|
|
|
|
| |
We're about to make borrow_for_update() take a runtime parameter,
which will be a bit annoying. borrow_for_read() doesn't need one.
Call sites will come on a moment.
|
| |
|
|
| |
This is going to load the state from disk.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Introduce type aliases for the Arc<dyn >. Add Send and Sync bounds.
* Pass the storage manager to ipt_mgr and the per-key handle to ipt_set.
* Store the handles in ipt_mgr::Immutable and IptPublishSet.
* Change the ipt mgr storage key to "hs_ipts_{nickname}". This avoids use
of "_" as a non-separator, and allows the possibility of other
submodules using other storage keys too - and, here, we introduce one.
* Provide a dummy struct for the IPT set state, which is needed to
define the type alias etc. We'll populate that struct later.
|
| |
|
|
|
|
|
|
|
|
| |
If we can't store IPT details, we mustn't publish the corresponding
IPT. But that's not fatal; maybe we can store later. So introduce a
new IptStoreError type, and change the return value from some
functions that are going to be able to fail that way.
This introduces a new TODO HSS: we need the publisher to be able to
retry after such a failure.
|
| |
|
|
|
| |
This is describing the detailed algorithm in
compute_iptsetstatus_publish. Move it there (and add an xref).
|
| |
|
|
|
|
|
|
| |
"tor-hsservice: Make note_publication_attempt a method on
PublishIptSet" broke several of these.
(Rebasing to insert this at the appropriate point causes conflicts, so
I'm leaving it here at the tip.)
|
| |
|
|
| |
Mandatory format degradation.
|
| |
|
|
| |
Prepare for persistence.
|
| |
|
|
|
| |
We're going to move the last_descriptor_expiry_including_slop data out
of IptSet.
|
| |
|
|
|
| |
We're going to add another field here. No functional change, just
much churn.
|
| |
|
|
|
|
|
|
| |
This struct is going to be responsible for loading and storing
some persistent state, so it makes sense for it to handle
initialisation.
This also reduces duplication.
|
| |
|
|
|
|
| |
I think retaining this lint even in tests is probably reasonable.
IptsPublisherView has interior mutability, so with this function
taking one, it won't ever need mut.
|
| |
|
|
| |
Apropos a conversation in !1645
|
| | |
|
| | |
|
| |
|
|
| |
Defend against rustfmt worsifying this by adding an empty comment.
|
| |
|
|
|
|
| |
From ..._start. The old name is confusing when you see a call site,
because the actual time passed isn't the start time, but the call site
looks like it ought to be.
|
| |
|
|
| |
This gains an almost impossible error case.
|
| | |
|
| |
|
|
| |
This is needed since the notification channel will be an mpsc.
|
| | |
|
| |
|
|
|
| |
Apropos
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1578#note_2940676
|