Skip to content

Commit 12c1e5c

Browse files
committed
work
1 parent 34b3998 commit 12c1e5c

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

src/app/firedancer/topology.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ setup_topo_store( fd_topo_t * topo,
8787
ulong fec_max,
8888
uint part_cnt ) {
8989
fd_topo_obj_t * obj = fd_topob_obj( topo, "store", wksp_name );
90+
FD_TEST( fd_pod_insert_ulong( topo->props, "store", obj->id ) );
9091
FD_TEST( fd_pod_insertf_ulong( topo->props, fec_max, "obj.%lu.fec_max", obj->id ) );
9192
FD_TEST( fd_pod_insertf_ulong( topo->props, part_cnt, "obj.%lu.part_cnt", obj->id ) );
9293
return obj;
@@ -787,11 +788,10 @@ fd_topo_initialize( config_t * config ) {
787788
fd_topob_wksp( topo, "rpcsrv" );
788789
fd_topo_tile_t * rpcserv_tile = fd_topob_tile( topo, "rpcsrv", "rpcsrv", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 1 );
789790
fd_topob_tile_uses( topo, rpcserv_tile, funk_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
791+
fd_topob_tile_uses( topo, rpcserv_tile, store_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
790792
fd_topob_tile_in( topo, "rpcsrv", 0UL, "metric_in", "replay_notif", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
791793
fd_topob_tile_in( topo, "rpcsrv", 0UL, "metric_in", "stake_out", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
792-
for( ulong j=0UL; j<shred_tile_cnt; j++ ) {
793-
fd_topob_tile_in( topo, "rpcsrv", 0UL, "metric_in", "shred_repair", j, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
794-
}
794+
fd_topob_tile_in( topo, "rpcsrv", 0UL, "metric_in", "repair_repla", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
795795
}
796796

797797
/* For now the only plugin consumer is the GUI */
@@ -1015,6 +1015,7 @@ fd_topo_configure_tile( fd_topo_tile_t * tile,
10151015
} else if( FD_UNLIKELY( !strcmp( tile->name, "rpcsrv" ) ) ) {
10161016
strncpy( tile->replay.blockstore_file, config->firedancer.blockstore.file, sizeof(tile->replay.blockstore_file) );
10171017
tile->rpcserv.funk_obj_id = fd_pod_query_ulong( config->topo.props, "funk", ULONG_MAX );
1018+
tile->rpcserv.store_obj_id = fd_pod_query_ulong( config->topo.props, "store", ULONG_MAX );
10181019
tile->rpcserv.rpc_port = config->rpc.port;
10191020
tile->rpcserv.tpu_port = config->tiles.quic.regular_transaction_listen_port;
10201021
tile->rpcserv.tpu_ip_addr = config->net.ip_addr;

src/disco/topo/fd_topo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ struct fd_topo_tile {
431431

432432
struct {
433433
ulong funk_obj_id;
434+
ulong store_obj_id;
434435
ushort rpc_port;
435436
ushort tpu_port;
436437
uint tpu_ip_addr;

src/discof/rpcserver/fd_rpc_service.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "../../ballet/base58/fd_base58.h"
88
#include "../../ballet/base64/fd_base64.h"
99
#include "../../ballet/shred/fd_shred.h"
10+
#include "../reasm/fd_reasm.h"
1011
#include "fd_rpc_history.h"
1112
#include "fd_block_to_json.h"
1213
#include "keywords.h"
@@ -93,7 +94,7 @@ struct fd_rpc_global_ctx {
9394
fd_perf_sample_t perf_sample_snapshot;
9495
long perf_sample_ts;
9596
fd_multi_epoch_leaders_t * leaders;
96-
uchar buffer[FD_SHRED_MAX_SZ > sizeof(fd_replay_notif_msg_t) ? FD_SHRED_MAX_SZ : sizeof(fd_replay_notif_msg_t)];
97+
uchar buffer[sizeof(fd_reasm_fec_t) > sizeof(fd_replay_notif_msg_t) ? sizeof(fd_reasm_fec_t) : sizeof(fd_replay_notif_msg_t)];
9798
ulong acct_age;
9899
fd_rpc_history_t * history;
99100
fd_pubkey_t const * identity_key; /* nullable */
@@ -2438,14 +2439,14 @@ fd_rpc_stake_after_frag(fd_rpc_ctx_t * ctx) {
24382439
}
24392440

24402441
void
2441-
fd_rpc_shred_repair_during_frag(fd_rpc_ctx_t * ctx, void const * msg, int sz) {
2442+
fd_rpc_repair_during_frag(fd_rpc_ctx_t * ctx, void const * msg, int sz) {
24422443
(void)sz;
2443-
fd_memcpy(ctx->global->buffer, msg, FD_SHRED_MAX_SZ);
2444+
fd_memcpy(ctx->global->buffer, msg, sizeof(fd_reasm_fec_t));
24442445
}
24452446

24462447
void
2447-
fd_rpc_shred_repair_after_frag(fd_rpc_ctx_t * ctx) {
2448+
fd_rpc_repair_after_frag(fd_rpc_ctx_t * ctx) {
24482449
fd_rpc_global_ctx_t * subs = ctx->global;
2449-
fd_shred_t * shred_p = (fd_shred_t *)subs->buffer;
2450-
fd_rpc_history_save_shred( subs->history, shred_p );
2450+
fd_reasm_fec_t * fec_p = (fd_reasm_fec_t *)subs->buffer;
2451+
(void)fec_p;
24512452
}

src/discof/rpcserver/fd_rpc_service.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ void fd_rpc_stake_during_frag(fd_rpc_ctx_t * ctx, void const * msg, int sz);
4242

4343
void fd_rpc_stake_after_frag(fd_rpc_ctx_t * ctx);
4444

45-
void fd_rpc_shred_repair_during_frag(fd_rpc_ctx_t * ctx, void const * msg, int sz);
45+
void fd_rpc_repair_during_frag(fd_rpc_ctx_t * ctx, void const * msg, int sz);
4646

47-
void fd_rpc_shred_repair_after_frag(fd_rpc_ctx_t * ctx);
47+
void fd_rpc_repair_after_frag(fd_rpc_ctx_t * ctx);
4848

4949
#endif /* HEADER_fd_src_discof_rpcserver_fd_rpc_service_h */

src/discof/rpcserver/fd_rpcserv_tile.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
#include <fcntl.h>
1515
#include <unistd.h>
1616

17-
#define IN_KIND_REPLAY_NOTIF 0
18-
#define IN_KIND_STAKE_OUT 1
19-
#define IN_KIND_SHRED_REPAIR 2
17+
#define IN_KIND_REPLAY_NOTIF 0
18+
#define IN_KIND_STAKE_OUT 1
19+
#define IN_KIND_REPAIR_REPLAY 2
2020

2121
#define MAX_IN_LINKS (16)
2222

@@ -105,8 +105,8 @@ during_frag( fd_rpcserv_tile_ctx_t * ctx,
105105
fd_rpc_replay_during_frag( ctx->ctx, fd_chunk_to_laddr_const( ctx->in_links[in_idx].mem, chunk ), (int)sz );
106106
} else if( FD_UNLIKELY( kind == IN_KIND_STAKE_OUT ) ) {
107107
fd_rpc_stake_during_frag( ctx->ctx, fd_chunk_to_laddr_const( ctx->in_links[in_idx].mem, chunk ), (int)sz );
108-
} else if( FD_UNLIKELY( kind == IN_KIND_SHRED_REPAIR ) ) {
109-
fd_rpc_shred_repair_during_frag( ctx->ctx, fd_chunk_to_laddr_const( ctx->in_links[in_idx].mem, chunk ), (int)sz );
108+
} else if( FD_UNLIKELY( kind == IN_KIND_REPAIR_REPLAY ) ) {
109+
fd_rpc_repair_during_frag( ctx->ctx, fd_chunk_to_laddr_const( ctx->in_links[in_idx].mem, chunk ), (int)sz );
110110
} else {
111111
FD_LOG_ERR(("Unknown in_idx %lu for rpc", in_idx));
112112
}
@@ -138,8 +138,8 @@ after_frag( fd_rpcserv_tile_ctx_t * ctx,
138138
fd_rpc_replay_after_frag( ctx->ctx );
139139
} else if( FD_UNLIKELY( kind == IN_KIND_STAKE_OUT ) ) {
140140
fd_rpc_stake_after_frag( ctx->ctx );
141-
} else if( FD_UNLIKELY( kind == IN_KIND_SHRED_REPAIR ) ) {
142-
fd_rpc_shred_repair_after_frag( ctx->ctx );
141+
} else if( FD_UNLIKELY( kind == IN_KIND_REPAIR_REPLAY ) ) {
142+
fd_rpc_repair_after_frag( ctx->ctx );
143143
} else {
144144
FD_LOG_ERR(("Unknown in_idx %lu for rpc", in_idx));
145145
}
@@ -212,8 +212,8 @@ unprivileged_init( fd_topo_t * topo,
212212
ctx->in_kind[ in_idx ] = IN_KIND_REPLAY_NOTIF;
213213
} else if( 0==strcmp( link->name, "stake_out" ) ) {
214214
ctx->in_kind[ in_idx ] = IN_KIND_STAKE_OUT;
215-
} else if( 0==strcmp( link->name, "shred_repair" ) ) {
216-
ctx->in_kind[ in_idx ] = IN_KIND_SHRED_REPAIR;
215+
} else if( 0==strcmp( link->name, "repair_repla" ) ) {
216+
ctx->in_kind[ in_idx ] = IN_KIND_REPAIR_REPLAY;
217217
} else {
218218
FD_LOG_ERR(( "rpcserv tile has unexpected input link %s", link->name ));
219219
}

0 commit comments

Comments
 (0)