Skip to content

Commit

Permalink
RPC server: io_uring upgrade WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
InKryption committed Jan 20, 2025
1 parent a0a4b72 commit 9f42c0c
Show file tree
Hide file tree
Showing 9 changed files with 1,582 additions and 408 deletions.
1 change: 1 addition & 0 deletions src/accountsdb/db.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3390,6 +3390,7 @@ test "testWriteSnapshot" {
);
}

/// Unpacks the snapshots from `sig.TEST_DATA_DIR`.
pub fn findAndUnpackTestSnapshots(
n_threads: usize,
/// The directory into which the snapshots are unpacked.
Expand Down
11 changes: 6 additions & 5 deletions src/accountsdb/snapshots.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,7 @@ pub const FullSnapshotFileInfo = struct {
slot: Slot,
hash: Hash,

const SnapshotArchiveNameFmtSpec = sig.utils.fmt.BoundedSpec("snapshot-{[slot]d}-{[hash]s}.tar.zst");
pub const SnapshotArchiveNameFmtSpec = sig.utils.fmt.BoundedSpec("snapshot-{[slot]d}-{[hash]s}.tar.zst");

pub const SnapshotArchiveNameStr = SnapshotArchiveNameFmtSpec.BoundedArrayValue(.{
.slot = std.math.maxInt(Slot),
Expand Down Expand Up @@ -2352,7 +2352,7 @@ pub const IncrementalSnapshotFileInfo = struct {
};
}

const SnapshotArchiveNameFmtSpec = sig.utils.fmt.BoundedSpec("incremental-snapshot-{[base_slot]d}-{[slot]d}-{[hash]s}.tar.zst");
pub const SnapshotArchiveNameFmtSpec = sig.utils.fmt.BoundedSpec("incremental-snapshot-{[base_slot]d}-{[slot]d}-{[hash]s}.tar.zst");

pub const SnapshotArchiveNameStr = SnapshotArchiveNameFmtSpec.BoundedArrayValue(.{
.base_slot = std.math.maxInt(Slot),
Expand Down Expand Up @@ -2498,15 +2498,16 @@ pub const SnapshotFiles = struct {
full: FullSnapshotFileInfo,
incremental_info: ?SlotAndHash,

pub fn incremental(snapshot_files: SnapshotFiles) ?IncrementalSnapshotFileInfo {
const inc_info = snapshot_files.incremental_info orelse return null;
pub fn incremental(self: SnapshotFiles) ?IncrementalSnapshotFileInfo {
const inc_info = self.incremental_info orelse return null;
return .{
.base_slot = snapshot_files.full.slot,
.base_slot = self.full.slot,
.slot = inc_info.slot,
.hash = inc_info.hash,
};
}

/// Asserts that `if (maybe_incremental_info) |inc| inc.base_slot == full_info.slot`.
pub fn fromFileInfos(
full_info: FullSnapshotFileInfo,
maybe_incremental_info: ?IncrementalSnapshotFileInfo,
Expand Down
1 change: 0 additions & 1 deletion src/rpc/lib.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ pub const response = @import("response.zig");
pub const types = @import("types.zig");

pub const Client = client.Client;
pub const Server = server.Server;

pub const Request = request.Request;
pub const Response = response.Response;
Loading

0 comments on commit 9f42c0c

Please sign in to comment.