aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-hsservice/src/ipt_set.rs
Commit message (Collapse)AuthorAgeFilesLines
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | 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.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | 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.
* tor-rtcompat: Rename BlockOn to ToplevelBlockOnIan Jackson2025-03-041-1/+1
| | | | | | | | | | 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..)
* Upgrade to derive_more 2Nick Mathewson2025-02-261-4/+8
| | | | | This took a little refactoring, since derive_more::Foo no longer re-exports std::ops::Foo.
* Introduce mpsc_channel_no_memquota and use it in the places it's wantedIan Jackson2024-10-151-1/+3
| | | | | These are the call sites where using this fucntion is correct. (Outside tor-rtmock, which we'll do separately.)
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Fix typos in doc commentsTobias Stoeckmann2024-03-061-1/+1
|
* tor-hsservice: prelude: Move imports from ipt_set.rsIan Jackson2024-03-051-21/+1
|
* tor-hsservice: Move svc.rs contents into lib.rsIan Jackson2024-03-051-1/+1
|
* tor-hsservice: Hide IptLocalId field, and provide test constructorIan Jackson2024-03-051-1/+1
|
* tor-hsservice: Move publish out of svcIan Jackson2024-03-051-1/+1
|
* tor-hsservice: Use tor_persist::state_dirIan Jackson2024-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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
* tor-hsservice: tests: create_storage_handles: use a real directoryIan Jackson2024-02-011-1/+8
| | | | | | | 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.
* tor-hsservice: storage: Move Arcs into type aliasesIan Jackson2024-02-011-4/+4
| | | | | | | 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.
* tor-hsservice: ipt_set: Make store method take &mut selfIan Jackson2024-02-011-1/+1
| | | | | Only people who can mutate the state ought to be saving it. Otherwise there might be concurrent overwrites.
* Base INTRO_POINT_EXPIRY_SLOP on OVERALL_UPLOAD_TIMEOUT.Nick Mathewson2024-01-251-2/+5
| | | | See discussion at #1210, "question 5".
* Merge branch 'ratelim' into 'main'Nick Mathewson2024-01-111-7/+12
|\ | | | | | | | | tor-hsservice: todos: Use log_ratelim at one call site See merge request tpo/core/arti!1871
| * tor-hsservice: todos: Use log_ratelim at one call siteIan Jackson2024-01-111-7/+12
| |
* | tor-hsservice: todos: Remove a done TODOIan Jackson2024-01-111-1/+0
| | | | | | | | The call to `load` is right there!
* | tor-hsservice: todos: Add another parameter to the ticketIan Jackson2024-01-111-1/+1
|/ | | | This is a MUST ticket.
* Fix typosDimitris Apostolou2024-01-081-1/+1
|
* clippy nightly: Use Poll.is_pending() in two placesIan Jackson2024-01-021-2/+2
| | | | clippy correctly identifies that this is nicer than matches!.
* tor-hsservice: Add TODO about changing a return type in ipt_set.Gabriela Moldovan2023-12-131-0/+5
|
* tor-hsservice: ipt_set: Remove a blocking TODOIan Jackson2023-12-041-1/+0
| | | | This function became non-dead in some earlier commit.
* tor-hsservice: ipt_set: Store publication timesIan Jackson2023-12-041-16/+101
|
* tor-hsservice: ipt_set: Have various methods take a RuntimeIan Jackson2023-12-041-10/+22
| | | | | | | | 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.
* tor-hsservice: ipt_set: Have various methods take a Runtime (pre-fmt)Ian Jackson2023-12-041-3/+12
| | | | Whitespace changes that make the next commit less noisy.
* tor-hsservice: ipt_set: Provide IptManagerView::borrow_for_read()Ian Jackson2023-12-041-2/+10
| | | | | | | 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.
* tor-hsservice: ipt_set: Make ::channel() fallibleIan Jackson2023-12-041-5/+7
| | | | This is going to load the state from disk.
* tor-hsservice: Pass and record storage handlesIan Jackson2023-12-041-3/+25
| | | | | | | | | | | | | | | * 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.
* tor-hsservice: Introduce IptStoreErrorIan Jackson2023-12-041-2/+3
| | | | | | | | | | 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.
* hssvc-ipt-algorithms.md: Move some text to ipt_setIan Jackson2023-11-291-0/+5
| | | | | This is describing the detailed algorithm in compute_iptsetstatus_publish. Move it there (and add an xref).
* tor-hsservice: ipt_set: Fix broken doc linksIan Jackson2023-11-271-3/+3
| | | | | | | | "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.)
* tor-hsservice: ipt_set: Change last_descriptor_expiry_including_slop (fmt)Ian Jackson2023-11-271-2/+6
| | | | Mandatory format degradation.
* tor-hsservice: ipt_set: Change last_descriptor_expiry_including_slopIan Jackson2023-11-271-35/+82
| | | | Prepare for persistence.
* tor-hsservice: ipt_set: Make note_publication_attempt a method on PublishIptSetIan Jackson2023-11-271-6/+8
| | | | | We're going to move the last_descriptor_expiry_including_slop data out of IptSet.
* tor-hsservice: ipt_set: Make PublishIptSet a structIan Jackson2023-11-271-17/+23
| | | | | We're going to add another field here. No functional change, just much churn.
* tor-hsservice: ipt_set: Make initial state in the constructorIan Jackson2023-11-271-2/+3
| | | | | | | | 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.
* tor-hsservice: Remove an unused mut in a testIan Jackson2023-10-311-3/+3
| | | | | | 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.
* tor-hsservice: ipt_set: Docs clarificationsIan Jackson2023-10-041-3/+9
| | | | Apropos a conversation in !1645
* tor-hsservice: Provide IptsPublisherUploadViewIan Jackson2023-10-031-0/+42
|
* tor-hsservice: ipt_set: Add some testsIan Jackson2023-09-181-0/+117
|
* tor-hsservice: ipt_set: note_publication_attempt: fmt bodgeIan Jackson2023-09-181-0/+1
| | | | Defend against rustfmt worsifying this by adding an empty comment.
* tor-hsservice: ipt_set: note_publication_attempt: renameIan Jackson2023-09-181-3/+3
| | | | | | 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.
* tor-hsservice: ipt_set: note_publication_attempt_start: implementIan Jackson2023-09-181-2/+28
| | | | This gains an almost impossible error case.
* tor-hsservice: ipt_set: principal implementationIan Jackson2023-09-181-14/+91
|
* tor-hsservice: ipt_set: make await_update take &mut selfIan Jackson2023-09-181-1/+1
| | | | This is needed since the notification channel will be an mpsc.
* tor-hsservice: Make IptSet be DebugIan Jackson2023-09-181-0/+1
|
* tor-hsservice: ipt_mgr: Explain more about expiry time data flowIan Jackson2023-09-071-0/+3
| | | | | Apropos https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1578#note_2940676