summaryrefslogtreecommitdiff
path: root/crates/arti-rpcserver/src/objmap.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.
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-121-4/+4
| | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* rpc: Propagate and use LookupErrors.Nick Mathewson2026-04-131-9/+37
|
* rpc: Adjust invoke_rpc_method API and related lookups.Nick Mathewson2026-04-131-11/+5
| | | | | | | | | | | | The important thing here is that we need to look up the object _after_ we invoke any non-dispatched methods, since the object might be an expired weak reference. This required some related changes to tests and error types. Additionally, it required us to change the return value of Context::remove, since we can remove objects that are not completely present.
* rpc: Restore some weak-reference tests; remove others.Nick Mathewson2026-04-131-199/+9
| | | | | The removed tests are ones that no longer make sense given our simplified behavior.
* rpc: allow weak references to be created.Nick Mathewson2026-04-131-9/+39
|
* rpc: rename strong_arena to arena.Nick Mathewson2026-04-131-7/+6
|
* rpc: collapse GenIdx enum to its single variant.Nick Mathewson2026-04-131-28/+9
|
* rpc: Remove notion of separate table/idx space for weak referencesNick Mathewson2026-04-131-164/+32
| | | | | | | | | We no longer plan to have all weak-refs automatically de-duplicated, for reasons discussed at #868. This lets us discard a lot of code, including code to check for Arc/weak identity. I've disabled some unit tests here, but I'll add them back or rewrite them (or discard them as irrelevant) by the end of the branch.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-3/+3
| | | | - The Rng::gen() functions have been renamed to Rng::random().
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* arti-rpcserver: Fix operator precedence warning.Gabriela Moldovan2025-02-241-1/+1
| | | | | This fixes an "operator precedence can trip the unwary" warning that showed up after I updated my toolchain to 1.85.
* Merge branch 'rpc-references-cleanup' into 'main'Nick Mathewson2025-01-281-152/+59
|\ | | | | | | | | rpc: Move support for weak references behind an experimental feature See merge request tpo/core/arti!2742
| * rpc: Move support for weak references behind an experimental featureNick Mathewson2025-01-271-152/+59
| | | | | | | | | | We haven't decided how these should work (see #868), so having them present by default is a bad idea.
* | rpc: Clean up comments surrounding strong referencesNick Mathewson2025-01-271-1/+8
|/ | | | They used to be deduplicated, but they haven't been for a while.
* rpcserver: remove dead code exception in objmap.rsNick Mathewson2025-01-221-3/+1
|
* rpc: Move some object-id-manipulation methods to a new module.Nick Mathewson2024-10-231-0/+2
| | | | | These will have different implementations soon; this is a more logical place for them.
* rpcserver: Use slotmap-careful instead of generational-arena.Nick Mathewson2024-08-141-28/+29
| | | | | | | | | Unlike generational-arena, slotmap is maintained. Unlike slotmap, slotmap-careful should never be able to reuse the same key for two different objects. Closes #1282.
* Port many of the macros in tor-rpcbase to use derive-deftly.Nick Mathewson2024-04-041-4/+7
| | | | | | This simplifies our implementation logic in a few places, and simplifies our invocation syntax greatly. There are a few infelicities, noted in `TODO RPC` comments.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* clippy: Use Result::cloned in several placesIan Jackson2024-01-311-1/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* rpc: make decl_object! responsible for writing impl Object {} blocks.Nick Mathewson2023-06-071-2/+0
|
* rpc: Slightly refactor GenIdx encoding.Nick Mathewson2023-06-051-15/+25
|
* Merge branch 'rpc-auth-and-meta' into 'main'Nick Mathewson2023-05-241-5/+11
|\ | | | | | | | | rpc: authentication and basic handle manipulation See merge request tpo/core/arti!1200
| * rpc: Implement functionality to remove objects from a sessionNick Mathewson2023-05-241-5/+11
| | | | | | | | | | | | | | | | | | | | | | I've made doing some design choices here: * Reserving "rpc" as a prefix for post-authentication functionality that is not arti-specific. * Declaring these to be methods on the session rather than methods on the objects themselves. There's a problem with defining an API to drop a weak reference; see comment in code.
* | rpc: Remove fake_generational_arenaNick Mathewson2023-05-231-76/+1
|/ | | | | | | Now that generation-arena has merged [@diziet's patch] to clarify their license, we no longer need to disable it. [@diziet's patch]: https://github.com/fitzgen/generational-arena/pull/56
* rpc: Split the generational index into two.Nick Mathewson2023-05-161-113/+92
| | | | This lets us simplify our logic a bit for strong references.
* rpc: Change the formatting of object IDsNick Mathewson2023-05-151-22/+71
| | | | | | | | | | | | | | | | | | We want each ID to have a unique form every time it is given out, so that you can't use ID==ID to check whether Object==Object. (See discussions leading to #848.) We'd also like the form of object IDs to be a little annoying to analyze, to discourage people from writing programs that depends on their particular format. (We are reserving the right to change the format whenever we want.) We _don't_ want to use any cryptography here (yet), lest somebody think that this is an actual security mechanism. (This isn't for security; it's for encouraging developers to treat IDs as opaque.) With that in mind, we now lightly obfuscate our generational indices before returning them.
* rpc: rename GenIdx::into/try_from implementationsNick Mathewson2023-05-151-8/+6
| | | | | These are about to become nondeterministic-ish and probably shouldn't use the Into/TryFrom traits.
* rpc: do not deduplicate strong object idsNick Mathewson2023-05-151-52/+39
| | | | | | | | Per discussion referenced at #848, we want each operation that returns a strong object ID to return a new, distinct strong ID. Note that we no longer need to put strong and weak references in the same arena; we can clean this code up a lot down the road.
* rpc: Repair an error in our ObjectId encoding.Nick Mathewson2023-05-151-1/+1
| | | | | | Now we generate object IDs that we can parse. This is about to be obsolete once we change how we generate objects and their IDs for #848, but we may as well start from a working state.
* objmap: move types to top of file.Nick Mathewson2023-05-041-74/+74
|
* Note/clean more TODOs in objmap.Nick Mathewson2023-05-041-1/+4
|
* RPC: Make "Weak" and "Strong" entries separate.Nick Mathewson2023-05-041-43/+41
| | | | | | | | | Now there can be one of each, since we want references and handles to be conceptually separate. (The alternative would be to say that an operation either "returns a handle" or "returns a reference (which may become a handle) unless a handle already exists.")
* Temporarily replace generational-arena with a fake version.Nick Mathewson2023-05-041-1/+77
| | | | | This fake version is completely silly, but it will do the job until we figure out our MPL2 concerns.
* Add a generational arena for object mapping for RPC.Nick Mathewson2023-05-041-0/+663
See the comments on `TypedAddr` for some explanations about why this is so tricky. Thanks to @diziet for helping me figure this out.