Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/cmd.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1666,6 +1666,17 @@ fn validator(
.slot_tracker = &replay_service_state.replay_state.slot_tracker,
});

const account_store = sig.accounts_db.AccountStore{
.accounts_db_two = &new_db,
};
try app_base.rpc_hooks.set(
allocator,
sig.rpc.methods.AccountHookContext{
.slot_tracker = &replay_service_state.replay_state.slot_tracker,
.account_reader = account_store.reader(),
},
);

const replay_thread = try replay_service_state.spawnService(
&app_base,
if (maybe_vote_sockets) |*vs| vs else null,
Expand Down
15 changes: 15 additions & 0 deletions src/core/epoch_schedule.zig
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ pub const EpochSchedule = extern struct {
.warmup = true,
});

pub fn jsonStringify(self: EpochSchedule, jw: anytype) @TypeOf(jw.*).Error!void {
try jw.beginObject();
try jw.objectField("slotsPerEpoch");
try jw.write(self.slots_per_epoch);
try jw.objectField("leaderScheduleSlotOffset");
try jw.write(self.leader_schedule_slot_offset);
try jw.objectField("warmup");
try jw.write(self.warmup);
try jw.objectField("firstNormalEpoch");
try jw.write(self.first_normal_epoch);
try jw.objectField("firstNormalSlot");
try jw.write(self.first_normal_slot);
try jw.endObject();
}

pub fn getEpoch(self: *const EpochSchedule, slot: Slot) Epoch {
return self.getEpochAndSlotIndex(slot)[0];
}
Expand Down
4 changes: 4 additions & 0 deletions src/core/hash.zig
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ pub const Hash = extern struct {
};
}

pub fn jsonStringify(self: Hash, jw: anytype) !void {
try jw.write(self.base58String().constSlice());
}

/// Intended to be used in tests.
pub fn initRandom(random: std.Random) Hash {
var data: [SIZE]u8 = undefined;
Expand Down
Loading