Commit Graph

2976 Commits

Author SHA1 Message Date
Adrian Duke dac099e4f1 cli/tests: Refactor git command tests 2026-03-11 10:51:57 +00:00
Adrian Duke d39e485c13 cli/tests: Refactor cob command tests 2026-03-11 10:51:57 +00:00
Adrian Duke 1f3dc6aea0 cli/tests: Refactor clone command tests 2026-03-11 10:51:57 +00:00
Fintan Halpenny 7a1e6a2423 cli/tests: Refactor checkout command tests 2026-03-11 10:51:57 +00:00
Lorenz Leutgeb 5aaf978f97 radicle: Configure database connections on open
Configuration of database connections is not performed on `open`, which
leaves room for error (e.g. to miss specifying configuration).

Methods on `Profile` automatically supply the configuration of the
profile.

In testing code, just using the default configuration suffices.
2026-03-09 09:20:42 +00:00
Lorenz Leutgeb f3afe7b02a radicle/config/sqlite: Use `synchronous = NORMAL`
Change the default value for the `synchronous` pragma from `FULL` to
`NORMAL`.

With this change, SQLite will not aggressively `fsync()` after every
transaction, so there is considerably less disk pressure as disk I/O
can be batched.

See <https://sqlite.org/pragma.html>:
> `WAL` mode is safe from corruption with `synchronous=NORMAL`, and
> probably `DELETE` mode is safe too on modern filesystems. `WAL` mode is
> always consistent with `synchronous=NORMAL`, but `WAL` mode does lose
> durability. A transaction committed in `WAL` mode with
> `synchronous=NORMAL` might roll back following a power loss or system
> crash.
> Transactions are durable across application crashes regardless of the
> synchronous setting or journal mode.

Also:
> You lose durability across power lose with synchronous `NORMAL` in `WAL`
> mode, but that is not important for most applications. Transactions
> are still atomic, consistent, and isolated, which are the most
> important characteristics in most use cases.

So, there is no risk of database corruption, and in the extreme
cases of sudden power loss or system crash, some transaction may
roll back.

See also <https://sqlite.org/wal.html>

Co-authored-by: Yorgos Saslis <yorgos.work@proton.me>
2026-03-09 09:20:42 +00:00
Yorgos Saslis f4aee203ab radicle: Make SQLite pragmas configurable
Expose choosing particular SQLite pragmas via configuration.
2026-03-09 09:20:42 +00:00
Yorgos Saslis 6cc3da95e6 radicle/node/db: Model SQLite `synchronous` pragma
The newly introduced enum models the SQLite pragma of the same name.
2026-03-09 09:04:55 +00:00
Yorgos Saslis d36bf41f25 radicle/node/db: Directly represent SQLite pragmas
Instead of introducing our own names and aliases, directly model SQLite
pragmas with the defaults that they also take in SQLite, to avoid
confusion.

Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@radicle.xyz>
2026-03-09 09:04:55 +00:00
Defelo 9ff67562cb cli: Format IPv6 addresses in square brackets 2026-03-05 15:12:24 +00:00
Defelo df8e4e6c88 node: Parse IPv6 addresses in square brackets 2026-03-05 15:12:24 +00:00
Fintan Halpenny 7c92360842 radicle: fix to schemars of DefaultSeedingPolicy
Use `flatten` to remove the extraneous `Scope2` that shows up in the
JSON schema of the Radicle `Config`.
2026-03-05 15:32:44 +01:00
Fintan Halpenny 6291cae592 cli: add `rad config schema` to the `rad-config` test
Adds the `rad config schema` to the `rad-config` test so that changes
to the schema will result in errors, forcing the implementor to ensure
the changes are correct.
2026-03-05 15:32:44 +01:00
Fintan Halpenny f018b434cb node: control debug serialization of FetcherState
Use proxy structs to control the serialized output of `FetcherState`.

These structs convert data inside the `FetcherState` into friendlier
output for the caller of `rad node debug`.
2026-03-05 15:29:42 +01:00
Fintan Halpenny 9ea1ea2433 Revert "node/debug: Use derived serializers"
This reverts commit 5099c25df7.

The `HostName` of the `RateLimiter` could serialize as an invalid JSON
key, resulting in the command panicking.
2026-03-05 15:29:42 +01:00
Defelo e9245b630d cli: don't override existing seeding scope in `rad clone` 2026-02-23 22:34:03 +00:00
Fintan Halpenny b04f487b3a term: Update to 0.17.0 2026-02-20 14:09:35 +00:00
Fintan Halpenny 9a98cf7b16 keccak: Update to 0.1.6
The dependency version 0.1.5 is yanked from crates.io.

Update the dependency to use 0.1.6.
2026-02-20 14:06:01 +00:00
Fintan Halpenny bab3f82abd fetch: Update to 0.17.0 2026-02-20 14:04:16 +00:00
Fintan Halpenny a0b434c320 localtime: add description in Cargo.toml
The description is required for publishing the crate.
2026-02-20 13:48:14 +00:00
Fintan Halpenny 9dba9130f8 core: use "data-types" instead of "data types"
From the reference[^0]:

> Note: crates.io allows a maximum of 5 keywords. Each keyword must be
> ASCII text, have at most 20 characters, start with an alphanumeric
> character, and only contain letters, numbers, _, - or +.

[0]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-keywords-field
2026-02-20 13:38:34 +00:00
Fintan Halpenny f9a36ef7ac systemd: Update to 0.12.0 2026-02-20 13:11:50 +00:00
Fintan Halpenny 18d6ce9477 protocol: Update 0.5.0 2026-02-19 21:06:43 +01:00
Fintan Halpenny c0ae5e32d9 node: Update to 0.17.0 2026-02-19 21:06:43 +01:00
Fintan Halpenny 963b4ded2b crypto: Update to 0.15.0 2026-02-19 21:06:43 +01:00
Fintan Halpenny 84e9ffe4dc cob: Update to 0.18.0 2026-02-19 21:06:43 +01:00
Fintan Halpenny 186d8d30fe cli: Update to 0.18.0 2026-02-19 21:06:43 +01:00
Fintan Halpenny 3a11074600 radicle: Update to 0.21.0 2026-02-19 21:06:43 +01:00
Fintan Halpenny 1566646762 radcile/cob/identity: mark ApplyError as non_exhaustive 2026-02-19 21:06:43 +01:00
Fintan Halpenny d596b14e48 build: Pin Zig to 0.13.0
Control the version of Zig that is being downloaded rather than getting
it via the Alpine Package Keeper.

Version 0.13.0 is chosen so that it can correctly recognise MacOS TBD
v4 which is required due to the introduction of the IOKit in the
bundled `macos-sdk-11.3`.
2026-02-19 21:02:22 +01:00
Fintan Halpenny 4c759a2674 build: Update macos-sdk to include IOKit, libconv, and libcharset
The `build/macos-sdk.tar.xz` is a slimmed down bundle of the required
SDKs to build Radicle on MacOS.
IOKit, libconv, and libcharset were retrieved from
`phracker/MacOSX-SDKs`, see <https://github.com/phracker/MacOSX-SDKs>.
2026-02-19 21:02:22 +01:00
Fintan Halpenny 57a44daeb2 build: Update cargo-zigbuild to 0.22.1 2026-02-19 21:02:22 +01:00
Fintan Halpenny 89478b16fe cargo/git2: Update to 0.20.4
Update to `git2` to 0.20.4` and `radicle-surf` to 0.27.0.

This fixes a low severity vulnerability[^0].

[^0]: https://github.com/advisories/GHSA-j39j-6gw9-jw6h
2026-02-19 20:57:18 +01:00
Fintan Halpenny 423cf604e1 nix: update to 25.11
Obtain the latest tooling for the project by updating the nixpkgs
release to 25.11.
2026-02-18 09:50:16 +00:00
Lorenz Leutgeb 30701cc6fb node/runtime: Make `Runtime::run` more readable
A small refactoring that reorders arms of a match and makes them shorter
by precise imports.
2026-02-18 09:36:49 +00:00
Lorenz Leutgeb 057edf55b8 node/reactor: Introduce `LAG_TIMEOUT`
Since the service performs further I/O (e.g. uses SQLite), it can keep
the reactor runtime thread busy for long periods. Emit a warning if that
is the case.

100 ms is quite relaxed, this is to only catch severe cases and avoid
spamming the log.
2026-02-18 09:36:49 +00:00
Lorenz Leutgeb ae06111e07 node/reactor: Rewrite `Runtime::run`
More commentary and slight refactoring in `Runtime::run` to improve
readability.
2026-02-18 09:36:49 +00:00
Lorenz Leutgeb 4d7b942b75
remote-helper: Rename `to_branch_name`
Since `to_branch_name` consumes `self`, it should better be called
`into_branch_name`.

See also
<https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention>.
2026-02-18 00:07:49 +01:00
Lorenz Leutgeb 6d2a99e1ae
remote-helper: Remove Unused Error Variants
Previous minimization of visibility modifiers enables automated
removal of these unused variants.
2026-02-18 00:07:49 +01:00
Lorenz Leutgeb a69420b9b7
remote-helper: Rework Visibility Modifiers
Since this is a binary crate, `pub` is not necessary. By removing `pub`
at the boundary of the crate (`src/main.rs`) and working our way in we
obtain tighter boundaries. This enables dead-code elimination and more
liberal lints (see following two commits).
2026-02-18 00:07:49 +01:00
Adrian Duke d36ed7c8af remote-helper/protocol: Introduce Line and Command
A new module to model the domain of protocol lines and commands
being exchanged is introduced.

This is to increase readability and to pave the way for a
future sans I/O version of the binary crate.

Co-authored-by: Lorenz Leutgeb <lorenz.leutgeb@radicle.xyz>
2026-02-18 00:07:35 +01:00
Adrian Duke 27493c2229 remote-helper/service: Introduce `NodeSession`
Prefactor to add a trait capturing behaviour of the node.
2026-02-18 00:04:14 +01:00
Adrian Duke 56253b529e remote-helper/service: Introduce `GitService`
Prefactor to introduce `trait GitService` around the behaviour of
`fetch_pack` and `send_pack`.
2026-02-18 00:03:00 +01:00
Adrian Duke bd30e80b9a remote-helper/list: Remove printing to stdio
Prefactor to aid testing.
2026-02-18 00:00:14 +01:00
Lorenz Leutgeb 119445ce6c
cli-test: Move `let mut args` closer to its uses
In case a `cd` command is to be processed, no replacement of
environment variables in arguments is performed. This means that the
definition of `let mut args` and the replacement itself can be moved
closer to where `args` is then actually used, which is easier to
reason about.
2026-02-17 20:19:26 +01:00
Lorenz Leutgeb 56ece480ee
cli-test: Remove special handling for `rad`
The special handling for `rad` was introduced in commit
`e63f33489055962845c70976bd9a40d0d84c6b1c` without further comment.

Since we control the `$PATH` for spawning `rad`, and it is clear
that `rad` must be on the path, we do not need any special handing.

See also:
 - https://doc.rust-lang.org/std/process/struct.Command.html#method.new
 - https://github.com/rust-lang/rust/issues/15149
 - https://github.com/rust-lang/rust/issues/37519
2026-02-17 20:16:29 +01:00
Lorenz Leutgeb 3cd1af1dd5
cli-test: Configure `escargot` properly
Configuration calls to `escargot` were removed in commit `4894657b`.
An unintentional consequence are spurious failures to invoke freshly
compiled binaries in CLI tests.

Bring back the explicit configuration to remedy.
2026-02-17 18:59:59 +01:00
Lorenz Leutgeb 5aca9bf16a
cli-test: Refactor Path Handling
In the previous refactoring in commit `4894657b`, the order of entries
in `$PATH` was changed unintentionally. Revisit the order and use
nicer APIs to handle paths.
2026-02-17 18:59:59 +01:00
Adrian Duke d88ef3fa66 e2e: Introduce 3 tests for block command
1. It disconnects an active connection.
2. A blocked peer can not connect to us.
3. A blocked peer can not be fetched from.
2026-02-17 16:12:04 +01:00
Fintan Halpenny a4806f2718 node/test: check remote events for `Event::PeerDisconnected`
The node being connected to may be blocking the connecting node.
In this case the service will emit an event that says the connecting
node is disconnected.

Check the events for this event as well as `Event::PeerConnected`.
2026-02-17 16:12:04 +01:00