Skip to content

Commit 683cfed

Browse files
committed
replay/arxiv: set up shred archiving tile
1 parent adfa825 commit 683cfed

19 files changed

+924
-80
lines changed

src/app/firedancer-dev/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ extern fd_topo_run_tile_t fd_tile_repair;
8080
extern fd_topo_run_tile_t fd_tile_storei;
8181
extern fd_topo_run_tile_t fd_tile_replay;
8282
extern fd_topo_run_tile_t fd_tile_replay_thread;
83+
extern fd_topo_run_tile_t fd_tile_arxiv;
8384
extern fd_topo_run_tile_t fd_tile_execor;
8485
extern fd_topo_run_tile_t fd_tile_batch;
8586
extern fd_topo_run_tile_t fd_tile_batch_thread;
@@ -109,6 +110,7 @@ fd_topo_run_tile_t * TILES[] = {
109110
&fd_tile_storei,
110111
&fd_tile_replay,
111112
&fd_tile_replay_thread,
113+
&fd_tile_arxiv,
112114
&fd_tile_execor,
113115
&fd_tile_batch,
114116
&fd_tile_batch_thread,

src/app/firedancer/topology.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ fd_topo_initialize( config_t * config ) {
213213
fd_topob_wksp( topo, "voter_gossip" );
214214
fd_topob_wksp( topo, "voter_dedup" );
215215
fd_topob_wksp( topo, "batch_replay" );
216+
fd_topob_wksp( topo, "replay_arxiv" );
216217

217218
fd_topob_wksp( topo, "rstart_gossi" );
218219
fd_topob_wksp( topo, "gossi_rstart" );
@@ -240,6 +241,7 @@ fd_topo_initialize( config_t * config ) {
240241
fd_topob_wksp( topo, "voter" );
241242
fd_topob_wksp( topo, "poh_slot" );
242243
fd_topob_wksp( topo, "eqvoc" );
244+
fd_topob_wksp( topo, "arxiv" );
243245
fd_topob_wksp( topo, "batch" );
244246
fd_topob_wksp( topo, "btpool" );
245247
fd_topob_wksp( topo, "constipate" );
@@ -295,6 +297,7 @@ fd_topo_initialize( config_t * config ) {
295297
/**/ fd_topob_link( topo, "poh_pack", "replay_poh", 128UL, sizeof(fd_became_leader_t) , 1UL );
296298

297299
/**/ fd_topob_link( topo, "replay_voter", "replay_voter", 128UL, sizeof(fd_txn_p_t), 1UL );
300+
/**/ fd_topob_link( topo, "replay_arxiv", "replay_arxiv", 128UL, sizeof(ulong), 1UL );
298301
/**/ fd_topob_link( topo, "voter_gossip", "voter_gossip", 128UL, FD_TXN_MTU, 1UL );
299302
/**/ fd_topob_link( topo, "voter_sign", "voter_sign", 128UL, FD_TXN_MTU, 1UL );
300303
/**/ fd_topob_link( topo, "sign_voter", "sign_voter", 128UL, 64UL, 1UL );
@@ -355,6 +358,7 @@ fd_topo_initialize( config_t * config ) {
355358
/**/ fd_topob_tile( topo, "sender", "voter", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
356359
/**/ fd_topob_tile( topo, "bhole", "bhole", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
357360
/**/ fd_topob_tile( topo, "eqvoc", "eqvoc", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
361+
/**/ fd_topob_tile( topo, "arxiv", "arxiv", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
358362
359363
/**/ fd_topob_tile( topo, "replay", "replay", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
360364
/* These thread tiles must be defined immediately after the replay tile. We subtract one because the replay tile acts as a thread in the tpool as well. */
@@ -377,6 +381,7 @@ fd_topo_initialize( config_t * config ) {
377381
fd_topo_tile_t * batch_tile = &topo->tiles[ fd_topo_find_tile( topo, "batch" , 0UL ) ];
378382
fd_topo_tile_t * pack_tile = &topo->tiles[ fd_topo_find_tile( topo, "pack" , 0UL ) ];
379383
fd_topo_tile_t * exec_tile = &topo->tiles[ fd_topo_find_tile( topo, "exec" , 0UL ) ];
384+
fd_topo_tile_t * arxiv_tile = &topo->tiles[ fd_topo_find_tile( topo, "arxiv" , 0UL ) ];
380385

381386
/* Create a shared blockstore to be used by store and replay. */
382387
fd_topo_obj_t * blockstore_obj = setup_topo_blockstore( topo,
@@ -389,6 +394,8 @@ fd_topo_initialize( config_t * config ) {
389394
fd_topob_tile_uses( topo, store_tile, blockstore_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
390395
fd_topob_tile_uses( topo, replay_tile, blockstore_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
391396
fd_topob_tile_uses( topo, repair_tile, blockstore_obj, FD_SHMEM_JOIN_MODE_READ_ONLY );
397+
fd_topob_tile_uses( topo, arxiv_tile, blockstore_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
398+
392399
if( enable_rpc ) {
393400
fd_topo_tile_t * rpcserv_tile = &topo->tiles[ fd_topo_find_tile( topo, "rpcsrv", 0UL ) ];
394401
fd_topob_tile_uses( topo, rpcserv_tile, blockstore_obj, FD_SHMEM_JOIN_MODE_READ_ONLY );
@@ -554,6 +561,7 @@ fd_topo_initialize( config_t * config ) {
554561
/**/ fd_topob_tile_in( topo, "replay", 0UL, "metric_in", "pack_replay", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
555562
/**/ fd_topob_tile_in( topo, "replay", 0UL, "metric_in", "batch_replay", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
556563
/**/ fd_topob_tile_out( topo, "replay", 0UL, "replay_voter", 0UL );
564+
/**/ fd_topob_tile_out( topo, "replay", 0UL, "replay_arxiv", 0UL );
557565
FOR(bank_tile_cnt) fd_topob_tile_out( topo, "replay", 0UL, "replay_poh", i );
558566
FOR(exec_tile_cnt) fd_topob_tile_out( topo, "replay", 0UL, "replay_exec", i ); /* TODO check order in fd_replay.c macros*/
559567
FOR(shred_tile_cnt) fd_topob_tile_in( topo, "replay", 0UL, "metric_in", "shred_replay", i, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
@@ -589,6 +597,7 @@ fd_topo_initialize( config_t * config ) {
589597
/**/ fd_topob_tile_out( topo, "repair", 0UL, "repair_sign", 0UL );
590598
/**/ fd_topob_tile_in( topo, "repair", 0UL, "metric_in", "sign_repair", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_UNPOLLED );
591599
/**/ fd_topob_tile_out( topo, "repair", 0UL, "repair_repla", 0UL );
600+
/**/ fd_topob_tile_in( topo, "arxiv", 0UL, "metric_in", "replay_arxiv", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
592601
/**/ fd_topob_tile_out( topo, "sign", 0UL, "sign_repair", 0UL );
593602

594603
FOR(shred_tile_cnt) fd_topob_tile_in( topo, "eqvoc", 0UL, "metric_in", "shred_net", i, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
@@ -761,6 +770,9 @@ fd_topo_initialize( config_t * config ) {
761770
tile->replay.full_interval = config->tiles.batch.full_interval;
762771
tile->replay.incremental_interval = config->tiles.batch.incremental_interval;
763772

773+
} else if( FD_UNLIKELY( !strcmp( tile->name, "arxiv" ) ) ) {
774+
strncpy( tile->arxiv.blockstore_file, config->blockstore.file, sizeof(tile->arxiv.blockstore_file) );
775+
764776
} else if( FD_UNLIKELY( !strcmp( tile->name, "bhole" ) ) ) {
765777

766778
} else if( FD_UNLIKELY( !strcmp( tile->name, "sign" ) ) ) {

src/app/ledger/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ replay( fd_ledger_args_t * args ) {
13291329

13301330
fd_ledger_main_setup( args );
13311331

1332-
fd_blockstore_init( args->blockstore, -1, FD_BLOCKSTORE_ARCHIVE_MIN_SIZE, &args->slot_ctx->slot_bank );
1332+
fd_blockstore_init( args->blockstore, &args->slot_ctx->slot_bank );
13331333
fd_buf_shred_pool_reset( args->blockstore->shred_pool, 0 );
13341334

13351335
FD_LOG_WARNING(( "setup done" ));

src/disco/fd_disco_base.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,22 @@ FD_FN_CONST static inline uint fd_disco_repair_replay_sig_data_cnt ( ulong
168168
FD_FN_CONST static inline ushort fd_disco_repair_replay_sig_parent_off ( ulong sig ) { return (ushort)fd_ulong_extract ( sig, 1, 16 ); }
169169
FD_FN_CONST static inline int fd_disco_repair_replay_sig_slot_complete( ulong sig ) { return fd_ulong_extract_bit( sig, 0 ); }
170170

171+
FD_FN_CONST static inline ulong
172+
fd_disco_replay_arxiv_sig( ulong slot, uint start_idx, uint end_idx ){
173+
/*
174+
| slot (32) | start_idx (16) | end_idx (16) |
175+
| [32, 63] | [16, 31] | [0, 15] |
176+
*/
177+
ulong slot_ul = fd_ulong_min( slot, (ulong)UINT_MAX );
178+
ulong start_idx_ul = (ulong)start_idx;
179+
ulong end_idx_ul = (ulong)end_idx;
180+
return slot_ul << 32 | start_idx_ul << 16 | end_idx_ul;
181+
}
182+
183+
FD_FN_CONST static inline ulong fd_disco_replay_arxiv_sig_slot ( ulong sig ) { return fd_ulong_extract( sig, 32, 63 ); }
184+
FD_FN_CONST static inline uint fd_disco_replay_arxiv_sig_start_idx( ulong sig ) { return (uint)fd_ulong_extract( sig, 16, 31 ); }
185+
FD_FN_CONST static inline uint fd_disco_replay_arxiv_sig_end_idx ( ulong sig ) { return (uint)fd_ulong_extract( sig, 0, 15 ); }
186+
171187
FD_FN_PURE static inline ulong
172188
fd_disco_compact_chunk0( void * wksp ) {
173189
return (((struct fd_wksp_private *)wksp)->gaddr_lo) >> FD_CHUNK_LG_SZ;

src/disco/topo/fd_topo.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,10 @@ typedef struct {
384384
char identity_key_path[ PATH_MAX ];
385385
} eqvoc;
386386

387+
struct {
388+
char blockstore_file[ PATH_MAX ];
389+
} arxiv;
390+
387391
struct {
388392
ushort rpc_port;
389393
ushort tpu_port;

src/disco/topo/fd_topob.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ fd_topob_auto_layout( fd_topo_t * topo ) {
366366
"gossip", /* FIREDANCER only */
367367
"repair", /* FIREDANCER only */
368368
"replay", /* FIREDANCER only */
369+
"arxiv", /* FIREDANCER only */
369370
"exec", /* FIREDANCER only */
370371
"rtpool", /* FIREDANCER only */
371372
"sender", /* FIREDANCER only */

src/discof/arxiv/Local.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ifdef FD_HAS_INT128
2+
ifdef FD_HAS_SSE
3+
$(call add-objs,fd_shred_arxiv fd_arxiv_tile,fd_discof)
4+
$(call make-unit-test,test_arxiv,test_arxiv,fd_discof fd_flamenco fd_ballet fd_util)
5+
endif
6+
endif

src/discof/arxiv/fd_arxiv_tile.c

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
#include <stdlib.h>
2+
#define _GNU_SOURCE
3+
#include "../../disco/tiles.h"
4+
#include "generated/fd_arxiv_tile_seccomp.h"
5+
#include "fd_shred_arxiv.h"
6+
#include "../../disco/topo/fd_pod_format.h"
7+
8+
#define REPLAY_IN_IDX 0UL
9+
10+
struct fd_arxiv_tile_ctx {
11+
fd_shred_arxiver_t * arxiver;
12+
int arxiver_fd; /* file descriptor for the archive file */
13+
fd_blockstore_t blockstore_ljoin;
14+
fd_blockstore_t * blockstore;
15+
16+
void * replay_in_mem;
17+
ulong replay_in_chunk0;
18+
ulong replay_in_wmark;
19+
};
20+
typedef struct fd_arxiv_tile_ctx fd_arxiv_tile_ctx_t;
21+
22+
FD_FN_CONST static inline ulong
23+
scratch_align( void ) {
24+
return 128UL;
25+
}
26+
27+
FD_FN_PURE static inline ulong
28+
scratch_footprint( fd_topo_tile_t const * tile FD_PARAM_UNUSED ) {
29+
/* clang-format off */
30+
ulong l = FD_LAYOUT_INIT;
31+
l = FD_LAYOUT_APPEND( l, alignof(fd_arxiv_tile_ctx_t), sizeof(fd_arxiv_tile_ctx_t) );
32+
l = FD_LAYOUT_APPEND( l, fd_shred_arxiv_align(), fd_shred_arxiv_footprint( FD_SHRED_ARXIV_MIN_SIZE ) );
33+
return FD_LAYOUT_FINI( l, scratch_align() );
34+
/* clang-format on */
35+
}
36+
37+
static void
38+
during_frag( fd_arxiv_tile_ctx_t * ctx,
39+
ulong in_idx,
40+
ulong seq FD_PARAM_UNUSED,
41+
ulong sig FD_PARAM_UNUSED,
42+
ulong chunk,
43+
ulong sz,
44+
ulong ctl FD_PARAM_UNUSED ) {
45+
46+
if( in_idx == REPLAY_IN_IDX ) {
47+
if( FD_UNLIKELY( chunk<ctx->replay_in_chunk0 || chunk>ctx->replay_in_wmark || sz>USHORT_MAX ) ) {
48+
FD_LOG_ERR(( "chunk %lu %lu corrupt, not in range [%lu,%lu]", chunk, sz, ctx->replay_in_chunk0, ctx->replay_in_wmark ));
49+
}
50+
ulong slot = fd_disco_replay_arxiv_sig_slot( sig );
51+
uint start_idx = fd_disco_replay_arxiv_sig_start_idx( sig );
52+
uint end_idx = fd_disco_replay_arxiv_sig_end_idx( sig );
53+
54+
fd_shreds_checkpt( ctx->arxiver, ctx->blockstore, slot, start_idx, end_idx );
55+
}
56+
57+
(void)chunk;
58+
(void)sz;
59+
}
60+
61+
static void
62+
after_frag( fd_arxiv_tile_ctx_t * ctx,
63+
ulong in_idx FD_PARAM_UNUSED,
64+
ulong seq FD_PARAM_UNUSED,
65+
ulong sig FD_PARAM_UNUSED,
66+
ulong sz FD_PARAM_UNUSED,
67+
ulong tsorig FD_PARAM_UNUSED,
68+
ulong tspub FD_PARAM_UNUSED,
69+
fd_stem_context_t * stem FD_PARAM_UNUSED ) {
70+
(void)ctx;
71+
/* Let's test for fun that the shred was written to file properly */
72+
if( in_idx == REPLAY_IN_IDX ) {
73+
FD_LOG_WARNING(( "replay in idx %lu", in_idx ));
74+
ulong slot = fd_disco_replay_arxiv_sig_slot( sig );
75+
uint end_idx = fd_disco_replay_arxiv_sig_end_idx( sig );
76+
77+
fd_shred_idx_t * idx = fd_shred_idx_query( ctx->arxiver->shred_idx, slot << 32 | end_idx, NULL );
78+
uchar shred_buf[FD_SHRED_MIN_SZ];
79+
int err = fd_shred_restore( ctx->arxiver, idx, shred_buf, FD_SHRED_MIN_SZ );
80+
FD_TEST( err == 0 );
81+
const fd_shred_t * shred = fd_shred_parse( shred_buf, FD_SHRED_MIN_SZ );
82+
FD_TEST( shred->slot == slot );
83+
FD_TEST( shred->idx == end_idx );
84+
}
85+
86+
}
87+
88+
static void
89+
privileged_init( fd_topo_t * topo FD_PARAM_UNUSED,
90+
fd_topo_tile_t * tile FD_PARAM_UNUSED ) {
91+
void * scratch = fd_topo_obj_laddr( topo, tile->tile_obj_id );
92+
93+
FD_SCRATCH_ALLOC_INIT( l, scratch );
94+
fd_arxiv_tile_ctx_t * ctx = FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_arxiv_tile_ctx_t), sizeof(fd_arxiv_tile_ctx_t) );
95+
FD_SCRATCH_ALLOC_FINI( l, scratch_align() );
96+
memset( ctx, 0, sizeof(fd_arxiv_tile_ctx_t) );
97+
98+
ctx->arxiver_fd = open( tile->arxiv.blockstore_file, O_RDWR|O_CREAT, 0666 );
99+
if( FD_UNLIKELY( ctx->arxiver_fd==-1 ) ) {
100+
FD_LOG_ERR(( "failed to open arxiver fd" ));
101+
}
102+
103+
104+
}
105+
106+
static void
107+
unprivileged_init( fd_topo_t * topo,
108+
fd_topo_tile_t * tile ) {
109+
void * scratch = fd_topo_obj_laddr( topo, tile->tile_obj_id );
110+
111+
FD_SCRATCH_ALLOC_INIT( l, scratch );
112+
fd_arxiv_tile_ctx_t * ctx = FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_arxiv_tile_ctx_t), sizeof(fd_arxiv_tile_ctx_t) );
113+
void * arxiver = FD_SCRATCH_ALLOC_APPEND( l, fd_shred_arxiv_align(), fd_shred_arxiv_footprint( FD_SHRED_ARXIV_MIN_SIZE ) );
114+
ulong scratch_alloc_mem = FD_SCRATCH_ALLOC_FINI( l, scratch_align() );
115+
if( FD_UNLIKELY( scratch_alloc_mem - (ulong)scratch - scratch_footprint( tile ) ) ) {
116+
FD_LOG_ERR(( "scratch footprint mismatch" ));
117+
}
118+
119+
ulong blockstore_obj_id = fd_pod_queryf_ulong( topo->props, ULONG_MAX,"blockstore" );
120+
FD_TEST( blockstore_obj_id!=ULONG_MAX );
121+
ctx->blockstore = fd_blockstore_join( &ctx->blockstore_ljoin, fd_topo_obj_laddr( topo, blockstore_obj_id ) );
122+
123+
FD_TEST( ctx->blockstore->shmem->magic == FD_BLOCKSTORE_MAGIC );
124+
125+
ctx->arxiver = fd_shred_arxiv_join( fd_shred_arxiv_new( arxiver, FD_SHRED_ARXIV_MIN_SIZE ) );
126+
ctx->arxiver->fd = ctx->arxiver_fd;
127+
128+
/**********************************************************************/
129+
/* links */
130+
/**********************************************************************/
131+
132+
/* Setup replay tile input */
133+
fd_topo_link_t * replay_in_link = &topo->links[ tile->in_link_id[ REPLAY_IN_IDX ] ];
134+
ctx->replay_in_mem = topo->workspaces[ topo->objs[ replay_in_link->dcache_obj_id ].wksp_id ].wksp;
135+
ctx->replay_in_chunk0 = fd_dcache_compact_chunk0( ctx->replay_in_mem, replay_in_link->dcache );
136+
ctx->replay_in_wmark = fd_dcache_compact_wmark( ctx->replay_in_mem, replay_in_link->dcache, replay_in_link->mtu );
137+
138+
139+
}
140+
141+
static void
142+
after_credit( fd_arxiv_tile_ctx_t * ctx,
143+
fd_stem_context_t * stem FD_PARAM_UNUSED,
144+
int * opt_poll_in FD_PARAM_UNUSED,
145+
int * charge_busy FD_PARAM_UNUSED ) {
146+
(void)ctx;
147+
}
148+
149+
static ulong
150+
populate_allowed_seccomp( fd_topo_t const * topo,
151+
fd_topo_tile_t const * tile,
152+
ulong out_cnt,
153+
struct sock_filter * out ) {
154+
155+
void * scratch = fd_topo_obj_laddr( topo, tile->tile_obj_id );
156+
157+
FD_SCRATCH_ALLOC_INIT( l, scratch );
158+
fd_arxiv_tile_ctx_t * ctx = FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_arxiv_tile_ctx_t), sizeof(fd_arxiv_tile_ctx_t) );
159+
FD_SCRATCH_ALLOC_FINI( l, sizeof(fd_arxiv_tile_ctx_t) );
160+
161+
populate_sock_filter_policy_fd_arxiv_tile( out_cnt, out, (uint)fd_log_private_logfile_fd(), (uint)ctx->arxiver_fd );
162+
return sock_filter_policy_fd_arxiv_tile_instr_cnt;
163+
}
164+
165+
static ulong
166+
populate_allowed_fds( fd_topo_t const * topo,
167+
fd_topo_tile_t const * tile,
168+
ulong out_fds_cnt,
169+
int * out_fds ) {
170+
void * scratch = fd_topo_obj_laddr( topo, tile->tile_obj_id );
171+
172+
FD_SCRATCH_ALLOC_INIT( l, scratch );
173+
fd_arxiv_tile_ctx_t * ctx = FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_arxiv_tile_ctx_t), sizeof(fd_arxiv_tile_ctx_t) );
174+
FD_SCRATCH_ALLOC_FINI( l, sizeof(fd_arxiv_tile_ctx_t) );
175+
176+
if( FD_UNLIKELY( out_fds_cnt<2UL ) ) FD_LOG_ERR(( "out_fds_cnt %lu", out_fds_cnt ));
177+
178+
ulong out_cnt = 0UL;
179+
out_fds[ out_cnt++ ] = 2; /* stderr */
180+
if( FD_LIKELY( -1!=fd_log_private_logfile_fd() ) )
181+
out_fds[ out_cnt++ ] = fd_log_private_logfile_fd(); /* logfile */
182+
out_fds[ out_cnt++ ] = ctx->arxiver_fd; /* shred store fd */
183+
return out_cnt;
184+
}
185+
186+
187+
#define STEM_BURST (1UL)
188+
189+
#define STEM_CALLBACK_CONTEXT_TYPE fd_arxiv_tile_ctx_t
190+
#define STEM_CALLBACK_CONTEXT_ALIGN alignof(fd_arxiv_tile_ctx_t)
191+
192+
#define STEM_CALLBACK_DURING_FRAG during_frag
193+
#define STEM_CALLBACK_AFTER_FRAG after_frag
194+
#define STEM_CALLBACK_AFTER_CREDIT after_credit
195+
196+
#include "../../disco/stem/fd_stem.c"
197+
198+
fd_topo_run_tile_t fd_tile_arxiv = {
199+
.name = "arxiv",
200+
.loose_footprint = 0UL,
201+
.populate_allowed_seccomp = populate_allowed_seccomp,
202+
.populate_allowed_fds = populate_allowed_fds,
203+
.scratch_align = scratch_align,
204+
.scratch_footprint = scratch_footprint,
205+
.privileged_init = privileged_init,
206+
.unprivileged_init = unprivileged_init,
207+
.run = stem_run,
208+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# logfile_fd: It can be disabled by configuration, but typically tiles
2+
# will open a log file on boot and write all messages there.
3+
unsigned int logfile_fd, unsigned int blockstore_fd
4+
5+
# logging: all log messages are written to a file and/or pipe
6+
#
7+
# 'WARNING' and above are written to the STDERR pipe, while all messages
8+
# are always written to the log file.
9+
#
10+
# arg 0 is the file descriptor to write to. The boot process ensures
11+
# that descriptor 2 is always STDERR.
12+
write: (or (eq (arg 0) 2)
13+
(eq (arg 0) logfile_fd)
14+
(eq (arg 0) blockstore_fd))
15+
16+
# logging: 'WARNING' and above fsync the logfile to disk immediately
17+
#
18+
# arg 0 is the file descriptor to fsync.
19+
fsync: (eq (arg 0) logfile_fd)
20+
21+
# blockstore: read archival file
22+
read: (eq (arg 0) blockstore_fd)
23+
24+
# blockstore: lseek archival file
25+
lseek: (eq (arg 0) blockstore_fd)

0 commit comments

Comments
 (0)